Skip to content

Commit 79c380b

Browse files
authored
Correct how apply_overlay read crop_coords (huggingface#6417)
correct reading variables
1 parent e30b661 commit 79c380b

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/diffusers/image_processor.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -634,7 +634,9 @@ def apply_overlay(
634634
init_image_masked = init_image_masked.convert("RGBA")
635635

636636
if crop_coords is not None:
637-
x, y, w, h = crop_coords
637+
x, y, x2, y2 = crop_coords
638+
w = x2 - x
639+
h = y2 - y
638640
base_image = PIL.Image.new("RGBA", (width, height))
639641
image = self.resize(image, height=h, width=w, resize_mode="crop")
640642
base_image.paste(image, (x, y))

0 commit comments

Comments
 (0)