From a3476d5bd65fd9ba8ba5e28053b8f2cf325d50ec Mon Sep 17 00:00:00 2001 From: YiYi Xu Date: Fri, 10 Nov 2023 06:53:20 -1000 Subject: [PATCH] Controlnet Img2img: pass `height` and `width` to `image_processor.preprocess` (#5665) pass height and width to image_processor.preprocess Co-authored-by: yiyixuxu --- .../pipelines/controlnet/pipeline_controlnet_img2img.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/diffusers/pipelines/controlnet/pipeline_controlnet_img2img.py b/src/diffusers/pipelines/controlnet/pipeline_controlnet_img2img.py index 8683d09e11..8249c44b4d 100644 --- a/src/diffusers/pipelines/controlnet/pipeline_controlnet_img2img.py +++ b/src/diffusers/pipelines/controlnet/pipeline_controlnet_img2img.py @@ -996,7 +996,7 @@ class StableDiffusionControlNetImg2ImgPipeline( prompt_embeds = torch.cat([negative_prompt_embeds, prompt_embeds]) # 4. Prepare image - image = self.image_processor.preprocess(image).to(dtype=torch.float32) + image = self.image_processor.preprocess(image, height=height, width=width).to(dtype=torch.float32) # 5. Prepare controlnet_conditioning_image if isinstance(controlnet, ControlNetModel):