framepack state management

Signed-off-by: Vladimir Mandic <mandic00@live.com>
This commit is contained in:
Vladimir Mandic
2025-04-20 08:56:02 -04:00
parent 434bb660ce
commit 3b39a5b5a4
4 changed files with 3 additions and 7 deletions
+1 -1
View File
@@ -34,7 +34,7 @@ function checkPaused(state) {
}
function setProgress(res) {
const elements = ['txt2img_generate', 'img2img_generate', 'extras_generate', 'control_generate', 'video_generate'];
const elements = ['txt2img_generate', 'img2img_generate', 'extras_generate', 'control_generate', 'video_generate', 'framepack_generate'];
const progress = res?.progress || 0;
const job = res?.job || '';
let perc = '';
-4
View File
@@ -189,10 +189,6 @@ function get_img2img_tab_index(...args) {
function create_submit_args(args) {
const res = Array.from(args);
// As it is currently, txt2img and img2img send back the previous output args (txt2img_gallery, generation_info, html_info) whenever you generate a new image.
// This can lead to uploading a huge gallery of previously generated images, which leads to an unnecessary delay between submitting and beginning to generate.
// I don't know why gradio is sending outputs along with inputs, but we can prevent sending the image gallery here, which seems to be an issue for some.
// If gradio at some point stops sending outputs, this may break something
if (Array.isArray(res[res.length - 3])) res[res.length - 3] = null;
return res;
}
+1 -1
View File
@@ -95,7 +95,7 @@ def wrap_gradio_call(func, extra_outputs=None, add_stats=False, name=None):
if ram['used'] > 0:
cpu += f"| RAM {ram['used']} GB"
cpu += f" {round(100.0 * ram['used'] / ram['total'])}%" if ram['total'] > 0 else ''
if isinstance(res, list):
if isinstance(res, list) and isinstance(res[-1], str):
res[-1] += f"<div class='performance'><p>Time: {elapsed_text} | {summary} {gpu} {cpu}</p></div>"
return tuple(res)
return f
+1 -1
View File
@@ -178,7 +178,7 @@ def create_ui():
# generate function
video_dict = dict(
fn=call_queue.wrap_gradio_gpu_call(run_video, extra_outputs=[None, '', ''], name='Video'),
_js="submit_video",
_js="submit_framepack",
inputs=video_args,
outputs=[gallery, video, gen_info, html_info, html_log],
show_progress=False,