feat(scripts): enable each tap

This commit is contained in:
Dowon
2024-05-19 16:25:06 +09:00
parent af3418728d
commit 2ace2759b8
5 changed files with 59 additions and 20 deletions

View File

@@ -162,7 +162,7 @@ def adui(
states.append(state)
infotext_fields.extend(infofields)
# components: [bool, dict, dict, ...]
# components: [bool, bool, dict, dict, ...]
components = [ad_enable, ad_skip_img2img, *states]
return components, infotext_fields
@@ -171,14 +171,22 @@ def one_ui_group(n: int, is_img2img: bool, webui_info: WebuiInfo):
w = Widgets()
eid = partial(elem_id, n=n, is_img2img=is_img2img)
model_choices = (
[*webui_info.ad_model_list, "None"]
if n == 0
else ["None", *webui_info.ad_model_list]
)
with gr.Group():
with gr.Row():
model_choices = (
[*webui_info.ad_model_list, "None"]
if n == 0
else ["None", *webui_info.ad_model_list]
with gr.Row(variant="compact"):
w.ad_tap_enable = gr.Checkbox(
label=f"Enable this tap ({ordinal(n + 1)})",
value=True,
visible=True,
elem_id=eid("ad_tap_enable"),
)
with gr.Row():
w.ad_model = gr.Dropdown(
label="ADetailer detector" + suffix(n),
choices=model_choices,