Skip to content

Commit

Permalink
Merge branch 'dev'
Browse files Browse the repository at this point in the history
  • Loading branch information
AUTOMATIC1111 committed Apr 22, 2024
2 parents e2b177c + 7dfe959 commit 1c0a0c4
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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:
Expand Down
2 changes: 1 addition & 1 deletion modules/masking.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down

0 comments on commit 1c0a0c4

Please sign in to comment.