diff options
author | catboxanon <122327233+catboxanon@users.noreply.github.com> | 2023-08-15 18:24:55 +0000 |
---|---|---|
committer | catboxanon <122327233+catboxanon@users.noreply.github.com> | 2023-08-15 18:24:55 +0000 |
commit | 0f77139253f5481d62f7c1eddc220355440b2d1f (patch) | |
tree | 143a66dac45d6ce61679511b7d9b2725070f1332 /modules/img2img.py | |
parent | 85fcb7b8dfe7b3dd06931943f095c77f1043dc25 (diff) | |
download | stable-diffusion-webui-gfx803-0f77139253f5481d62f7c1eddc220355440b2d1f.tar.gz stable-diffusion-webui-gfx803-0f77139253f5481d62f7c1eddc220355440b2d1f.tar.bz2 stable-diffusion-webui-gfx803-0f77139253f5481d62f7c1eddc220355440b2d1f.zip |
Fix inpaint upload for alpha masks, create reusable function
Diffstat (limited to 'modules/img2img.py')
-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 ac9fd3f8..328cb0e9 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.split()[-1].convert("L").point(lambda x: 255 if x > 128 else 0)
+ mask = processing.create_binary_mask(mask)
image = image.convert("RGB")
elif mode == 3: # inpaint sketch
image = inpaint_color_sketch
|