Skip to content
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

[VAE] fix the downsample block in Encoder. #156

Merged
merged 2 commits into from
Aug 6, 2022
Merged

Conversation

patil-suraj
Copy link
Contributor

@patil-suraj patil-suraj commented Aug 5, 2022

The VAE encoder is currently broken, as we don't pass downsample_padding to get_down_block, so it defaults to None in DownEncoderBlock2D. This PR fixes this by passing downsample_padding=0 in get_down_block in the Encoder.

This issue was not caught in tests as the dummy models in test uses only one up/down sampling block, and the VAE models don't add the Up/Down sampling in the last block which in this case is the first block.
@anton-l @patrickvonplaten Let's make sure to add at least two blocks when creating dummy models for tests.

@HuggingFaceDocBuilderDev
Copy link

HuggingFaceDocBuilderDev commented Aug 5, 2022

The documentation is not available anymore as the PR was closed or merged.

Copy link
Member

@anton-l anton-l left a comment

Choose a reason for hiding this comment

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

Will do, thanks for finding the bug!

@patil-suraj patil-suraj merged commit a209037 into main Aug 6, 2022
@patil-suraj patil-suraj deleted the fix-vae-encoder branch August 6, 2022 12:06
PhaneeshB pushed a commit to nod-ai/diffusers that referenced this pull request Mar 1, 2023
yoonseokjin pushed a commit to yoonseokjin/diffusers that referenced this pull request Dec 25, 2023
* pass downsample_padding in encoder

* update tests
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