From f976ed223d6defefd24f339819b4f12d99c80e3f Mon Sep 17 00:00:00 2001 From: Vladimir Mandic Date: Sun, 14 Sep 2025 09:14:52 -0400 Subject: [PATCH] fix wan22-i2v Signed-off-by: Vladimir Mandic --- CHANGELOG.md | 7 ++++--- html/reference.json | 9 ++++++++- modules/video_models/models_def.py | 2 +- pipelines/model_wanai.py | 12 +++++++----- 4 files changed, 20 insertions(+), 10 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 9c26f559b..aa9265172 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,8 +1,8 @@ # Change Log for SD.Next -## Update for 2025-09-13 +## Update for 2025-09-14 -### Highlights for 2025-09-13 +### Highlights for 2025-09-14 *What's new*? Big one is that we're (finally) switching the default UI to **ModernUI**! StandardUI is still available and can be selected in settings, but ModernUI is now the default for new installs @@ -13,7 +13,7 @@ And check out new **history** tab in the right panel, it now shows visualization [ReadMe](https://github.com/vladmandic/automatic/blob/master/README.md) | [ChangeLog](https://github.com/vladmandic/automatic/blob/master/CHANGELOG.md) | [Docs](https://vladmandic.github.io/sdnext-docs/) | [WiKi](https://github.com/vladmandic/automatic/wiki) | [Discord](https://discord.com/invite/sd-next-federal-batch-inspectors-1101998836328697867) | [Sponsor](https://github.com/sponsors/vladmandic) -### Details for 2025-09-13 +### Details for 2025-09-14 - **Models** - **Chroma** final versions: [Chroma1-HD](https://huggingface.co/lodestones/Chroma1-HD), [Chroma1-Base](https://huggingface.co/lodestones/Chroma1-Base) and [Chroma1-Flash](https://huggingface.co/lodestones/Chroma1-Flash) @@ -1261,6 +1261,7 @@ Models...And support for new models: **CogView-4**, **SANA 1.5**, - fix paste incorrect float to int cast - fix server restart from ui - fix style apply params + - fix `wan22-i2v` - do not allow edit of built-in styles - improve lora compatibility with balanced offload diff --git a/html/reference.json b/html/reference.json index 0f293a786..ee0ccf103 100644 --- a/html/reference.json +++ b/html/reference.json @@ -254,13 +254,20 @@ "skip": true, "extras": "sampler: Default" }, - "Wan-AI Wan2.2 A14B": { + "Wan-AI Wan2.2 A14B T2I": { "path": "Wan-AI/Wan2.2-T2V-A14B-Diffusers", "preview": "Wan-AI--Wan2.2-T2V-A14B-Diffusers.jpg", "desc": "Wan2.2, offering more powerful capabilities, better performance, and superior visual quality. With Wan2.2, we have focused on incorporating the following technical innovations: MoE Architecture, Data Scalling, Cinematic Aesthetics, Efficient High-Definition Hybrid", "skip": true, "extras": "sampler: Default" }, + "Wan-AI Wan2.2 A14B I2I": { + "path": "Wan-AI/Wan2.2-I2V-A14B-Diffusers", + "preview": "Wan-AI--Wan2.2-T2V-A14B-Diffusers.jpg", + "desc": "Wan2.2, offering more powerful capabilities, better performance, and superior visual quality. With Wan2.2, we have focused on incorporating the following technical innovations: MoE Architecture, Data Scalling, Cinematic Aesthetics, Efficient High-Definition Hybrid", + "skip": true, + "extras": "sampler: Default" + }, "Freepik F-Lite": { "path": "Freepik/F-Lite", diff --git a/modules/video_models/models_def.py b/modules/video_models/models_def.py index 01d9b6b2e..6d92db375 100644 --- a/modules/video_models/models_def.py +++ b/modules/video_models/models_def.py @@ -164,7 +164,7 @@ models = { dit_folder=("transformer", "transformer_2")), Model(name='WAN 2.2 A14B I2V', url='https://huggingface.co/Wan-AI/Wan2.2-I2V-A14B-Diffusers', - repo='Wan-AI/Wan2.2-T2V-A14B-Diffusers', + repo='Wan-AI/Wan2.2-I2V-A14B-Diffusers', repo_cls=diffusers.WanImageToVideoPipeline, te_cls=transformers.T5EncoderModel, dit_cls=diffusers.WanTransformer3DModel, diff --git a/pipelines/model_wanai.py b/pipelines/model_wanai.py index f58c69a8e..b0a7d8d85 100644 --- a/pipelines/model_wanai.py +++ b/pipelines/model_wanai.py @@ -81,9 +81,14 @@ def load_wan(checkpoint_info, diffusers_load_config={}): load_args, _quant_args = model_quant.get_dit_args(diffusers_load_config, module='Model') boundary_ratio = shared.opts.model_wan_boundary if transformer_2 is not None else None - shared.log.debug(f'Load model: type=WanAI model="{checkpoint_info.name}" repo="{repo_id}" offload={shared.opts.diffusers_offload_mode} dtype={devices.dtype} args={load_args} stage="{shared.opts.model_wan_stage}" boundary={boundary_ratio}') - cls = diffusers.WanPipeline + if 'Wan2.2-I2V' in repo_id: + cls = diffusers.WanImageToVideoPipeline + diffusers.pipelines.auto_pipeline.AUTO_IMAGE2IMAGE_PIPELINES_MAPPING["wanai"] = diffusers.WanImageToVideoPipeline + else: + cls = diffusers.WanPipeline + diffusers.pipelines.auto_pipeline.AUTO_TEXT2IMAGE_PIPELINES_MAPPING["wanai"] = diffusers.WanPipeline + shared.log.debug(f'Load model: type=WanAI model="{checkpoint_info.name}" repo="{repo_id}" cls={cls.__name__} offload={shared.opts.diffusers_offload_mode} dtype={devices.dtype} args={load_args} stage="{shared.opts.model_wan_stage}" boundary={boundary_ratio}') pipe = cls.from_pretrained( repo_id, transformer=transformer, @@ -102,9 +107,6 @@ def load_wan(checkpoint_info, diffusers_load_config={}): del transformer del transformer_2 - diffusers.pipelines.auto_pipeline.AUTO_TEXT2IMAGE_PIPELINES_MAPPING["wanai"] = diffusers.WanPipeline - # diffusers.pipelines.auto_pipeline.AUTO_IMAGE2IMAGE_PIPELINES_MAPPING["wanai"] = diffusers.WanImageToVideoPipeline - sd_hijack_te.init_hijack(pipe) sd_hijack_vae.init_hijack(pipe)