mirror of
https://github.com/vladmandic/automatic
synced 2026-09-19 09:14:35 +02:00
framepack state management
Signed-off-by: Vladimir Mandic <mandic00@live.com>
This commit is contained in:
@@ -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 = '';
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user