From 35adf24d978e21cb9f1ec7e58195ac7882bbd4e4 Mon Sep 17 00:00:00 2001 From: kijai <40791699+kijai@users.noreply.github.com> Date: Wed, 20 Aug 2025 12:11:34 +0300 Subject: [PATCH] Support Fun 5B control --- nodes.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/nodes.py b/nodes.py index a2ad21a..2c215f7 100644 --- a/nodes.py +++ b/nodes.py @@ -826,9 +826,9 @@ class WanVideoImageToVideoEncode: H = height W = width - lat_h = H // 8 - lat_w = W // 8 - + lat_h = H // vae.upsampling_factor + lat_w = W // vae.upsampling_factor + num_frames = ((num_frames - 1) // 4) * 4 + 1 two_ref_images = start_image is not None and end_image is not None @@ -1746,7 +1746,7 @@ class WanVideoSampler: control_embeds = image_embeds.get("control_embeds", None) if control_embeds is not None: - if transformer.in_dim not in [52, 48, 36, 32]: + if transformer.in_dim not in [148, 52, 48, 36, 32]: raise ValueError("Control signal only works with Fun-Control model") control_latents = control_embeds.get("control_images", None) @@ -1843,7 +1843,7 @@ class WanVideoSampler: patcher = apply_lora(patcher, device, device, low_mem_load=False, control_lora=True) patcher.model.is_patched = True else: - if transformer.in_dim not in [48, 36, 32, 52]: + if transformer.in_dim not in [148, 48, 36, 32, 52]: raise ValueError("Control signal only works with Fun-Control model") image_cond = torch.zeros_like(noise).to(device) #fun control if transformer.in_dim == 52 or transformer.control_adapter is not None: #fun 2.2 control