diff options
author | AUTOMATIC1111 <16777216c@gmail.com> | 2023-04-29 10:21:32 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-04-29 10:21:32 +0000 |
commit | 32c3b97669b873baaccf2070a7a478b9b9a27cef (patch) | |
tree | 150c2aaccfe4ee8d47a8c897eff7c29b614ad7a5 /modules/processing.py | |
parent | 43925add0afbe5b8e717ce62d8d69154e97efc04 (diff) | |
parent | fbab3fc6d122fb4e6648dd82291a70fc348c0b4a (diff) | |
download | stable-diffusion-webui-gfx803-32c3b97669b873baaccf2070a7a478b9b9a27cef.tar.gz stable-diffusion-webui-gfx803-32c3b97669b873baaccf2070a7a478b9b9a27cef.tar.bz2 stable-diffusion-webui-gfx803-32c3b97669b873baaccf2070a7a478b9b9a27cef.zip |
Merge pull request #9628 from catboxanon/patch/9092
Fix image mask/composite for weird resolutions
Diffstat (limited to 'modules/processing.py')
-rw-r--r-- | modules/processing.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/modules/processing.py b/modules/processing.py index 98557fb1..462660ce 100644 --- a/modules/processing.py +++ b/modules/processing.py @@ -715,9 +715,9 @@ def process_images_inner(p: StableDiffusionProcessing) -> Processed: image.info["parameters"] = text
output_images.append(image)
- if hasattr(p, 'mask_for_overlay') and p.mask_for_overlay:
+ if hasattr(p, 'mask_for_overlay') and p.mask_for_overlay and any([opts.save_mask, opts.save_mask_composite, opts.return_mask, opts.return_mask_composite]):
image_mask = p.mask_for_overlay.convert('RGB')
- image_mask_composite = Image.composite(image.convert('RGBA').convert('RGBa'), Image.new('RGBa', image.size), p.mask_for_overlay.convert('L')).convert('RGBA')
+ image_mask_composite = Image.composite(image.convert('RGBA').convert('RGBa'), Image.new('RGBa', image.size), images.resize_image(2, p.mask_for_overlay, image.width, image.height).convert('L')).convert('RGBA')
if opts.save_mask:
images.save_image(image_mask, p.outpath_samples, "", seeds[i], prompts[i], opts.samples_format, info=infotext(n, i), p=p, suffix="-mask")
|