diff --git a/src/diffusers/image_processor.py b/src/diffusers/image_processor.py index 447440f07c58..9893f7163853 100644 --- a/src/diffusers/image_processor.py +++ b/src/diffusers/image_processor.py @@ -634,7 +634,9 @@ def apply_overlay( init_image_masked = init_image_masked.convert("RGBA") if crop_coords is not None: - x, y, w, h = crop_coords + x, y, x2, y2 = crop_coords + w = x2 - x + h = y2 - y base_image = PIL.Image.new("RGBA", (width, height)) image = self.resize(image, height=h, width=w, resize_mode="crop") base_image.paste(image, (x, y))