diff --git a/src/diffusers/pipelines/qwenimage/pipeline_qwenimage_edit_inpaint.py b/src/diffusers/pipelines/qwenimage/pipeline_qwenimage_edit_inpaint.py index d54d1881fa4e..3f434a217beb 100644 --- a/src/diffusers/pipelines/qwenimage/pipeline_qwenimage_edit_inpaint.py +++ b/src/diffusers/pipelines/qwenimage/pipeline_qwenimage_edit_inpaint.py @@ -870,6 +870,8 @@ def __call__( crops_coords = None resize_mode = "default" + original_image = None + prompt_image = None if image is not None and not (isinstance(image, torch.Tensor) and image.size(1) == self.latent_channels): image = self.image_processor.resize(image, calculated_height, calculated_width) original_image = image diff --git a/src/diffusers/pipelines/qwenimage/pipeline_qwenimage_edit_plus.py b/src/diffusers/pipelines/qwenimage/pipeline_qwenimage_edit_plus.py index ec203edf166c..a19e367b80ad 100644 --- a/src/diffusers/pipelines/qwenimage/pipeline_qwenimage_edit_plus.py +++ b/src/diffusers/pipelines/qwenimage/pipeline_qwenimage_edit_plus.py @@ -665,6 +665,10 @@ def __call__( device = self._execution_device # 3. Preprocess image + condition_image_sizes = None + condition_images = None + vae_image_sizes = None + vae_images = None if image is not None and not (isinstance(image, torch.Tensor) and image.size(1) == self.latent_channels): if not isinstance(image, list): image = [image] diff --git a/src/diffusers/pipelines/qwenimage/pipeline_qwenimage_img2img.py b/src/diffusers/pipelines/qwenimage/pipeline_qwenimage_img2img.py index cb4c5d8016bb..e9d5eb6cbd07 100644 --- a/src/diffusers/pipelines/qwenimage/pipeline_qwenimage_img2img.py +++ b/src/diffusers/pipelines/qwenimage/pipeline_qwenimage_img2img.py @@ -310,6 +310,7 @@ def encode_prompt( def check_inputs( self, prompt, + image, strength, height, width, @@ -321,6 +322,9 @@ def check_inputs( callback_on_step_end_tensor_inputs=None, max_sequence_length=None, ): + if image is None: + raise ValueError("`image` input cannot be undefined for img2img generation.") + if strength < 0 or strength > 1: raise ValueError(f"The value of strength should in [0.0, 1.0] but is {strength}") @@ -651,6 +655,7 @@ def __call__( # 1. Check inputs. Raise error if not correct self.check_inputs( prompt, + image, strength, height, width,