mirror of
https://github.com/Wan-Video/Wan2.1.git
synced 2025-11-04 14:16:57 +00:00
Convert process tasks to function
This commit is contained in:
parent
463df32467
commit
98a946ebb0
8
wgp.py
8
wgp.py
@ -5386,7 +5386,7 @@ def process_tasks(state):
|
|||||||
gen["status"] = data
|
gen["status"] = data
|
||||||
elif cmd == "output":
|
elif cmd == "output":
|
||||||
gen["preview"] = None
|
gen["preview"] = None
|
||||||
yield time.time() , time.time()
|
# yield time.time() , time.time()
|
||||||
elif cmd == "progress":
|
elif cmd == "progress":
|
||||||
gen["progress_args"] = data
|
gen["progress_args"] = data
|
||||||
# progress(*data)
|
# progress(*data)
|
||||||
@ -5394,7 +5394,7 @@ def process_tasks(state):
|
|||||||
torch.cuda.current_stream().synchronize()
|
torch.cuda.current_stream().synchronize()
|
||||||
preview= None if data== None else generate_preview(data)
|
preview= None if data== None else generate_preview(data)
|
||||||
gen["preview"] = preview
|
gen["preview"] = preview
|
||||||
yield time.time() , gr.Text()
|
# yield time.time() , gr.Text()
|
||||||
else:
|
else:
|
||||||
raise Exception(f"unknown command {cmd}")
|
raise Exception(f"unknown command {cmd}")
|
||||||
|
|
||||||
@ -5403,7 +5403,7 @@ def process_tasks(state):
|
|||||||
gen["abort"] = False
|
gen["abort"] = False
|
||||||
status = "Video Generation Aborted", "Video Generation Aborted"
|
status = "Video Generation Aborted", "Video Generation Aborted"
|
||||||
# yield gr.Text(), gr.Text()
|
# yield gr.Text(), gr.Text()
|
||||||
yield time.time() , time.time()
|
# yield time.time() , time.time()
|
||||||
gen["status"] = status
|
gen["status"] = status
|
||||||
|
|
||||||
queue[:] = [item for item in queue if item['id'] != task['id']]
|
queue[:] = [item for item in queue if item['id'] != task['id']]
|
||||||
@ -5428,6 +5428,8 @@ def process_tasks(state):
|
|||||||
gen["status"] = status
|
gen["status"] = status
|
||||||
gen["status_display"] = False
|
gen["status_display"] = False
|
||||||
|
|
||||||
|
return time.time(), time.time()
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
def get_generation_status(prompt_no, prompts_max, repeat_no, repeat_max, window_no, total_windows):
|
def get_generation_status(prompt_no, prompts_max, repeat_no, repeat_max, window_no, total_windows):
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user