From 301b25d293ed56369d2040751aad72b63c0a3433 Mon Sep 17 00:00:00 2001 From: Vincent Date: Mon, 1 Jan 2024 17:45:42 +0700 Subject: [PATCH] correct reading variables --- src/diffusers/image_processor.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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))