Fix inpaint upload for alpha masks, create reusable function

This commit is contained in:
catboxanon
2023-08-15 14:24:55 -04:00
parent 85fcb7b8df
commit 0f77139253
3 changed files with 11 additions and 3 deletions

View File

@@ -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