Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/diffusers/pipelines/cosmos/pipeline_cosmos3_omni.py
Original file line number Diff line number Diff line change
Expand Up @@ -450,9 +450,9 @@ def _encode_video(self, x: torch.Tensor) -> torch.Tensor:
matches Wan2pt2VAEInterface; no autocast (WanVAE was trained with is_amp=False)."""
in_dtype = x.dtype
dtype = self.vae.dtype
mean = self._vae_latents_mean.to(device=x.device, dtype=dtype)
inv_std = self._vae_latents_inv_std.to(device=x.device, dtype=dtype)
raw_mu = retrieve_latents(self.vae.encode(x.to(dtype)), sample_mode="argmax")
mean = self._vae_latents_mean.to(device=raw_mu.device, dtype=dtype)
inv_std = self._vae_latents_inv_std.to(device=raw_mu.device, dtype=dtype)
return ((raw_mu - mean.view(1, -1, 1, 1, 1)) * inv_std.view(1, -1, 1, 1, 1)).to(in_dtype)

def decode_sound(self, latent: torch.Tensor) -> torch.Tensor:
Expand Down
Loading