aboutsummaryrefslogtreecommitdiff
path: root/modules/img2img.py
diff options
context:
space:
mode:
authorAUTOMATIC <16777216c@gmail.com>2023-06-01 08:42:50 +0300
committerAUTOMATIC <16777216c@gmail.com>2023-06-01 08:42:50 +0300
commitb3390a984081950c626070889580e01727689921 (patch)
treef1fb3352f91d70034d54a99c220f1ca594d8b3dc /modules/img2img.py
parent0cc05fc492a9360d3b2f1b3f64c7d74f9041f74e (diff)
parent36888092afa82ee248bc947229f813b453629317 (diff)
Merge branch 'dev' into startup-profile
Diffstat (limited to 'modules/img2img.py')
-rw-r--r--modules/img2img.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/modules/img2img.py b/modules/img2img.py
index d704bf90..4c12c2c5 100644
--- a/modules/img2img.py
+++ b/modules/img2img.py
@@ -92,7 +92,8 @@ def img2img(id_task: str, mode: int, prompt: str, negative_prompt: str, prompt_s
elif mode == 2: # inpaint
image, mask = init_img_with_mask["image"], init_img_with_mask["mask"]
alpha_mask = ImageOps.invert(image.split()[-1]).convert('L').point(lambda x: 255 if x > 0 else 0, mode='1')
- mask = ImageChops.lighter(alpha_mask, mask.convert('L')).convert('L')
+ mask = mask.convert('L').point(lambda x: 255 if x > 128 else 0, mode='1')
+ mask = ImageChops.lighter(alpha_mask, mask).convert('L')
image = image.convert("RGB")
elif mode == 3: # inpaint sketch
image = inpaint_color_sketch