aboutsummaryrefslogtreecommitdiff
path: root/modules
diff options
context:
space:
mode:
authorAUTOMATIC1111 <16777216c@gmail.com>2023-05-17 23:19:08 +0300
committerGitHub <noreply@github.com>2023-05-17 23:19:08 +0300
commit1d1b5da4bfc6ff899146b6198464134502374e7e (patch)
tree1cb30a63099a69f678d4901b495203b765a6df59 /modules
parentb397f63e00bbfbe9087d80abb457aa9a593b181b (diff)
parent04b4508a66de58c9f3a422fdcad4dd2ec3ad39ce (diff)
Merge pull request #9348 from space-nuko/improve-frontend-responsiveness
Improve frontend responsiveness for some buttons
Diffstat (limited to 'modules')
-rw-r--r--modules/ui.py10
1 files changed, 6 insertions, 4 deletions
diff --git a/modules/ui.py b/modules/ui.py
index a47af214..552a8af2 100644
--- a/modules/ui.py
+++ b/modules/ui.py
@@ -189,8 +189,9 @@ def create_seed_inputs(target_interface):
seed_resize_from_w = gr.Slider(minimum=0, maximum=2048, step=8, label="Resize seed from width", value=0, elem_id=f"{target_interface}_seed_resize_from_w")
seed_resize_from_h = gr.Slider(minimum=0, maximum=2048, step=8, label="Resize seed from height", value=0, elem_id=f"{target_interface}_seed_resize_from_h")
- random_seed.click(fn=lambda: -1, show_progress=False, inputs=[], outputs=[seed])
- random_subseed.click(fn=lambda: -1, show_progress=False, inputs=[], outputs=[subseed])
+ target_interface_state = gr.Textbox(target_interface, visible=False)
+ random_seed.click(fn=None, _js="setRandomSeed", show_progress=False, inputs=[target_interface_state], outputs=[])
+ random_subseed.click(fn=None, _js="setRandomSubseed", show_progress=False, inputs=[target_interface_state], outputs=[])
def change_visibility(show):
return {comp: gr_show(show) for comp in seed_extras}
@@ -574,7 +575,7 @@ def create_ui():
txt2img_prompt.submit(**txt2img_args)
submit.click(**txt2img_args)
- res_switch_btn.click(lambda w, h: (h, w), inputs=[width, height], outputs=[width, height], show_progress=False)
+ res_switch_btn.click(fn=None, _js="switchWidthHeightTxt2Img", inputs=None, outputs=None, show_progress=False)
restore_progress_button.click(
fn=progress.restore_progress,
@@ -949,7 +950,8 @@ def create_ui():
img2img_prompt.submit(**img2img_args)
submit.click(**img2img_args)
- res_switch_btn.click(lambda w, h: (h, w), inputs=[width, height], outputs=[width, height], show_progress=False)
+
+ res_switch_btn.click(fn=None, _js="switchWidthHeightImg2Img", inputs=None, outputs=None, show_progress=False)
restore_progress_button.click(
fn=progress.restore_progress,