handle generate button visibility in generate_clicked
This commit is contained in:
parent
2e1e82941d
commit
2856893e15
15
webui.py
15
webui.py
|
|
@ -32,7 +32,8 @@ def generate_clicked(*args):
|
|||
gr.update(visible=False, value=None), \
|
||||
gr.update(visible=False), \
|
||||
gr.update(visible=True, interactive=True), \
|
||||
gr.update(visible=True, interactive=True)
|
||||
gr.update(visible=True, interactive=True), \
|
||||
gr.update(visible=False)
|
||||
|
||||
worker.async_tasks.append(task)
|
||||
|
||||
|
|
@ -54,21 +55,24 @@ def generate_clicked(*args):
|
|||
gr.update(), \
|
||||
gr.update(visible=False), \
|
||||
gr.update(visible=True), \
|
||||
gr.update(visible=True)
|
||||
gr.update(visible=True), \
|
||||
gr.update(visible=False)
|
||||
if flag == 'results':
|
||||
yield gr.update(visible=True), \
|
||||
gr.update(visible=True), \
|
||||
gr.update(visible=True, value=product), \
|
||||
gr.update(visible=False), \
|
||||
gr.update(visible=True), \
|
||||
gr.update(visible=True)
|
||||
gr.update(visible=True), \
|
||||
gr.update(visible=False)
|
||||
if flag == 'finish':
|
||||
yield gr.update(visible=False), \
|
||||
gr.update(visible=False), \
|
||||
gr.update(visible=False), \
|
||||
gr.update(visible=True, value=product), \
|
||||
gr.update(visible=False), \
|
||||
gr.update(visible=False)
|
||||
gr.update(visible=False), \
|
||||
gr.update(visible=True)
|
||||
finished = True
|
||||
|
||||
execution_time = time.perf_counter() - execution_start_time
|
||||
|
|
@ -463,8 +467,7 @@ with shared.gradio_root:
|
|||
generate_button.click(lambda: (gr.update(visible=True, interactive=False), gr.update(visible=True, interactive=False), gr.update(visible=False), []), outputs=[stop_button, skip_button, generate_button, gallery]) \
|
||||
.then(fn=refresh_seed, inputs=[seed_random, image_seed], outputs=image_seed) \
|
||||
.then(advanced_parameters.set_all_advanced_parameters, inputs=adps) \
|
||||
.then(fn=generate_clicked, inputs=ctrls, outputs=[progress_html, progress_window, progress_gallery, gallery, stop_button, skip_button]) \
|
||||
.then(lambda: (gr.update(visible=True), gr.update(visible=False), gr.update(visible=False)), outputs=[generate_button, stop_button, skip_button]) \
|
||||
.then(fn=generate_clicked, inputs=ctrls, outputs=[progress_html, progress_window, progress_gallery, gallery, stop_button, skip_button, generate_button]) \
|
||||
.then(fn=lambda: None, _js='playNotification').then(fn=lambda: None, _js='refresh_grid_delayed')
|
||||
|
||||
def dump_default_english_config():
|
||||
|
|
|
|||
Loading…
Reference in New Issue