diff options
author | catboxanon <122327233+catboxanon@users.noreply.github.com> | 2023-08-04 09:43:53 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-08-04 09:43:53 +0000 |
commit | cd4e053e5e73b90a129d5ebe5a0334a07765598f (patch) | |
tree | 959e5acfa1e36e07deed320c2a4b804fe5e78568 | |
parent | 2dc2bc4ab53837e326a9c70ae250031ff6e8c929 (diff) | |
download | stable-diffusion-webui-gfx803-cd4e053e5e73b90a129d5ebe5a0334a07765598f.tar.gz stable-diffusion-webui-gfx803-cd4e053e5e73b90a129d5ebe5a0334a07765598f.tar.bz2 stable-diffusion-webui-gfx803-cd4e053e5e73b90a129d5ebe5a0334a07765598f.zip |
Simply img2img mask conversion, fix threshold
-rw-r--r-- | modules/img2img.py | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/modules/img2img.py b/modules/img2img.py index b50678a6..85d92064 100644 --- a/modules/img2img.py +++ b/modules/img2img.py @@ -129,7 +129,7 @@ def img2img(id_task: str, mode: int, prompt: str, negative_prompt: str, prompt_s mask = None
elif mode == 2: # inpaint
image, mask = init_img_with_mask["image"], init_img_with_mask["mask"]
- mask = mask.convert("RGBA").split()[3].convert("L").point(lambda x: 255 if x > 0 else 0)
+ mask = mask.split()[-1].convert('L').point(lambda x: 255 if x > 128 else 0)
image = image.convert("RGB")
elif mode == 3: # inpaint sketch
image = inpaint_color_sketch
|