Skip to content

Commit

Permalink
Revert "only make stop_button and skip_button interactive when render…
Browse files Browse the repository at this point in the history
…ing process starts"

This reverts commit d3f9156.
  • Loading branch information
mashb1t committed Nov 18, 2023
1 parent 617255d commit 83efbbd
Showing 1 changed file with 6 additions and 14 deletions.
20 changes: 6 additions & 14 deletions webui.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,7 @@ def generate_clicked(*args):
yield gr.update(visible=True, value=modules.html.make_progress_html(1, 'Waiting for task to start ...')), \
gr.update(visible=True, value=None), \
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=False)

worker.async_tasks.append(task)

Expand All @@ -54,23 +52,17 @@ def generate_clicked(*args):
yield gr.update(visible=True, value=modules.html.make_progress_html(percentage, title)), \
gr.update(visible=True, value=image) if image is not None else gr.update(), \
gr.update(), \
gr.update(visible=False), \
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=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=True, value=product)
finished = True

execution_time = time.perf_counter() - execution_start_time
Expand Down Expand Up @@ -446,10 +438,10 @@ def model_refresh_clicked():
ctrls += [outpaint_selections, inpaint_input_image]
ctrls += ip_ctrls

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]) \
generate_button.click(lambda: (gr.update(visible=True, interactive=True), gr.update(visible=True, interactive=True), 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(fn=generate_clicked, inputs=ctrls, outputs=[progress_html, progress_window, progress_gallery, gallery]) \
.then(lambda: (gr.update(visible=True), gr.update(visible=False), gr.update(visible=False)), outputs=[generate_button, stop_button, skip_button]) \
.then(fn=lambda: None, _js='playNotification').then(fn=lambda: None, _js='refresh_grid_delayed')

Expand Down

0 comments on commit 83efbbd

Please sign in to comment.