mirror of
https://github.com/vladmandic/automatic
synced 2026-09-19 17:24:32 +02:00
process button busy tracking
Signed-off-by: Vladimir Mandic <mandic00@live.com>
This commit is contained in:
@@ -27,6 +27,7 @@
|
||||
- kanvas: paint combined with zoom
|
||||
- rembg: numba dependencies
|
||||
- hotkeys: legacy-vs-modernui
|
||||
- process: generate button busy tracking
|
||||
|
||||
## Update for 2026-07-14
|
||||
|
||||
|
||||
@@ -14,10 +14,10 @@
|
||||
- Video processing add/verify full API support, @CalamitousFelicitousness
|
||||
- Storage analyzer, @vladmandic
|
||||
- Lora: new handler, @CalamitousFelicitousness
|
||||
- Vide: full prompt enhance
|
||||
- Processing -> Video capabilities, @vladmandic
|
||||
- `NudeNet` in processing
|
||||
- `RIFE` in processing
|
||||
- `SeedVR2` in processing
|
||||
|
||||
### Unassigned
|
||||
|
||||
|
||||
Submodule extensions-builtin/sdnext-modernui updated: 77a103f087...5077f1be64
@@ -3,7 +3,7 @@ import tempfile
|
||||
|
||||
from PIL import Image
|
||||
|
||||
from modules import shared, images, devices, scripts_manager, scripts_postprocessing, infotext
|
||||
from modules import shared, images, devices, errors, scripts_manager, scripts_postprocessing, infotext
|
||||
from modules.logger import log
|
||||
from modules.shared import opts
|
||||
from modules.paths import resolve_output_path
|
||||
@@ -19,7 +19,7 @@ def run_postprocessing(extras_mode,
|
||||
*args,
|
||||
save_output: bool = True):
|
||||
devices.torch_gc()
|
||||
shared.state.begin('Process')
|
||||
job_id = shared.state.begin('Process')
|
||||
|
||||
def prepare_inputs(image):
|
||||
image_data = []
|
||||
@@ -135,13 +135,28 @@ def run_postprocessing(extras_mode,
|
||||
return pp.video, info, params
|
||||
|
||||
if extras_mode == 3:
|
||||
video, info, params = process_video()
|
||||
try:
|
||||
video, info, params = process_video()
|
||||
except Exception as e:
|
||||
log.error(f'Process: mode=video {e}')
|
||||
errors.display(e, 'postprocessing video')
|
||||
video = None
|
||||
info = str(e)
|
||||
params = {}
|
||||
outputs = []
|
||||
else:
|
||||
outputs, info, params = process_images()
|
||||
try:
|
||||
outputs, info, params = process_images()
|
||||
except Exception as e:
|
||||
log.error(f'Process: mode=image {e}')
|
||||
errors.display(e, 'postprocessing image')
|
||||
outputs = []
|
||||
info = str(e)
|
||||
params = {}
|
||||
video = None
|
||||
|
||||
devices.torch_gc()
|
||||
shared.state.end(job_id)
|
||||
return outputs, video, info, params
|
||||
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import os
|
||||
import gradio as gr
|
||||
from modules import scripts_manager, shared, ui_common, postprocessing, call_queue, generation_parameters_copypaste
|
||||
from modules import scripts_manager, shared, progress, ui_common, postprocessing, call_queue, generation_parameters_copypaste
|
||||
from modules.logger import log
|
||||
|
||||
|
||||
@@ -30,9 +30,12 @@ def submit_video(video):
|
||||
return html, '', text
|
||||
|
||||
|
||||
def submit_process(tab_index, extras_image, image_batch, extras_batch_input_dir, extras_batch_output_dir, extras_video, show_extras_results, save_output, *script_inputs):
|
||||
def submit_process(job_id, tab_index, extras_image, image_batch, extras_batch_input_dir, extras_batch_output_dir, extras_video, show_extras_results, save_output, *script_inputs):
|
||||
progress.start_task(job_id)
|
||||
from modules.ui_common import infotext_to_html
|
||||
result_images, result_video, geninfo, _js_info = postprocessing.run_postprocessing(tab_index, extras_image, image_batch, extras_batch_input_dir, extras_batch_output_dir, extras_video, show_extras_results, *script_inputs, save_output=save_output)
|
||||
progress.finish_task(job_id)
|
||||
|
||||
gr_result_image = gr.update(value=result_images, visible=tab_index != 3)
|
||||
gr_result_video = gr.update(value=result_video, visible=tab_index == 3)
|
||||
return gr_result_image, gr_result_video, geninfo, infotext_to_html(geninfo)
|
||||
@@ -61,7 +64,7 @@ def create_ui():
|
||||
with gr.Column(elem_id="extras_output_column"):
|
||||
id_part = 'extras'
|
||||
with gr.Row(elem_id=f"{id_part}_generate_box", elem_classes="generate-box"):
|
||||
submit = gr.Button('Generate', elem_id=f"{id_part}_generate", variant='primary')
|
||||
submit = gr.Button('Process', elem_id=f"{id_part}_generate", variant='primary')
|
||||
interrupt = gr.Button('Stop', elem_id=f"{id_part}_interrupt", variant='secondary')
|
||||
interrupt.click(fn=shared.state.interrupt, inputs=[], outputs=[])
|
||||
skip = gr.Button('Skip', elem_id=f"{id_part}_skip", variant='secondary')
|
||||
@@ -85,6 +88,7 @@ def create_ui():
|
||||
generation_parameters_copypaste.register_paste_params_button(generation_parameters_copypaste.ParamBinding(paste_button=button, tabname=tabname, source_text_component=generation_info, source_image_component=extras_image))
|
||||
generation_parameters_copypaste.add_paste_fields("extras", extras_image, None)
|
||||
|
||||
job_id = gr.Textbox(value='none', visible=False)
|
||||
tab_single.select(fn=lambda: 0, inputs=[], outputs=[tab_index])
|
||||
tab_batch.select(fn=lambda: 1, inputs=[], outputs=[tab_index])
|
||||
tab_batch_dir.select(fn=lambda: 2, inputs=[], outputs=[tab_index])
|
||||
@@ -97,6 +101,7 @@ def create_ui():
|
||||
_js="submit_postprocessing",
|
||||
fn=call_queue.wrap_gradio_gpu_call(submit_process, extra_outputs=[None, None, ''], name='Postprocess'),
|
||||
inputs=[
|
||||
job_id,
|
||||
tab_index,
|
||||
extras_image,
|
||||
image_batch,
|
||||
|
||||
Vendored
+5
-1
@@ -11469,8 +11469,12 @@ function submit_video_wrapper(...args) {
|
||||
if (btn) btn.click();
|
||||
}
|
||||
function submit_postprocessing(...args) {
|
||||
log("SubmitExtras");
|
||||
const id = randomId();
|
||||
log("SubmitProcess", id);
|
||||
clearGallery("extras");
|
||||
requestProgress(id, null, null);
|
||||
window.submit_state = "";
|
||||
args[0] = id;
|
||||
return args;
|
||||
}
|
||||
window.submit_state = "";
|
||||
|
||||
Vendored
+2
-2
File diff suppressed because one or more lines are too long
@@ -356,8 +356,12 @@ function submit_video_wrapper(...args) {
|
||||
}
|
||||
|
||||
function submit_postprocessing(...args) {
|
||||
log('SubmitExtras');
|
||||
const id = randomId();
|
||||
log('SubmitProcess', id);
|
||||
clearGallery('extras');
|
||||
requestProgress(id, null, null);
|
||||
window.submit_state = '';
|
||||
args[0] = id;
|
||||
return args;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user