feat: extract attribute skipping_cn_preprocessor
This commit is contained in:
parent
0bf41591a6
commit
9f194a91fa
|
|
@ -1,18 +1,18 @@
|
|||
skipping_cn_preprocessor, controlnet_softness, canny_low_threshold, canny_high_threshold, \
|
||||
controlnet_softness, canny_low_threshold, canny_high_threshold, \
|
||||
refiner_swap_method, \
|
||||
freeu_enabled, freeu_b1, freeu_b2, freeu_s1, freeu_s2, \
|
||||
debugging_inpaint_preprocessor, inpaint_disable_initial_latent, inpaint_engine, inpaint_strength, inpaint_respective_field, \
|
||||
inpaint_mask_upload_checkbox, invert_mask_checkbox, inpaint_erode_or_dilate = [None] * 18
|
||||
inpaint_mask_upload_checkbox, invert_mask_checkbox, inpaint_erode_or_dilate = [None] * 17
|
||||
|
||||
|
||||
def set_all_advanced_parameters(*args):
|
||||
global skipping_cn_preprocessor, controlnet_softness, canny_low_threshold, canny_high_threshold, \
|
||||
global controlnet_softness, canny_low_threshold, canny_high_threshold, \
|
||||
refiner_swap_method, \
|
||||
freeu_enabled, freeu_b1, freeu_b2, freeu_s1, freeu_s2, \
|
||||
debugging_inpaint_preprocessor, inpaint_disable_initial_latent, inpaint_engine, inpaint_strength, inpaint_respective_field, \
|
||||
inpaint_mask_upload_checkbox, invert_mask_checkbox, inpaint_erode_or_dilate
|
||||
|
||||
skipping_cn_preprocessor, controlnet_softness, canny_low_threshold, canny_high_threshold, \
|
||||
controlnet_softness, canny_low_threshold, canny_high_threshold, \
|
||||
refiner_swap_method, \
|
||||
freeu_enabled, freeu_b1, freeu_b2, freeu_s1, freeu_s2, \
|
||||
debugging_inpaint_preprocessor, inpaint_disable_initial_latent, inpaint_engine, inpaint_strength, inpaint_respective_field, \
|
||||
|
|
|
|||
|
|
@ -153,6 +153,7 @@ def worker():
|
|||
mixing_image_prompt_and_vary_upscale = args.pop()
|
||||
mixing_image_prompt_and_inpaint = args.pop()
|
||||
debugging_cn_preprocessor = args.pop()
|
||||
skipping_cn_preprocessor = args.pop()
|
||||
|
||||
cn_tasks = {x: [] for x in flags.ip_list}
|
||||
for _ in range(4):
|
||||
|
|
@ -644,7 +645,7 @@ def worker():
|
|||
cn_img, cn_stop, cn_weight = task
|
||||
cn_img = resize_image(HWC3(cn_img), width=width, height=height)
|
||||
|
||||
if not advanced_parameters.skipping_cn_preprocessor:
|
||||
if not skipping_cn_preprocessor:
|
||||
cn_img = preprocessors.canny_pyramid(cn_img)
|
||||
|
||||
cn_img = HWC3(cn_img)
|
||||
|
|
@ -656,7 +657,7 @@ def worker():
|
|||
cn_img, cn_stop, cn_weight = task
|
||||
cn_img = resize_image(HWC3(cn_img), width=width, height=height)
|
||||
|
||||
if not advanced_parameters.skipping_cn_preprocessor:
|
||||
if not skipping_cn_preprocessor:
|
||||
cn_img = preprocessors.cpds(cn_img)
|
||||
|
||||
cn_img = HWC3(cn_img)
|
||||
|
|
@ -679,7 +680,7 @@ def worker():
|
|||
cn_img, cn_stop, cn_weight = task
|
||||
cn_img = HWC3(cn_img)
|
||||
|
||||
if not advanced_parameters.skipping_cn_preprocessor:
|
||||
if not skipping_cn_preprocessor:
|
||||
cn_img = extras.face_crop.crop_image(cn_img)
|
||||
|
||||
# https://github.com/tencent-ailab/IP-Adapter/blob/d580c50a291566bbf9fc7ac0f760506607297e6d/README.md?plain=1#L75
|
||||
|
|
|
|||
4
webui.py
4
webui.py
|
|
@ -446,7 +446,7 @@ with shared.gradio_root:
|
|||
freeu_s2 = gr.Slider(label='S2', minimum=0, maximum=4, step=0.01, value=0.95)
|
||||
freeu_ctrls = [freeu_enabled, freeu_b1, freeu_b2, freeu_s1, freeu_s2]
|
||||
|
||||
adps = [skipping_cn_preprocessor, controlnet_softness,
|
||||
adps = [controlnet_softness,
|
||||
canny_low_threshold, canny_high_threshold, refiner_swap_method]
|
||||
adps += freeu_ctrls
|
||||
adps += inpaint_ctrls
|
||||
|
|
@ -529,7 +529,7 @@ with shared.gradio_root:
|
|||
ctrls += [sampler_name, scheduler_name]
|
||||
ctrls += [overwrite_step, overwrite_switch, overwrite_width, overwrite_height, overwrite_vary_strength]
|
||||
ctrls += [overwrite_upscale_strength, mixing_image_prompt_and_vary_upscale, mixing_image_prompt_and_inpaint]
|
||||
ctrls += [debugging_cn_preprocessor]
|
||||
ctrls += [debugging_cn_preprocessor, skipping_cn_preprocessor]
|
||||
ctrls += ip_ctrls
|
||||
|
||||
state_is_generating = gr.State(False)
|
||||
|
|
|
|||
Loading…
Reference in New Issue