mirror of
https://github.com/AUTOMATIC1111/stable-diffusion-webui.git
synced 2024-12-29 19:05:05 +08:00
fix x2 >= image_width and y2 >= image_height
This commit is contained in:
parent
11971e81c8
commit
2cb3c2da3f
@ -89,6 +89,10 @@ def expand_too_small_crop_region(crop_region, processing_width, processing_heigh
|
||||
diff_w_r = diff_w - diff_w_l
|
||||
x1 -= diff_w_l
|
||||
x2 += diff_w_r
|
||||
if x2 >= image_width:
|
||||
diff = x2 - image_width
|
||||
x2 -= diff
|
||||
x1 -= diff
|
||||
if x1 < 0:
|
||||
x2 -= x1
|
||||
x1 -= x1
|
||||
@ -102,6 +106,10 @@ def expand_too_small_crop_region(crop_region, processing_width, processing_heigh
|
||||
diff_h_d = diff_h - diff_h_u
|
||||
y1 -= diff_h_u
|
||||
y2 += diff_h_d
|
||||
if y2 >= image_height:
|
||||
diff = y2 - image_height
|
||||
y2 -= diff
|
||||
y1 -= diff
|
||||
if y1 < 0:
|
||||
y2 -= y1
|
||||
y1 -= y1
|
||||
|
Loading…
Reference in New Issue
Block a user