This commit is contained in:
w-e-w 2025-12-21 23:59:31 -05:00 committed by GitHub
commit 3ac6b32aa4
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 30 additions and 0 deletions

View file

@ -1642,6 +1642,8 @@ class StableDiffusionProcessingImg2Img(StableDiffusionProcessing):
crop_region = masking.get_crop_region_v2(mask, self.inpaint_full_res_padding)
if crop_region:
crop_region = masking.expand_crop_region(crop_region, self.width, self.height, mask.width, mask.height)
if shared.opts.forbid_too_small_crop_region:
crop_region = masking.expand_too_small_crop_region(crop_region, self.width, self.height, mask.width, mask.height)
x1, y1, x2, y2 = crop_region
mask = mask.crop(crop_region)
image_mask = images.resize_image(2, mask, self.width, self.height)