From 949c887e0ca2c338455e7a4a9c28c147ef0aecb1 Mon Sep 17 00:00:00 2001 From: kijai <40791699+kijai@users.noreply.github.com> Date: Tue, 22 Apr 2025 09:44:46 +0300 Subject: [PATCH] Fix FLF2V when using vram management node --- diffsynth/vram_management/layers.py | 2 +- wanvideo/modules/model.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/diffsynth/vram_management/layers.py b/diffsynth/vram_management/layers.py index 06c6c40..9c97ff7 100644 --- a/diffsynth/vram_management/layers.py +++ b/diffsynth/vram_management/layers.py @@ -75,7 +75,7 @@ def enable_vram_management_recursively(model: torch.nn.Module, module_map: dict, for name, module in model.named_children(): for source_module, target_module in module_map.items(): if isinstance(module, source_module): - if "rope_embedder" in name or "patch_embedding" in name: + if "rope_embedder" in name or "patch_embedding" in name or "emb_pos" in name: continue num_param = sum(p.numel() for p in module.parameters()) diff --git a/wanvideo/modules/model.py b/wanvideo/modules/model.py index 9db7add..478ab25 100644 --- a/wanvideo/modules/model.py +++ b/wanvideo/modules/model.py @@ -695,7 +695,7 @@ class MLPProj(torch.nn.Module): def forward(self, image_embeds): if hasattr(self, 'emb_pos'): - image_embeds = image_embeds + self.emb_pos + image_embeds = image_embeds + self.emb_pos.to(image_embeds.device) clip_extra_context_tokens = self.proj(image_embeds) return clip_extra_context_tokens