Skip to content

Commit

Permalink
add workaround for changing prompt while generating (#1578)
Browse files Browse the repository at this point in the history
  • Loading branch information
mashb1t committed Dec 28, 2023
1 parent 7b5bced commit 986ab45
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions webui.py
Original file line number Diff line number Diff line change
Expand Up @@ -525,7 +525,7 @@ def parse_meta(raw_prompt_txt):
loaded_json = None

if loaded_json is None:
return gr.update(), gr.update(visible=True), gr.update(visible=False)
return gr.update(), gr.update(), gr.update(visible=False)

return json.dumps(loaded_json), gr.update(visible=False), gr.update(visible=True)

Expand Down Expand Up @@ -557,11 +557,11 @@ def parse_meta(raw_prompt_txt):
load_parameter_button
] + lora_ctrls, queue=False, show_progress=False)

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]) \
generate_button.click(lambda: (gr.update(visible=True, interactive=True), gr.update(visible=True, interactive=True), gr.update(visible=False, interactive=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]) \
.then(lambda: (gr.update(visible=True), gr.update(visible=False), gr.update(visible=False)), outputs=[generate_button, stop_button, skip_button]) \
.then(lambda: (gr.update(visible=True, interactive=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')

for notification_file in ['notification.ogg', 'notification.mp3']:
Expand Down

0 comments on commit 986ab45

Please sign in to comment.