Unverified Commit edc154da authored by Dhruv Nair's avatar Dhruv Nair Committed by GitHub
Browse files

Update Ruff to latest Version (#10919)

* update

* update

* update

* update
parent 552cd320
...@@ -205,7 +205,7 @@ def load_state_dict( ...@@ -205,7 +205,7 @@ def load_state_dict(
) from e ) from e
except (UnicodeDecodeError, ValueError): except (UnicodeDecodeError, ValueError):
raise OSError( raise OSError(
f"Unable to load weights from checkpoint file for '{checkpoint_file}' " f"at '{checkpoint_file}'. " f"Unable to load weights from checkpoint file for '{checkpoint_file}' at '{checkpoint_file}'. "
) )
......
...@@ -211,9 +211,9 @@ class Transformer2DModel(LegacyModelMixin, LegacyConfigMixin): ...@@ -211,9 +211,9 @@ class Transformer2DModel(LegacyModelMixin, LegacyConfigMixin):
def _init_vectorized_inputs(self, norm_type): def _init_vectorized_inputs(self, norm_type):
assert self.config.sample_size is not None, "Transformer2DModel over discrete input must provide sample_size" assert self.config.sample_size is not None, "Transformer2DModel over discrete input must provide sample_size"
assert ( assert self.config.num_vector_embeds is not None, (
self.config.num_vector_embeds is not None "Transformer2DModel over discrete input must provide num_embed"
), "Transformer2DModel over discrete input must provide num_embed" )
self.height = self.config.sample_size self.height = self.config.sample_size
self.width = self.config.sample_size self.width = self.config.sample_size
......
...@@ -791,7 +791,7 @@ class AudioLDM2Pipeline(DiffusionPipeline): ...@@ -791,7 +791,7 @@ class AudioLDM2Pipeline(DiffusionPipeline):
if transcription is None: if transcription is None:
if self.text_encoder_2.config.model_type == "vits": if self.text_encoder_2.config.model_type == "vits":
raise ValueError("Cannot forward without transcription. Please make sure to" " have transcription") raise ValueError("Cannot forward without transcription. Please make sure to have transcription")
elif transcription is not None and ( elif transcription is not None and (
not isinstance(transcription, str) and not isinstance(transcription, list) not isinstance(transcription, str) and not isinstance(transcription, list)
): ):
......
...@@ -657,7 +657,7 @@ class StableDiffusionControlNetInpaintPipeline( ...@@ -657,7 +657,7 @@ class StableDiffusionControlNetInpaintPipeline(
if padding_mask_crop is not None: if padding_mask_crop is not None:
if not isinstance(image, PIL.Image.Image): if not isinstance(image, PIL.Image.Image):
raise ValueError( raise ValueError(
f"The image should be a PIL image when inpainting mask crop, but is of type" f" {type(image)}." f"The image should be a PIL image when inpainting mask crop, but is of type {type(image)}."
) )
if not isinstance(mask_image, PIL.Image.Image): if not isinstance(mask_image, PIL.Image.Image):
raise ValueError( raise ValueError(
...@@ -665,7 +665,7 @@ class StableDiffusionControlNetInpaintPipeline( ...@@ -665,7 +665,7 @@ class StableDiffusionControlNetInpaintPipeline(
f" {type(mask_image)}." f" {type(mask_image)}."
) )
if output_type != "pil": if output_type != "pil":
raise ValueError(f"The output type should be PIL when inpainting mask crop, but is" f" {output_type}.") raise ValueError(f"The output type should be PIL when inpainting mask crop, but is {output_type}.")
# `prompt` needs more sophisticated handling when there are multiple # `prompt` needs more sophisticated handling when there are multiple
# conditionings. # conditionings.
......
...@@ -1130,7 +1130,7 @@ class EasyAnimateInpaintPipeline(DiffusionPipeline): ...@@ -1130,7 +1130,7 @@ class EasyAnimateInpaintPipeline(DiffusionPipeline):
f"Incorrect configuration settings! The config of `pipeline.transformer`: {self.transformer.config} expects" f"Incorrect configuration settings! The config of `pipeline.transformer`: {self.transformer.config} expects"
f" {self.transformer.config.in_channels} but received `num_channels_latents`: {num_channels_latents} +" f" {self.transformer.config.in_channels} but received `num_channels_latents`: {num_channels_latents} +"
f" `num_channels_mask`: {num_channels_mask} + `num_channels_masked_image`: {num_channels_masked_image}" f" `num_channels_mask`: {num_channels_mask} + `num_channels_masked_image`: {num_channels_masked_image}"
f" = {num_channels_latents+num_channels_masked_image+num_channels_mask}. Please verify the config of" f" = {num_channels_latents + num_channels_masked_image + num_channels_mask}. Please verify the config of"
" `pipeline.transformer` or your `mask_image` or `image` input." " `pipeline.transformer` or your `mask_image` or `image` input."
) )
......
...@@ -507,7 +507,7 @@ class FluxControlNetInpaintPipeline(DiffusionPipeline, FluxLoraLoaderMixin, From ...@@ -507,7 +507,7 @@ class FluxControlNetInpaintPipeline(DiffusionPipeline, FluxLoraLoaderMixin, From
if padding_mask_crop is not None: if padding_mask_crop is not None:
if not isinstance(image, PIL.Image.Image): if not isinstance(image, PIL.Image.Image):
raise ValueError( raise ValueError(
f"The image should be a PIL image when inpainting mask crop, but is of type" f" {type(image)}." f"The image should be a PIL image when inpainting mask crop, but is of type {type(image)}."
) )
if not isinstance(mask_image, PIL.Image.Image): if not isinstance(mask_image, PIL.Image.Image):
raise ValueError( raise ValueError(
...@@ -515,7 +515,7 @@ class FluxControlNetInpaintPipeline(DiffusionPipeline, FluxLoraLoaderMixin, From ...@@ -515,7 +515,7 @@ class FluxControlNetInpaintPipeline(DiffusionPipeline, FluxLoraLoaderMixin, From
f" {type(mask_image)}." f" {type(mask_image)}."
) )
if output_type != "pil": if output_type != "pil":
raise ValueError(f"The output type should be PIL when inpainting mask crop, but is" f" {output_type}.") raise ValueError(f"The output type should be PIL when inpainting mask crop, but is {output_type}.")
if max_sequence_length is not None and max_sequence_length > 512: if max_sequence_length is not None and max_sequence_length > 512:
raise ValueError(f"`max_sequence_length` cannot be greater than 512 but is {max_sequence_length}") raise ValueError(f"`max_sequence_length` cannot be greater than 512 but is {max_sequence_length}")
......
...@@ -574,7 +574,7 @@ class FluxInpaintPipeline(DiffusionPipeline, FluxLoraLoaderMixin, FluxIPAdapterM ...@@ -574,7 +574,7 @@ class FluxInpaintPipeline(DiffusionPipeline, FluxLoraLoaderMixin, FluxIPAdapterM
if padding_mask_crop is not None: if padding_mask_crop is not None:
if not isinstance(image, PIL.Image.Image): if not isinstance(image, PIL.Image.Image):
raise ValueError( raise ValueError(
f"The image should be a PIL image when inpainting mask crop, but is of type" f" {type(image)}." f"The image should be a PIL image when inpainting mask crop, but is of type {type(image)}."
) )
if not isinstance(mask_image, PIL.Image.Image): if not isinstance(mask_image, PIL.Image.Image):
raise ValueError( raise ValueError(
...@@ -582,7 +582,7 @@ class FluxInpaintPipeline(DiffusionPipeline, FluxLoraLoaderMixin, FluxIPAdapterM ...@@ -582,7 +582,7 @@ class FluxInpaintPipeline(DiffusionPipeline, FluxLoraLoaderMixin, FluxIPAdapterM
f" {type(mask_image)}." f" {type(mask_image)}."
) )
if output_type != "pil": if output_type != "pil":
raise ValueError(f"The output type should be PIL when inpainting mask crop, but is" f" {output_type}.") raise ValueError(f"The output type should be PIL when inpainting mask crop, but is {output_type}.")
if max_sequence_length is not None and max_sequence_length > 512: if max_sequence_length is not None and max_sequence_length > 512:
raise ValueError(f"`max_sequence_length` cannot be greater than 512 but is {max_sequence_length}") raise ValueError(f"`max_sequence_length` cannot be greater than 512 but is {max_sequence_length}")
......
...@@ -341,9 +341,9 @@ class AnimateDiffFreeNoiseMixin: ...@@ -341,9 +341,9 @@ class AnimateDiffFreeNoiseMixin:
start_tensor = negative_prompt_embeds[i].unsqueeze(0) start_tensor = negative_prompt_embeds[i].unsqueeze(0)
end_tensor = negative_prompt_embeds[i + 1].unsqueeze(0) end_tensor = negative_prompt_embeds[i + 1].unsqueeze(0)
negative_prompt_interpolation_embeds[ negative_prompt_interpolation_embeds[start_frame : end_frame + 1] = (
start_frame : end_frame + 1 self._free_noise_prompt_interpolation_callback(start_frame, end_frame, start_tensor, end_tensor)
] = self._free_noise_prompt_interpolation_callback(start_frame, end_frame, start_tensor, end_tensor) )
prompt_embeds = prompt_interpolation_embeds prompt_embeds = prompt_interpolation_embeds
negative_prompt_embeds = negative_prompt_interpolation_embeds negative_prompt_embeds = negative_prompt_interpolation_embeds
......
...@@ -360,7 +360,7 @@ class KandinskyImg2ImgCombinedPipeline(DiffusionPipeline): ...@@ -360,7 +360,7 @@ class KandinskyImg2ImgCombinedPipeline(DiffusionPipeline):
""" """
_load_connected_pipes = True _load_connected_pipes = True
model_cpu_offload_seq = "prior_text_encoder->prior_image_encoder->prior_prior->" "text_encoder->unet->movq" model_cpu_offload_seq = "prior_text_encoder->prior_image_encoder->prior_prior->text_encoder->unet->movq"
_exclude_from_cpu_offload = ["prior_prior"] _exclude_from_cpu_offload = ["prior_prior"]
def __init__( def __init__(
......
...@@ -579,7 +579,7 @@ class KandinskyInpaintPipeline(DiffusionPipeline): ...@@ -579,7 +579,7 @@ class KandinskyInpaintPipeline(DiffusionPipeline):
f"Incorrect configuration settings! The config of `pipeline.unet`: {self.unet.config} expects" f"Incorrect configuration settings! The config of `pipeline.unet`: {self.unet.config} expects"
f" {self.unet.config.in_channels} but received `num_channels_latents`: {num_channels_latents} +" f" {self.unet.config.in_channels} but received `num_channels_latents`: {num_channels_latents} +"
f" `num_channels_mask`: {num_channels_mask} + `num_channels_masked_image`: {num_channels_masked_image}" f" `num_channels_mask`: {num_channels_mask} + `num_channels_masked_image`: {num_channels_masked_image}"
f" = {num_channels_latents+num_channels_masked_image+num_channels_mask}. Please verify the config of" f" = {num_channels_latents + num_channels_masked_image + num_channels_mask}. Please verify the config of"
" `pipeline.unet` or your `mask_image` or `image` input." " `pipeline.unet` or your `mask_image` or `image` input."
) )
......
...@@ -95,13 +95,13 @@ class OmniGenMultiModalProcessor: ...@@ -95,13 +95,13 @@ class OmniGenMultiModalProcessor:
image_ids = [int(s.split("|")[1].split("_")[-1]) for s in image_tags] image_ids = [int(s.split("|")[1].split("_")[-1]) for s in image_tags]
unique_image_ids = sorted(set(image_ids)) unique_image_ids = sorted(set(image_ids))
assert unique_image_ids == list( assert unique_image_ids == list(range(1, len(unique_image_ids) + 1)), (
range(1, len(unique_image_ids) + 1) f"image_ids must start from 1, and must be continuous int, e.g. [1, 2, 3], cannot be {unique_image_ids}"
), f"image_ids must start from 1, and must be continuous int, e.g. [1, 2, 3], cannot be {unique_image_ids}" )
# total images must be the same as the number of image tags # total images must be the same as the number of image tags
assert ( assert len(unique_image_ids) == len(input_images), (
len(unique_image_ids) == len(input_images) f"total images must be the same as the number of image tags, got {len(unique_image_ids)} image tags and {len(input_images)} images"
), f"total images must be the same as the number of image tags, got {len(unique_image_ids)} image tags and {len(input_images)} images" )
input_images = [input_images[x - 1] for x in image_ids] input_images = [input_images[x - 1] for x in image_ids]
......
...@@ -604,7 +604,7 @@ class StableDiffusionControlNetPAGInpaintPipeline( ...@@ -604,7 +604,7 @@ class StableDiffusionControlNetPAGInpaintPipeline(
if padding_mask_crop is not None: if padding_mask_crop is not None:
if not isinstance(image, PIL.Image.Image): if not isinstance(image, PIL.Image.Image):
raise ValueError( raise ValueError(
f"The image should be a PIL image when inpainting mask crop, but is of type" f" {type(image)}." f"The image should be a PIL image when inpainting mask crop, but is of type {type(image)}."
) )
if not isinstance(mask_image, PIL.Image.Image): if not isinstance(mask_image, PIL.Image.Image):
raise ValueError( raise ValueError(
...@@ -612,7 +612,7 @@ class StableDiffusionControlNetPAGInpaintPipeline( ...@@ -612,7 +612,7 @@ class StableDiffusionControlNetPAGInpaintPipeline(
f" {type(mask_image)}." f" {type(mask_image)}."
) )
if output_type != "pil": if output_type != "pil":
raise ValueError(f"The output type should be PIL when inpainting mask crop, but is" f" {output_type}.") raise ValueError(f"The output type should be PIL when inpainting mask crop, but is {output_type}.")
# `prompt` needs more sophisticated handling when there are multiple # `prompt` needs more sophisticated handling when there are multiple
# conditionings. # conditionings.
...@@ -1340,7 +1340,7 @@ class StableDiffusionControlNetPAGInpaintPipeline( ...@@ -1340,7 +1340,7 @@ class StableDiffusionControlNetPAGInpaintPipeline(
f"Incorrect configuration settings! The config of `pipeline.unet`: {self.unet.config} expects" f"Incorrect configuration settings! The config of `pipeline.unet`: {self.unet.config} expects"
f" {self.unet.config.in_channels} but received `num_channels_latents`: {num_channels_latents} +" f" {self.unet.config.in_channels} but received `num_channels_latents`: {num_channels_latents} +"
f" `num_channels_mask`: {num_channels_mask} + `num_channels_masked_image`: {num_channels_masked_image}" f" `num_channels_mask`: {num_channels_mask} + `num_channels_masked_image`: {num_channels_masked_image}"
f" = {num_channels_latents+num_channels_masked_image+num_channels_mask}. Please verify the config of" f" = {num_channels_latents + num_channels_masked_image + num_channels_mask}. Please verify the config of"
" `pipeline.unet` or your `mask_image` or `image` input." " `pipeline.unet` or your `mask_image` or `image` input."
) )
elif num_channels_unet != 4: elif num_channels_unet != 4:
......
...@@ -683,7 +683,7 @@ class StableDiffusionPAGInpaintPipeline( ...@@ -683,7 +683,7 @@ class StableDiffusionPAGInpaintPipeline(
if padding_mask_crop is not None: if padding_mask_crop is not None:
if not isinstance(image, PIL.Image.Image): if not isinstance(image, PIL.Image.Image):
raise ValueError( raise ValueError(
f"The image should be a PIL image when inpainting mask crop, but is of type" f" {type(image)}." f"The image should be a PIL image when inpainting mask crop, but is of type {type(image)}."
) )
if not isinstance(mask_image, PIL.Image.Image): if not isinstance(mask_image, PIL.Image.Image):
raise ValueError( raise ValueError(
...@@ -691,7 +691,7 @@ class StableDiffusionPAGInpaintPipeline( ...@@ -691,7 +691,7 @@ class StableDiffusionPAGInpaintPipeline(
f" {type(mask_image)}." f" {type(mask_image)}."
) )
if output_type != "pil": if output_type != "pil":
raise ValueError(f"The output type should be PIL when inpainting mask crop, but is" f" {output_type}.") raise ValueError(f"The output type should be PIL when inpainting mask crop, but is {output_type}.")
if ip_adapter_image is not None and ip_adapter_image_embeds is not None: if ip_adapter_image is not None and ip_adapter_image_embeds is not None:
raise ValueError( raise ValueError(
...@@ -1191,7 +1191,7 @@ class StableDiffusionPAGInpaintPipeline( ...@@ -1191,7 +1191,7 @@ class StableDiffusionPAGInpaintPipeline(
f"Incorrect configuration settings! The config of `pipeline.unet`: {self.unet.config} expects" f"Incorrect configuration settings! The config of `pipeline.unet`: {self.unet.config} expects"
f" {self.unet.config.in_channels} but received `num_channels_latents`: {num_channels_latents} +" f" {self.unet.config.in_channels} but received `num_channels_latents`: {num_channels_latents} +"
f" `num_channels_mask`: {num_channels_mask} + `num_channels_masked_image`: {num_channels_masked_image}" f" `num_channels_mask`: {num_channels_mask} + `num_channels_masked_image`: {num_channels_masked_image}"
f" = {num_channels_latents+num_channels_masked_image+num_channels_mask}. Please verify the config of" f" = {num_channels_latents + num_channels_masked_image + num_channels_mask}. Please verify the config of"
" `pipeline.unet` or your `mask_image` or `image` input." " `pipeline.unet` or your `mask_image` or `image` input."
) )
elif num_channels_unet != 4: elif num_channels_unet != 4:
......
...@@ -737,7 +737,7 @@ class StableDiffusionXLPAGInpaintPipeline( ...@@ -737,7 +737,7 @@ class StableDiffusionXLPAGInpaintPipeline(
if padding_mask_crop is not None: if padding_mask_crop is not None:
if not isinstance(image, PIL.Image.Image): if not isinstance(image, PIL.Image.Image):
raise ValueError( raise ValueError(
f"The image should be a PIL image when inpainting mask crop, but is of type" f" {type(image)}." f"The image should be a PIL image when inpainting mask crop, but is of type {type(image)}."
) )
if not isinstance(mask_image, PIL.Image.Image): if not isinstance(mask_image, PIL.Image.Image):
raise ValueError( raise ValueError(
...@@ -745,7 +745,7 @@ class StableDiffusionXLPAGInpaintPipeline( ...@@ -745,7 +745,7 @@ class StableDiffusionXLPAGInpaintPipeline(
f" {type(mask_image)}." f" {type(mask_image)}."
) )
if output_type != "pil": if output_type != "pil":
raise ValueError(f"The output type should be PIL when inpainting mask crop, but is" f" {output_type}.") raise ValueError(f"The output type should be PIL when inpainting mask crop, but is {output_type}.")
if ip_adapter_image is not None and ip_adapter_image_embeds is not None: if ip_adapter_image is not None and ip_adapter_image_embeds is not None:
raise ValueError( raise ValueError(
...@@ -1509,7 +1509,7 @@ class StableDiffusionXLPAGInpaintPipeline( ...@@ -1509,7 +1509,7 @@ class StableDiffusionXLPAGInpaintPipeline(
f"Incorrect configuration settings! The config of `pipeline.unet`: {self.unet.config} expects" f"Incorrect configuration settings! The config of `pipeline.unet`: {self.unet.config} expects"
f" {self.unet.config.in_channels} but received `num_channels_latents`: {num_channels_latents} +" f" {self.unet.config.in_channels} but received `num_channels_latents`: {num_channels_latents} +"
f" `num_channels_mask`: {num_channels_mask} + `num_channels_masked_image`: {num_channels_masked_image}" f" `num_channels_mask`: {num_channels_mask} + `num_channels_masked_image`: {num_channels_masked_image}"
f" = {num_channels_latents+num_channels_masked_image+num_channels_mask}. Please verify the config of" f" = {num_channels_latents + num_channels_masked_image + num_channels_mask}. Please verify the config of"
" `pipeline.unet` or your `mask_image` or `image` input." " `pipeline.unet` or your `mask_image` or `image` input."
) )
elif num_channels_unet != 4: elif num_channels_unet != 4:
......
...@@ -575,7 +575,7 @@ class PaintByExamplePipeline(DiffusionPipeline, StableDiffusionMixin): ...@@ -575,7 +575,7 @@ class PaintByExamplePipeline(DiffusionPipeline, StableDiffusionMixin):
f"Incorrect configuration settings! The config of `pipeline.unet`: {self.unet.config} expects" f"Incorrect configuration settings! The config of `pipeline.unet`: {self.unet.config} expects"
f" {self.unet.config.in_channels} but received `num_channels_latents`: {num_channels_latents} +" f" {self.unet.config.in_channels} but received `num_channels_latents`: {num_channels_latents} +"
f" `num_channels_mask`: {num_channels_mask} + `num_channels_masked_image`: {num_channels_masked_image}" f" `num_channels_mask`: {num_channels_mask} + `num_channels_masked_image`: {num_channels_masked_image}"
f" = {num_channels_latents+num_channels_masked_image+num_channels_mask}. Please verify the config of" f" = {num_channels_latents + num_channels_masked_image + num_channels_mask}. Please verify the config of"
" `pipeline.unet` or your `mask_image` or `image` input." " `pipeline.unet` or your `mask_image` or `image` input."
) )
......
...@@ -323,9 +323,7 @@ def maybe_raise_or_warn( ...@@ -323,9 +323,7 @@ def maybe_raise_or_warn(
model_cls = unwrapped_sub_model.__class__ model_cls = unwrapped_sub_model.__class__
if not issubclass(model_cls, expected_class_obj): if not issubclass(model_cls, expected_class_obj):
raise ValueError( raise ValueError(f"{passed_class_obj[name]} is of type: {model_cls}, but should be {expected_class_obj}")
f"{passed_class_obj[name]} is of type: {model_cls}, but should be" f" {expected_class_obj}"
)
else: else:
logger.warning( logger.warning(
f"You have passed a non-standard module {passed_class_obj[name]}. We cannot verify whether it" f"You have passed a non-standard module {passed_class_obj[name]}. We cannot verify whether it"
......
...@@ -983,9 +983,9 @@ class ShapERenderer(ModelMixin, ConfigMixin): ...@@ -983,9 +983,9 @@ class ShapERenderer(ModelMixin, ConfigMixin):
fields = torch.cat(fields, dim=1) fields = torch.cat(fields, dim=1)
fields = fields.float() fields = fields.float()
assert ( assert len(fields.shape) == 3 and fields.shape[-1] == 1, (
len(fields.shape) == 3 and fields.shape[-1] == 1 f"expected [meta_batch x inner_batch] SDF results, but got {fields.shape}"
), f"expected [meta_batch x inner_batch] SDF results, but got {fields.shape}" )
fields = fields.reshape(1, *([grid_size] * 3)) fields = fields.reshape(1, *([grid_size] * 3))
...@@ -1039,9 +1039,9 @@ class ShapERenderer(ModelMixin, ConfigMixin): ...@@ -1039,9 +1039,9 @@ class ShapERenderer(ModelMixin, ConfigMixin):
textures = textures.float() textures = textures.float()
# 3.3 augument the mesh with texture data # 3.3 augument the mesh with texture data
assert len(textures.shape) == 3 and textures.shape[-1] == len( assert len(textures.shape) == 3 and textures.shape[-1] == len(texture_channels), (
texture_channels f"expected [meta_batch x inner_batch x texture_channels] field results, but got {textures.shape}"
), f"expected [meta_batch x inner_batch x texture_channels] field results, but got {textures.shape}" )
for m, texture in zip(raw_meshes, textures): for m, texture in zip(raw_meshes, textures):
texture = texture[: len(m.verts)] texture = texture[: len(m.verts)]
......
...@@ -584,7 +584,7 @@ class StableAudioPipeline(DiffusionPipeline): ...@@ -584,7 +584,7 @@ class StableAudioPipeline(DiffusionPipeline):
if audio_end_in_s - audio_start_in_s > max_audio_length_in_s: if audio_end_in_s - audio_start_in_s > max_audio_length_in_s:
raise ValueError( raise ValueError(
f"The total audio length requested ({audio_end_in_s-audio_start_in_s}s) is longer than the model maximum possible length ({max_audio_length_in_s}). Make sure that 'audio_end_in_s-audio_start_in_s<={max_audio_length_in_s}'." f"The total audio length requested ({audio_end_in_s - audio_start_in_s}s) is longer than the model maximum possible length ({max_audio_length_in_s}). Make sure that 'audio_end_in_s-audio_start_in_s<={max_audio_length_in_s}'."
) )
waveform_start = int(audio_start_in_s * self.vae.config.sampling_rate) waveform_start = int(audio_start_in_s * self.vae.config.sampling_rate)
......
...@@ -335,7 +335,7 @@ class FlaxStableDiffusionInpaintPipeline(FlaxDiffusionPipeline): ...@@ -335,7 +335,7 @@ class FlaxStableDiffusionInpaintPipeline(FlaxDiffusionPipeline):
f"Incorrect configuration settings! The config of `pipeline.unet`: {self.unet.config} expects" f"Incorrect configuration settings! The config of `pipeline.unet`: {self.unet.config} expects"
f" {self.unet.config.in_channels} but received `num_channels_latents`: {num_channels_latents} +" f" {self.unet.config.in_channels} but received `num_channels_latents`: {num_channels_latents} +"
f" `num_channels_mask`: {num_channels_mask} + `num_channels_masked_image`: {num_channels_masked_image}" f" `num_channels_mask`: {num_channels_mask} + `num_channels_masked_image`: {num_channels_masked_image}"
f" = {num_channels_latents+num_channels_masked_image+num_channels_mask}. Please verify the config of" f" = {num_channels_latents + num_channels_masked_image + num_channels_mask}. Please verify the config of"
" `pipeline.unet` or your `mask_image` or `image` input." " `pipeline.unet` or your `mask_image` or `image` input."
) )
......
...@@ -475,7 +475,7 @@ class OnnxStableDiffusionInpaintPipeline(DiffusionPipeline): ...@@ -475,7 +475,7 @@ class OnnxStableDiffusionInpaintPipeline(DiffusionPipeline):
"Incorrect configuration settings! The config of `pipeline.unet` expects" "Incorrect configuration settings! The config of `pipeline.unet` expects"
f" {unet_input_channels} but received `num_channels_latents`: {num_channels_latents} +" f" {unet_input_channels} but received `num_channels_latents`: {num_channels_latents} +"
f" `num_channels_mask`: {num_channels_mask} + `num_channels_masked_image`: {num_channels_masked_image}" f" `num_channels_mask`: {num_channels_mask} + `num_channels_masked_image`: {num_channels_masked_image}"
f" = {num_channels_latents+num_channels_masked_image+num_channels_mask}. Please verify the config of" f" = {num_channels_latents + num_channels_masked_image + num_channels_mask}. Please verify the config of"
" `pipeline.unet` or your `mask_image` or `image` input." " `pipeline.unet` or your `mask_image` or `image` input."
) )
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment