diff options
author | Trung Ngo <codem01@gmail.com> | 2022-10-05 03:56:30 +0000 |
---|---|---|
committer | AUTOMATIC1111 <16777216c@gmail.com> | 2022-10-08 10:40:39 +0000 |
commit | 786d9f63aaa4515df82eb2cf357ea92f3dae1e29 (patch) | |
tree | 01241c36c8ae98e3dcf993363ff5310fa68b3712 /modules/ui.py | |
parent | 45cc0ce3c4616180b92dae37e5a89673bb145fa7 (diff) | |
download | stable-diffusion-webui-gfx803-786d9f63aaa4515df82eb2cf357ea92f3dae1e29.tar.gz stable-diffusion-webui-gfx803-786d9f63aaa4515df82eb2cf357ea92f3dae1e29.tar.bz2 stable-diffusion-webui-gfx803-786d9f63aaa4515df82eb2cf357ea92f3dae1e29.zip |
Add button to skip the current iteration
Diffstat (limited to 'modules/ui.py')
-rw-r--r-- | modules/ui.py | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/modules/ui.py b/modules/ui.py index 4f18126f..e3e62fdd 100644 --- a/modules/ui.py +++ b/modules/ui.py @@ -191,6 +191,7 @@ def wrap_gradio_call(func, extra_outputs=None): # last item is always HTML
res[-1] += f"<div class='performance'><p class='time'>Time taken: <wbr>{elapsed_text}</p>{vram_html}</div>"
+ shared.state.skipped = False
shared.state.interrupted = False
shared.state.job_count = 0
@@ -411,9 +412,16 @@ def create_toprow(is_img2img): with gr.Column(scale=1):
with gr.Row():
+ skip = gr.Button('Skip', elem_id=f"{id_part}_skip")
interrupt = gr.Button('Interrupt', elem_id=f"{id_part}_interrupt")
submit = gr.Button('Generate', elem_id=f"{id_part}_generate", variant='primary')
+ skip.click(
+ fn=lambda: shared.state.skip(),
+ inputs=[],
+ outputs=[],
+ )
+
interrupt.click(
fn=lambda: shared.state.interrupt(),
inputs=[],
|