Skip to content
Merged
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
Original file line number Diff line number Diff line change
Expand Up @@ -243,7 +243,9 @@ def _encode_vae_image(
num_videos_per_prompt: int,
do_classifier_free_guidance: bool,
):
image = image.to(device=device)
# The image comes out of `video_processor.preprocess()` in float32. When `needs_upcasting=False`, the VAE may not
# be in FP32 (for example, it could be in BF16) so we need to cast in this case.
image = image.to(device=device, dtype=self.vae.dtype)
image_latents = self.vae.encode(image).latent_dist.mode()

# duplicate image_latents for each generation per prompt, using mps friendly method
Expand Down
Loading