Python
added ovi 1.1 support
DeepBeepMeepf1033730e98b
diff --git a/README.md b/README.mdindex 840e778..d6f3303 100644--- a/README.md+++ b/README.md@@ -36,7 +36,7 @@ WanGP supports the Wan (and derived models), Hunyuan Video and LTV Video models-----## 🔥 Latest Updates :-### November 9 2025: WanGP v9.41, Free Lunch+### November 11 2025: WanGP v9.42, Free Lunch**VAE Upsampler** for Wan 2.1/2.2 Text 2 Image and Qwen Image: *spacepxl* has tweaked the VAE Decoder used by *Wan* & *Qwen* so that it can decode and upsample x2 at the same time. The end Result is a Fast High Quality Image Upsampler (much better than Lanczos). Check the *Postprocessing Tab* / *Spatial Upsampling* Dropdown box. Unfortunately this will work only with Image Generation, no support yet for Video Generation. I have also added a VAE Refiner that keeps the existing resolution but slightly improves the details.@@ -44,6 +44,8 @@ WanGP supports the Wan (and derived models), Hunyuan Video and LTV Video models**Lucy Edit v1.1**: a new version (finetune) has been released. Not sure yet if I like it better than the original one. In theory it should work better with changing the background setting for instance.+**Ovi 1.1**: This new version exists in two flavors 5s & 10s ! Thanks to WanGP VRAM optimisations only 8 GB will be only needed for a 10s generation. Beware, the Prompt syntax has slightly changed since an audio background is now introduced using *"Audio:"* instead of using tags.+*update 9.41*: Added Mocha & Lucy Edit 1.1### November 6 2025: WanGP v9.35, How many bananas are too many bananas ?diff --git a/defaults/ovi.json b/defaults/ovi.jsonindex 6ea1904..0300497 100644--- a/defaults/ovi.json+++ b/defaults/ovi.json@@ -1,6 +1,6 @@{"model": {- "name": "Wan2.2 Ovi 10B",+ "name": "Wan2.2 Ovi v1.0 5s 10B","architecture": "ovi","description": "Ovi will generate an Audio soundtrack with the Video. It is specialized in speaking characters. Use the tags <S> and <E> to delimit the speaker words and <AUDCAP> and <ENDAUDCAP> to set the background noise.","URLs": [diff --git a/defaults/ovi_1_1.json b/defaults/ovi_1_1.jsonnew file mode 100644index 0000000..f42554b--- /dev/null+++ b/defaults/ovi_1_1.json@@ -0,0 +1,18 @@+{+ "model": {+ "name": "Wan2.2 Ovi v1.1 5s 10B",+ "architecture": "ovi",+ "description": "Ovi will generate an Audio soundtrack with the Video. It is specialized in speaking characters. Use the tags <S> and <E> to delimit the speaker words and use Audio: as a prefix to set the background noise.",+ "URLs": [+ "https://huggingface.co/DeepBeepMeep/Wan2.2/resolve/main/wan2.2_ovi1_1_video_10B_bf16.safetensors",+ "https://huggingface.co/DeepBeepMeep/Wan2.2/resolve/main/wan2.2_ovi1_1_video_10B_quanto_bf16_int8.safetensors"+ ],+ "URLs2": [+ "https://huggingface.co/DeepBeepMeep/Wan2.2/resolve/main/wan2.2_ovi1_1_audio_10B_bf16.safetensors",+ "https://huggingface.co/DeepBeepMeep/Wan2.2/resolve/main/wan2.2_ovi1_1_audio_10B_quanto_bf16_int8.safetensors"+ ]+ },+ "num_inference_steps": 30,+ "prompt" : "A singer in a glittering jacket grips the microphone, sweat shining on his brow, and shouts, <S>The end is night<E>. The crowd roars in response, fists in the air. Behind him, a guitarist steps to the mic and adds to say <S>We must all find a bunker where to hide.<E>. The energy peaks as the lights flare brighter.. Audio: Electric guitar riffs, cheering crowd, shouted male voices."++}diff --git a/defaults/ovi_1_1_10s.json b/defaults/ovi_1_1_10s.jsonnew file mode 100644index 0000000..fb5d6b5--- /dev/null+++ b/defaults/ovi_1_1_10s.json@@ -0,0 +1,22 @@+{+ "model": {+ "name": "Wan2.2 Ovi v1.1 10s 10B",+ "architecture": "ovi",+ "description": "Ovi will generate an Audio soundtrack with the Video. It is specialized in speaking characters. Use the tags <S> and <E> to delimit the speaker words and use Audio: as a prefix to set the background noise.",+ "frames_minimum": 241,+ "frames_steps": 240,+ "URLs": [+ "https://huggingface.co/DeepBeepMeep/Wan2.2/resolve/main/wan2.2_ovi1_1_10s_video_10B_bf16.safetensors",+ "https://huggingface.co/DeepBeepMeep/Wan2.2/resolve/main/wan2.2_ovi1_1_10s_video_10B_quanto_bf16_int8.safetensors"+ ],+ "URLs2": [+ "https://huggingface.co/DeepBeepMeep/Wan2.2/resolve/main/wan2.2_ovi1_1_10s_audio_10B_bf16.safetensors",+ "https://huggingface.co/DeepBeepMeep/Wan2.2/resolve/main/wan2.2_ovi1_1_10s_audio_10B_quanto_bf16_int8.safetensors"+ ]+ },+ "num_inference_steps": 30,+ "video_length": 241,+ "sliding_window_size": 241,+ "prompt" : "In a dimly lit bar or diner with a green ambient light, a woman with short, curly brown hair and a white button-up shirt sits thoughtfully, looking down and touching her chin. A man with curly brown hair and a dark shirt with colorful patterns on the shoulder leans towards her from a green booth, holding a drink and smiling gently. He speaks to her, <S>I said I was sorry and I meant it. It just didn't fit in the five second version.<E> He continues, <S>Now Ovi gave me ten and I'm using all of them to be wrong again.<E> The woman looks up, her expression serious, and gestures with her left hand, a ring visible on her finger. She responds, <S>Impressive consistency.<E> The man leans back slightly, still holding his drink, and looks at her expectantly, <S>Would you mind telling me if the director can cut this take?<E> Audio: Upbeat background music, faint murmur of conversation, calm male voice, slightly dismissive female voice, clinking of glasses."++}diff --git a/defaults/ovi_1_1_10s_fastwan.json b/defaults/ovi_1_1_10s_fastwan.jsonnew file mode 100644index 0000000..52e4711--- /dev/null+++ b/defaults/ovi_1_1_10s_fastwan.json@@ -0,0 +1,20 @@+{+ "model": {+ "name": "Wan2.2 Ovi v1.1 FastWan 10s 10B",+ "architecture": "ovi",+ "description": "Ovi will generate an Audio soundtrack with the Video. It is specialized in speaking characters. Use the tags <S> and <E> to delimit the speaker words and use Audio: as a prefix to set the background noise. This version is accelerated by Fastwan.",+ "URLs": "ovi_1_1_10s",+ "URLs2": "ovi_1_1_10s",+ "loras": ["https://huggingface.co/DeepBeepMeep/Wan2.2/resolve/main/loras_accelerators/Wan2_2_5B_FastWanFullAttn_lora_rank_128_bf16.safetensors"],+ "loras_multipliers": [1],+ "frames_minimum": 241,+ "frames_steps": 240+ },+ "prompt" : "In a dimly lit bar or diner with a green ambient light, a woman with short, curly brown hair and a white button-up shirt sits thoughtfully, looking down and touching her chin. A man with curly brown hair and a dark shirt with colorful patterns on the shoulder leans towards her from a green booth, holding a drink and smiling gently. He speaks to her, <S>I said I was sorry and I meant it. It just didn't fit in the five second version.<E> He continues, <S>Now Ovi gave me ten and I'm using all of them to be wrong again.<E> The woman looks up, her expression serious, and gestures with her left hand, a ring visible on her finger. She responds, <S>Impressive consistency.<E> The man leans back slightly, still holding his drink, and looks at her expectantly, <S>Would you mind telling me if the director can cut this take?<E> Audio: Upbeat background music, faint murmur of conversation, calm male voice, slightly dismissive female voice, clinking of glasses.",+ "video_length": 241,+ "guidance_scale": 1,+ "audio_guidance_scale": 1,+ "flow_shift": 6,+ "sliding_window_size": 241,+ "num_inference_steps": 10+}diff --git a/defaults/ovi_1_1_fastwan.json b/defaults/ovi_1_1_fastwan.jsonnew file mode 100644index 0000000..535c14e--- /dev/null+++ b/defaults/ovi_1_1_fastwan.json@@ -0,0 +1,19 @@+{+ "model": {+ "name": "Wan2.2 Ovi v1.1 FastWan 5s 10B",+ "architecture": "ovi",+ "description": "Ovi will generate an Audio soundtrack with the Video. It is specialized in speaking characters. Use the tags <S> and <E> to delimit the speaker words and use Audio: as a prefix to set the background noise.",+ "URLs": "ovi_1_1",+ "URLs2": "ovi_1_1",+ "source": "xxx",+ "source2": "xxx",+ "loras": ["https://huggingface.co/DeepBeepMeep/Wan2.2/resolve/main/loras_accelerators/Wan2_2_5B_FastWanFullAttn_lora_rank_128_bf16.safetensors"],+ "loras_multipliers": [1]+ },+ "num_inference_steps": 6,+ "prompt" : "A singer in a glittering jacket grips the microphone, sweat shining on his brow, and shouts, <S>The end is night<E>. The crowd roars in response, fists in the air. Behind him, a guitarist steps to the mic and adds to say <S>We must all find a bunker where to hide.<E>. The energy peaks as the lights flare brighter.. Audio: Electric guitar riffs, cheering crowd, shouted male voices.",+ "guidance_scale": 1,+ "audio_guidance_scale": 1,+ "flow_shift": 6,+ "num_inference_steps": 6+}diff --git a/defaults/ovi_fastwan.json b/defaults/ovi_fastwan.jsonindex bd905df..f5e5cf1 100644--- a/defaults/ovi_fastwan.json+++ b/defaults/ovi_fastwan.json@@ -1,6 +1,6 @@{"model": {- "name": "Wan2.2 Ovi FastWan 10B",+ "name": "Wan2.2 Ovi v1.0 FastWan 5s 10B","architecture": "ovi","description": "Ovi will generate an Audio soundtrack with the Video. It is specialized in speaking characters. Use the tags <S> and <E> to delimit the speaker words and <AUDCAP> and <ENDAUDCAP> to set the background noise. This version of Ovi is accelerated by FastWan","URLs": "ovi",diff --git a/models/wan/ovi_fusion_engine.py b/models/wan/ovi_fusion_engine.pyindex 24b5dd6..0c294cd 100644--- a/models/wan/ovi_fusion_engine.py+++ b/models/wan/ovi_fusion_engine.py@@ -70,6 +70,7 @@ class OviFusionEngine:self.device = deviceself.target_dtype = torch.bfloat16 # dtype, wont work with torch.float16model, video_config, audio_config = init_fusion_score_model_ovi()+ # offload.load_model_data(model, "c:/temp/model_960x960.safetensors")offload.load_model_data(model.video_model, model_filename[0])offload.load_model_data(model.audio_model, model_filename[1])offload.change_dtype(model, dtype, True)@@ -78,11 +79,11 @@ class OviFusionEngine:self.model = model- # offload.save_model(model.video_model, "wan2.2_ovi_video_10B_bf16.safetensors")- # offload.save_model(model.video_model, "wan2.2_ovi_video_10B_quanto_fp16_int8.safetensors", do_quantize=True)+ # offload.save_model(model.video_model, "wan2.2_ovi1_1_video_10B_bf16.safetensors")+ # offload.save_model(model.video_model, "wan2.2_ovi1_1_video_10B_quanto_bf16_int8.safetensors", do_quantize=True)- # offload.save_model(model.audio_model, "wan2.2_ovi_audio_10B_bf16.safetensors")- # offload.save_model(model.audio_model, "wan2.2_ovi_audio_10B_quanto_fp16_int8.safetensors", do_quantize=True)+ # offload.save_model(model.audio_model, "wan2.2_ovi1_1_audio_10B_bf16.safetensors")+ # offload.save_model(model.audio_model, "wan2.2_ovi1_1_audio_10B_quanto_bf16_int8.safetensors", do_quantize=True)self.vae_stride = (4, 16, 16)@@ -130,6 +131,7 @@ class OviFusionEngine:input_video = None,width = 1280,height = 720,+ frame_num = 121,seed=100,solver_name="unipc",sampling_steps=50,@@ -209,9 +211,13 @@ class OviFusionEngine:video_h, video_w = video_frame_height_widthvideo_latent_h, video_latent_w = video_h // 16, video_w // 16- video_latent_length = 31- audio_latent_length = 157-+ if frame_num == 121:+ video_latent_length = 31+ audio_latent_length = 157+ else:+ video_latent_length = 61+ audio_latent_length = 314+from .modules.posemb_layers import get_rotary_pos_embed, get_nd_rotary_pos_embeddiff --git a/wgp.py b/wgp.pyindex 80f91de..32a2c16 100644--- a/wgp.py+++ b/wgp.py@@ -78,7 +78,7 @@ global_queue_ref = []AUTOSAVE_FILENAME = "queue.zip"PROMPT_VARS_MAX = 10target_mmgp_version = "3.6.7"-WanGP_version = "9.41"+WanGP_version = "9.42"settings_version = 2.40max_source_video_frames = 3000prompt_enhancer_image_caption_model, prompt_enhancer_image_caption_processor, prompt_enhancer_llm_model, prompt_enhancer_llm_tokenizer = None, None, None, None