diff --git a/fooocus_version.py b/fooocus_version.py index 2c77261..8acab13 100644 --- a/fooocus_version.py +++ b/fooocus_version.py @@ -1 +1 @@ -version = '2.1.33' +version = '2.1.34' diff --git a/modules/async_worker.py b/modules/async_worker.py index f57031f..a4db9ff 100644 --- a/modules/async_worker.py +++ b/modules/async_worker.py @@ -542,8 +542,12 @@ def worker(): results += imgs except comfy.model_management.InterruptProcessingException as e: - print('User stopped') - break + if shared.last_stop == 'skip': + print('User skipped') + continue + else: + print('User stopped') + break execution_time = time.perf_counter() - execution_start_time print(f'Generating and saving time: {execution_time:.2f} seconds') diff --git a/modules/html.py b/modules/html.py index fe0d65c..8afe9ac 100644 --- a/modules/html.py +++ b/modules/html.py @@ -72,6 +72,10 @@ progress::after { height: 80px !important; } +.type_row_half{ + height: 32px !important; +} + .scroll-hide{ resize: none !important; } diff --git a/shared.py b/shared.py index f940fee..269809e 100644 --- a/shared.py +++ b/shared.py @@ -1 +1,2 @@ gradio_root = None +last_stop = None diff --git a/webui.py b/webui.py index 83ffe9f..024c67c 100644 --- a/webui.py +++ b/webui.py @@ -57,14 +57,23 @@ with shared.gradio_root: prompt = gr.Textbox(show_label=False, placeholder="Type prompt here.", container=False, autofocus=True, elem_classes='type_row', lines=1024) with gr.Column(scale=0.15, min_width=0): run_button = gr.Button(label="Generate", value="Generate", elem_classes='type_row', visible=True) - stop_button = gr.Button(label="Stop", value="Stop", elem_classes='type_row', visible=False) + skip_button = gr.Button(label="Skip", value="Skip", elem_classes='type_row_half', visible=False) + stop_button = gr.Button(label="Stop", value="Stop", elem_classes='type_row_half', visible=False) def stop_clicked(): import comfy.model_management as model_management + shared.last_stop = 'stop' model_management.interrupt_current_processing() - return gr.update(interactive=False) + return [gr.update(interactive=False)] * 2 - stop_button.click(stop_clicked, outputs=stop_button, queue=False) + def skip_clicked(): + import comfy.model_management as model_management + shared.last_stop = 'skip' + model_management.interrupt_current_processing() + return + + stop_button.click(stop_clicked, outputs=[skip_button, stop_button], queue=False) + skip_button.click(skip_clicked, queue=False) with gr.Row(elem_classes='advanced_check_row'): input_image_checkbox = gr.Checkbox(label='Input Image', value=False, container=False, elem_classes='min_check') advanced_checkbox = gr.Checkbox(label='Advanced', value=False, container=False, elem_classes='min_check') @@ -308,11 +317,11 @@ with shared.gradio_root: ctrls += [outpaint_selections, inpaint_input_image] ctrls += ip_ctrls - run_button.click(lambda: (gr.update(visible=True, interactive=True), gr.update(visible=False), []), outputs=[stop_button, run_button, gallery])\ + run_button.click(lambda: (gr.update(visible=True, interactive=True), gr.update(visible=True, interactive=True), gr.update(visible=False), []), outputs=[stop_button, skip_button, run_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, gallery])\ - .then(lambda: (gr.update(visible=True), gr.update(visible=False)), outputs=[run_button, stop_button]) + .then(lambda: (gr.update(visible=True), gr.update(visible=False), gr.update(visible=False)), outputs=[run_button, stop_button, skip_button]) shared.gradio_root.launch(