Python
fixed loras ignored and other bugs
DeepBeepMeepf5dc6d0f4db3
diff --git a/README.md b/README.mdindex af1568a..52799c5 100644--- a/README.md+++ b/README.md@@ -20,7 +20,7 @@ WanGP supports the Wan (and derived models), Hunyuan Video and LTV Video models**Follow DeepBeepMeep on Twitter/X to get the Latest News**: https://x.com/deepbeepmeep## 🔥 Latest Updates-### July 2 2025: WanGP v6.5, WanGP takes care of you: lots of quality of life features:+### July 2 2025: WanGP v6.5.1, WanGP takes care of you: lots of quality of life features:- View directly inside WanGP the properties (seed, resolutions, length, most settings...) of the past generations- In one click use the newly generated video as a Control Video or Source Video to be continued- Manage multiple settings for the same model and switch between them using a dropdown box@@ -37,6 +37,8 @@ Taking care of your life is not enough, you want new stuff to play with ?- Choice of Wan Samplers / Schedulers- More Lora formats support+**If you had upgraded to v6.5 please upgrade again to 6.5.1 as this will fix a bug that ignored Loras beyond the first one**+### June 23 2025: WanGP v6.3, Vace Unleashed. Thought we couldnt squeeze Vace even more ?- Multithreaded preprocessing when possible for faster generations- Multithreaded frames Lanczos Upsampling as a bonusdiff --git a/requirements.txt b/requirements.txtindex 54f5d2b..8f9be07 100644--- a/requirements.txt+++ b/requirements.txt@@ -17,7 +17,7 @@ gradio==5.23.0numpy>=1.23.5,<2einopsmoviepy==1.0.3-mmgp==3.5.0+mmgp==3.5.1peft==0.15.0mutagenpydantic==2.10.6diff --git a/wan/image2video.py b/wan/image2video.pyindex 3c14fc5..7cf79d4 100644--- a/wan/image2video.py+++ b/wan/image2video.py@@ -26,6 +26,7 @@ from .utils.fm_solvers import (FlowDPMSolverMultistepScheduler,from .utils.fm_solvers_unipc import FlowUniPCMultistepSchedulerfrom wan.modules.posemb_layers import get_rotary_pos_embedfrom wan.utils.utils import resize_lanczos, calculate_new_dimensions+from wan.utils.basic_flowmatch import FlowMatchSchedulerdef optimized_scale(positive_flat, negative_flat):diff --git a/wan/utils/utils.py b/wan/utils/utils.pyindex f9882e6..6461e15 100644--- a/wan/utils/utils.py+++ b/wan/utils/utils.py@@ -69,6 +69,15 @@ def get_file_creation_date(file_path):stat = os.stat(file_path)return datetime.fromtimestamp(stat.st_birthtime if hasattr(stat, 'st_birthtime') else stat.st_mtime)+def truncate_for_filesystem(s, max_bytes=255):+ if len(s.encode('utf-8')) <= max_bytes: return s+ l, r = 0, len(s)+ while l < r:+ m = (l + r + 1) // 2+ if len(s[:m].encode('utf-8')) <= max_bytes: l = m+ else: r = m - 1+ return s[:l]+def get_video_info(video_path):import cv2cap = cv2.VideoCapture(video_path)diff --git a/wgp.py b/wgp.pyindex f5e9c80..31ddba6 100644--- a/wgp.py+++ b/wgp.py@@ -47,8 +47,8 @@ global_queue_ref = []AUTOSAVE_FILENAME = "queue.zip"PROMPT_VARS_MAX = 10-target_mmgp_version = "3.5.0"-WanGP_version = "6.5"+target_mmgp_version = "3.5.1"+WanGP_version = "6.51"settings_version = 2.1prompt_enhancer_image_caption_model, prompt_enhancer_image_caption_processor, prompt_enhancer_llm_model, prompt_enhancer_llm_tokenizer = None, None, None, None@@ -4071,7 +4071,7 @@ def generate_video(preprocess_type = process_map.get(process_letter, "vace")else:preprocess_type2 = process_map.get(process_letter, None)- process_names = { "pose": "Open Pose", "depth": "Depth Mask", "scribble" : "Shapes", "flow" : "Flow Map", "gray" : "Gray Levels", "inpaint" : "Inpaint Mask", "U": "Identity Mask", "vace" : "Vace Data"}+ process_names = { "pose": "Open Pose", "depth": "Depth Mask", "scribble" : "Shapes", "flow" : "Flow Map", "gray" : "Gray Levels", "inpaint" : "Inpaint Mask", "identity": "Identity Mask", "vace" : "Vace Data"}status_info = "Extracting " + process_names[preprocess_type]extra_process_list = ([] if preprocess_type2==None else [preprocess_type2]) + ([] if process_outside_mask==None or process_outside_mask == preprocess_type else [process_outside_mask])if len(extra_process_list) == 1:@@ -4316,10 +4316,11 @@ def generate_video(time_flag = datetime.fromtimestamp(time.time()).strftime("%Y-%m-%d-%Hh%Mm%Ss")save_prompt = original_prompts[0]+ from wan.utils.utils import truncate_for_filesystemif os.name == 'nt':- file_name = f"{time_flag}_seed{seed}_{sanitize_file_name(save_prompt[:50]).strip()}.mp4"+ file_name = f"{time_flag}_seed{seed}_{sanitize_file_name(truncate_for_filesystem(save_prompt,50)).strip()}.mp4"else:- file_name = f"{time_flag}_seed{seed}_{sanitize_file_name(save_prompt[:100]).strip()}.mp4"+ file_name = f"{time_flag}_seed{seed}_{sanitize_file_name(truncate_for_filesystem(save_prompt,100)).strip()}.mp4"video_path = os.path.join(save_path, file_name)any_mmaudio = MMAudio_setting != 0 and server_config.get("mmaudio_enabled", 0) != 0 and sample.shape[1] >=fpsif audio_guide != None or any_mmaudio :