From 821adc3041b504b47b6e55bb8e8b451a90ee1833 Mon Sep 17 00:00:00 2001 From: w-e-w <40751091+w-e-w@users.noreply.github.com> Date: Mon, 22 Apr 2024 23:03:27 +0900 Subject: [PATCH 1/2] fix get_crop_region_v2 Co-Authored-By: Dowon --- modules/masking.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/masking.py b/modules/masking.py index 8e869d1b1e0..2fc83031953 100644 --- a/modules/masking.py +++ b/modules/masking.py @@ -16,7 +16,7 @@ def get_crop_region_v2(mask, pad=0): mask = mask if isinstance(mask, Image.Image) else Image.fromarray(mask) if box := mask.getbbox(): x1, y1, x2, y2 = box - return max(x1 - pad, 0), max(y1 - pad, 0), min(x2 + pad, mask.size[0]), min(y2 + pad, mask.size[1]) if pad else box + return (max(x1 - pad, 0), max(y1 - pad, 0), min(x2 + pad, mask.size[0]), min(y2 + pad, mask.size[1])) if pad else box def get_crop_region(mask, pad=0): From 7dfe959f4b9fbc1662def8a086e48932dff6c1b1 Mon Sep 17 00:00:00 2001 From: AUTOMATIC1111 <16777216c@gmail.com> Date: Mon, 22 Apr 2024 18:00:23 +0300 Subject: [PATCH 2/2] update changelog --- CHANGELOG.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index d7bcef0bd23..295d26c8c7c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,8 @@ +## 1.9.3 + +### Bug Fixes: +* fix get_crop_region_v2 ([#15594](https://github.com/AUTOMATIC1111/stable-diffusion-webui/pull/15594)) + ## 1.9.2 ### Extensions and API: