mirror of
https://github.com/AUTOMATIC1111/stable-diffusion-webui.git
synced 2024-06-07 21:20:49 +00:00
fix: Coordinate 'right' is less than 'left'
Signed-off-by: storyicon <storyicon@foxmail.com>
This commit is contained in:
parent
e73a7e4006
commit
4068429ac7
@ -9,8 +9,8 @@ def get_crop_region(mask, pad=0):
|
|||||||
if box:
|
if box:
|
||||||
x1, y1, x2, y2 = box
|
x1, y1, x2, y2 = box
|
||||||
else: # when no box is found
|
else: # when no box is found
|
||||||
x1, y1 = mask_img.size
|
x1 = y1 = 0
|
||||||
x2 = y2 = 0
|
x2, y2 = mask_img.size
|
||||||
return max(x1 - pad, 0), max(y1 - pad, 0), min(x2 + pad, mask_img.size[0]), min(y2 + pad, mask_img.size[1])
|
return max(x1 - pad, 0), max(y1 - pad, 0), min(x2 + pad, mask_img.size[0]), min(y2 + pad, mask_img.size[1])
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user