mirror of
https://github.com/AUTOMATIC1111/stable-diffusion-webui.git
synced 2026-02-18 05:42:48 -08:00
add "Forbid too small crop region" option
This commit is contained in:
parent
9f5a98d576
commit
11971e81c8
3 changed files with 41 additions and 0 deletions
|
|
@ -1639,6 +1639,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)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue