Fix issue with wan i2v scaling. Adjust aggressive loader to be compatable with updated diffusers.

This commit is contained in:
Jaret Burkett
2025-07-12 16:56:27 -06:00
parent 2e84b3d5b1
commit 755f0e207c
2 changed files with 27 additions and 8 deletions

View File

@@ -65,6 +65,17 @@ def add_first_frame_conditioning(
video_condition.to(device, dtype)
).latent_dist.sample()
latent_condition = latent_condition.to(device, dtype)
latents_mean = (
torch.tensor(vae.config.latents_mean)
.view(1, vae.config.z_dim, 1, 1, 1)
.to(device, dtype)
)
latents_std = 1.0 / torch.tensor(vae.config.latents_std).view(1, vae.config.z_dim, 1, 1, 1).to(
device, dtype
)
latent_condition = (latent_condition - latents_mean) * latents_std
# Create mask: 1 for conditioning frames, 0 for frames to generate
batch_size = first_frame.shape[0]