Skip to content

Fix incorrect tile_latent_min_width calculation in AutoencoderKLMochi #11294

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 11, 2025

Conversation

kuantuna
Copy link
Contributor

What does this PR do?

This PR fixes an inconsistency in the calculation of tile_latent_min_width inside the AutoencoderKLMochi decoder.

Previously, tile_latent_min_width was incorrectly calculated using self.tile_sample_stride_width:

tile_latent_min_width = self.tile_sample_stride_width // self.spatial_compression_ratio

This led to a mismatch with the corresponding height calculation, which correctly used self.tile_sample_min_height. The corrected line now uses self.tile_sample_min_width.

This discrepancy did not raise errors under default settings (e.g., 848x480 resolution), but could cause incorrect conditional evaluations in edge cases, such as when profiling or testing different resolutions.

Fixes #11291.

Who can review?

@a-r-r-o-w

Copy link
Member

@a-r-r-o-w a-r-r-o-w left a comment

Choose a reason for hiding this comment

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

Awesome, thank you! 🎉

@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.

@kuantuna
Copy link
Contributor Author

Thanks for the review! Let me know if there's anything else needed from my side 🙌

@a-r-r-o-w a-r-r-o-w merged commit bc26105 into huggingface:main Apr 11, 2025
12 checks passed
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.

Inconsistent variable usage in tile_latent_min_width computation in AutoencoderKLMochi decoder
3 participants