From be02ec93ccfe3409d3502adc6d5b926ac057c590 Mon Sep 17 00:00:00 2001 From: Anastasiy Safari Date: Wed, 15 Oct 2025 17:28:19 -0700 Subject: [PATCH] Fix WanAnimate to use ref_latent without bg_images --- nodes_sampler.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/nodes_sampler.py b/nodes_sampler.py index 7ed6829..e590af5 100644 --- a/nodes_sampler.py +++ b/nodes_sampler.py @@ -2666,6 +2666,9 @@ class WanVideoSampler: del temporal_ref_latents, msk, bg_image_slice else: image_cond_in = torch.cat([torch.tile(torch.zeros_like(noise[:1]), [4, 1, 1, 1]), torch.zeros_like(noise)], dim=0).to(device) + elif ref_latent is not None: + # Use ref_latent even without bg_images + image_cond_in = torch.cat([ref_latent.to(device), torch.zeros_like(noise)], dim=1) else: image_cond_in = torch.cat([torch.tile(torch.zeros_like(noise[:1]), [4, 1, 1, 1]), torch.zeros_like(noise)], dim=0).to(device)