Skip to content

Commit 0ec2173

Browse files
committed
Fix #47
1 parent 24bdb8a commit 0ec2173

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

backend/app.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@
5151
# scripts, which each script taking up "slots" in the input args array.
5252
# So the more scripts, the longer array args would be for the last script.
5353

54+
# TODO: Consider using pipeline directly instead of Gradio API for less surprises & better control
5455

5556
@router.get("/config", response_model=ConfigResponse)
5657
async def get_state():
@@ -199,6 +200,7 @@ async def f_img2img(req: Img2ImgRequest):
199200
# - mask is used only in inpaint mode
200201
# - mask_mode determines whethere init_img_with_mask or init_img_inpaint is used,
201202
# I dont know why
203+
# - new color sketch functionality in webUI is irrelevant so None is used for their options.
202204
# - the internal code for img2img is confusing and duplicative...
203205

204206
images, info, html = modules.img2img.img2img(
@@ -209,13 +211,15 @@ async def f_img2img(req: Img2ImgRequest):
209211
"None", # prompt_style2: saved prompt styles (unsupported)
210212
image, # init_img
211213
{"image": image, "mask": mask}, # init_img_with_mask
214+
None, # init_img_with_mask_orig # only used by webUI color sketch if init_img_with_mask isn't dict
212215
image, # init_img_inpaint
213216
mask, # init_mask_inpaint
214217
# using 1 for uploaded mask mode; processing done by prepare_mask to ensure its correct
215218
1, # mask_mode: internally checks if equal 0. 1 enables alpha mask (remove erased parts)
216219
req.steps, # steps
217220
get_sampler_index(req.sampler_name), # sampler_index
218221
0, # req.mask_blur, # mask_blur
222+
None, # mask_alpha # only used by webUI color sketch if init_img_with_mask isn't dict
219223
req.inpainting_fill, # inpainting_fill
220224
req.restore_faces, # restore_faces
221225
req.tiling, # tiling

0 commit comments

Comments
 (0)