fixed abort button

This commit is contained in:
DeepBeepMeep 2025-04-18 03:12:14 +02:00
parent 05e7eb4bef
commit d82fa9a8d6
2 changed files with 6 additions and 2 deletions

View File

@ -10,6 +10,7 @@
## 🔥 Latest News!!
* April 18 2025: 👋 Wan 2.1GP v4.2: FLF2V model support, official support from Wan for image2video start and end frames specialized for 720p.
* April 17 2025: 👋 Wan 2.1GP v4.1: Recam Master model support, view a video from a different angle. The video to process must be at least 81 frames long and you should set at least 15 steps denoising to get good results.
* April 13 2025: 👋 Wan 2.1GP v4.0: lots of goodies for you !
- A new UI, tabs were replaced by a Dropdown box to easily switch models

7
wgp.py
View File

@ -2850,14 +2850,17 @@ def process_tasks(state, progress=gr.Progress()):
gen["prompts_max"] = 0
gen["prompt"] = ""
yield status
abort = gen.get("abort", False)
if abort:
gen["abort"] = False
yield "Video Generation Aborted"
queue[:] = [item for item in queue if item['id'] != task['id']]
update_global_queue_ref(queue)
gen["prompts_max"] = 0
gen["prompt"] = ""
end_time = time.time()
if gen.get("abort"):
if abort:
yield f"Video generation was aborted. Total Generation Time: {end_time-start_time:.1f}s"
else:
yield f"Total Generation Time: {end_time-start_time:.1f}s"