Skip to content

Why perform the following operations on the latent condition? #11036

@trouble-maker007

Description

@trouble-maker007

in the code :https://github.com/huggingface/diffusers/blob/main/src/diffusers/pipelines/wan/pipeline_wan_i2v.py
line 395-404:

latents_mean = (
    torch.tensor(self.vae.config.latents_mean)
    .view(1, self.vae.config.z_dim, 1, 1, 1)
    .to(latents.device, latents.dtype)
)
latents_std = 1.0 / torch.tensor(self.vae.config.latents_std).view(1, self.vae.config.z_dim, 1, 1, 1).to(
    latents.device, latents.dtype
)

latent_condition = (latent_condition - latents_mean) * latents_std

The official inference code of Wan2.1 does not perform similar operations:
https://github.com/Wan-Video/Wan2.1/blob/main/wan/image2video.py#L237

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions