mirror of
https://github.com/ostris/ai-toolkit.git
synced 2026-04-30 11:11:37 +00:00
Fix issue with wan i2v scaling. Adjust aggressive loader to be compatable with updated diffusers.
This commit is contained in:
@@ -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]
|
||||
|
||||
Reference in New Issue
Block a user