Support Fun 5B control

This commit is contained in:
kijai
2025-08-20 12:11:34 +03:00
parent 5375a01fb6
commit 35adf24d97
+5 -5
View File
@@ -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