mirror of
https://github.com/AUTOMATIC1111/stable-diffusion-webui.git
synced 2026-01-20 11:30:56 -08:00
fix get_crop_region_v2
Co-Authored-By: Dowon <ks2515@naver.com>
This commit is contained in:
parent
e2b177c508
commit
821adc3041
1 changed files with 1 additions and 1 deletions
|
|
@ -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):
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue