Skip to content

Fix Wan I2V prepare_latents dtype #11371

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Apr 21, 2025
Merged

Fix Wan I2V prepare_latents dtype #11371

merged 1 commit into from
Apr 21, 2025

Conversation

a-r-r-o-w
Copy link
Member

dtype is set to torch.float32 when prepare_latents is called. This works if the VAE is loaded in torch.float32 (as done in the docstring). But, loading the VAE in any other dtype fails with a dtype mismatch error.

@a-r-r-o-w a-r-r-o-w requested review from yiyixuxu and Copilot April 20, 2025 20:51
Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR addresses a dtype mismatch error in the prepare_latents function by updating how the input tensor is converted to the VAE’s dtype. Key changes include updating video_condition conversion to use self.vae.dtype and adding an explicit conversion for latent_condition.

@HuggingFaceDocBuilderDev

The docs for this PR live here. All of your documentation changes will be reflected on that endpoint. The docs are available until 30 days after the last update.

Copy link
Collaborator

@yiyixuxu yiyixuxu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks!

@yiyixuxu yiyixuxu merged commit e7f3a73 into main Apr 21, 2025
15 checks passed
@yiyixuxu yiyixuxu deleted the fix-wan-i2v-dtype branch April 21, 2025 18:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants