51
51
# scripts, which each script taking up "slots" in the input args array.
52
52
# So the more scripts, the longer array args would be for the last script.
53
53
54
+ # TODO: Consider using pipeline directly instead of Gradio API for less surprises & better control
54
55
55
56
@router .get ("/config" , response_model = ConfigResponse )
56
57
async def get_state ():
@@ -199,6 +200,7 @@ async def f_img2img(req: Img2ImgRequest):
199
200
# - mask is used only in inpaint mode
200
201
# - mask_mode determines whethere init_img_with_mask or init_img_inpaint is used,
201
202
# I dont know why
203
+ # - new color sketch functionality in webUI is irrelevant so None is used for their options.
202
204
# - the internal code for img2img is confusing and duplicative...
203
205
204
206
images , info , html = modules .img2img .img2img (
@@ -209,13 +211,15 @@ async def f_img2img(req: Img2ImgRequest):
209
211
"None" , # prompt_style2: saved prompt styles (unsupported)
210
212
image , # init_img
211
213
{"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
212
215
image , # init_img_inpaint
213
216
mask , # init_mask_inpaint
214
217
# using 1 for uploaded mask mode; processing done by prepare_mask to ensure its correct
215
218
1 , # mask_mode: internally checks if equal 0. 1 enables alpha mask (remove erased parts)
216
219
req .steps , # steps
217
220
get_sampler_index (req .sampler_name ), # sampler_index
218
221
0 , # req.mask_blur, # mask_blur
222
+ None , # mask_alpha # only used by webUI color sketch if init_img_with_mask isn't dict
219
223
req .inpainting_fill , # inpainting_fill
220
224
req .restore_faces , # restore_faces
221
225
req .tiling , # tiling
0 commit comments