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

Fix zero height buckets #1008

Merged
merged 1 commit into from
Dec 20, 2023
Merged

Fix zero height buckets #1008

merged 1 commit into from
Dec 20, 2023

Conversation

Cauldrath
Copy link
Contributor

If max_size is too large relative to max_reso, it will calculate a height of zero for some buckets. This causes a crash later when it divides the width by the height.

This change also simplifies some math and consolidates the redundant "size" variable into "width".

If max_size is too large relative to max_reso, it will calculate a height of zero for some buckets.
This causes a crash later when it divides the width by the height.

This change also simplifies some math and consolidates the redundant "size" variable into "width".
@kohya-ss
Copy link
Owner

Thank you for this! This is really nice.

I found another bug that the bucket size becomes less than min_bucket_reso in my code. I will fix it after merging.

@kohya-ss kohya-ss merged commit 1519e30 into kohya-ss:dev Dec 20, 2023
1 check passed
kohya-ss added a commit that referenced this pull request Dec 20, 2023
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.

2 participants