Skip to content

Commit ec5d85c

Browse files
authored
Don't change accordion visibility (#97)
1 parent 701a208 commit ec5d85c

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

scripts/dynamic_thresholding.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ def vis_change(is_vis):
4949
with gr.Accordion("Dynamic Thresholding (CFG Scale Fix)", open=False, elem_id="dynthres_" + ("img2img" if is_img2img else "txt2img")):
5050
with gr.Row():
5151
enabled = gr.Checkbox(value=False, label="Enable Dynamic Thresholding (CFG Scale Fix)", elem_classes=["dynthres-enabled"], elem_id='dynthres_enabled')
52-
with gr.Group(visible=False) as accordion:
52+
with gr.Group():
5353
gr.HTML(value=f"View <a style=\"border-bottom: 1px #00ffff dotted;\" href=\"https://github.com/mcmonkeyprojects/sd-dynamic-thresholding/wiki/Usage-Tips\">the wiki for usage tips.</a><br><br>", elem_id='dynthres_wiki_link')
5454
mimic_scale = gr.Slider(minimum=1.0, maximum=30.0, step=0.5, label='Mimic CFG Scale', value=7.0, elem_id='dynthres_mimic_scale')
5555
with gr.Accordion("Advanced Options", open=False, elem_id='dynthres_advanced_opts'):
@@ -73,13 +73,11 @@ def should_show_scheduler_value(cfg_mode, mimic_mode):
7373
mimic_mode.change(should_show_scheduler_value, inputs=[cfg_mode, mimic_mode], outputs=[sched_val, mimic_scale_min, cfg_scale_min])
7474
enabled.change(
7575
_js="dynthres_update_enabled",
76-
fn=lambda x, y: {"visible": x, "__type__": "update"},
76+
fn=None,
7777
inputs=[enabled, dtrue if is_img2img else dfalse],
78-
outputs=[accordion],
7978
show_progress = False)
8079
self.infotext_fields = (
8180
(enabled, lambda d: gr.Checkbox.update(value="Dynamic thresholding enabled" in d)),
82-
(accordion, lambda d: gr.Accordion.update(visible="Dynamic thresholding enabled" in d)),
8381
(mimic_scale, "Mimic scale"),
8482
(separate_feature_channels, "Separate Feature Channels"),
8583
(scaling_startpoint, lambda d: gr.Radio.update(value=d.get("Scaling Startpoint", "MEAN"))),

0 commit comments

Comments
 (0)