Skip to content

Commit eb0524d

Browse files
committed
prepare_control_image
1 parent 4b9c991 commit eb0524d

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

src/diffusers/pipelines/controlnet/pipeline_controlnet_union_inpaint_sd_xl.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -827,7 +827,7 @@ def check_inputs(
827827
f"`ip_adapter_image_embeds` has to be a list of 3D or 4D tensors but is {ip_adapter_image_embeds[0].ndim}D"
828828
)
829829

830-
# Copied from diffusers.pipelines.controlnet.pipeline_controlnet.StableDiffusionControlNetPipeline.prepare_image
830+
# Copied from diffusers.pipelines.controlnet.pipeline_controlnet_inpaint_sd_xl.StableDiffusionXLControlNetInpaintPipeline.prepare_control_image
831831
def prepare_control_image(
832832
self,
833833
image,
@@ -837,10 +837,14 @@ def prepare_control_image(
837837
num_images_per_prompt,
838838
device,
839839
dtype,
840+
crops_coords,
841+
resize_mode,
840842
do_classifier_free_guidance=False,
841843
guess_mode=False,
842844
):
843-
image = self.control_image_processor.preprocess(image, height=height, width=width).to(dtype=torch.float32)
845+
image = self.control_image_processor.preprocess(
846+
image, height=height, width=width, crops_coords=crops_coords, resize_mode=resize_mode
847+
).to(dtype=torch.float32)
844848
image_batch_size = image.shape[0]
845849

846850
if image_batch_size == 1:

0 commit comments

Comments
 (0)