aboutsummaryrefslogtreecommitdiff
path: root/modules
diff options
context:
space:
mode:
authorcatboxanon <122327233+catboxanon@users.noreply.github.com>2023-04-14 17:24:55 -0400
committerGitHub <noreply@github.com>2023-04-14 17:24:55 -0400
commitfbab3fc6d122fb4e6648dd82291a70fc348c0b4a (patch)
tree824fc17c69dee84c307f49fefc1d7f1ae1461eb5 /modules
parent3af152d488db0c521f6058676e1a65c7157ccc14 (diff)
Only handle image mask if any option enabled
Diffstat (limited to 'modules')
-rw-r--r--modules/processing.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/modules/processing.py b/modules/processing.py
index f49992d9..5c6edc60 100644
--- a/modules/processing.py
+++ b/modules/processing.py
@@ -706,7 +706,7 @@ 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), images.resize_image(2, p.mask_for_overlay, image.width, image.height).convert('L')).convert('RGBA')