Skip to content

Fix: Don't auto-scale away from SDXL training sizes #8042

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
May 25, 2025

Conversation

dunkeroni
Copy link
Contributor

Summary

This adds a quick check to the bbox auto scaling to leave the values alone when using an SDXL model and the dimensions are one of the standard sizes that SDXL was trained on. Scaling to nearby dimensions that do not play well with the Unet's internal downscaling results in edge artifacts.

All of the override dimensions are within 10% of the ~1MiP target size of the autoscaling code, and skipping the upscale will also avoid compression and reduce the number of saved intermediate images.

Related Issues / Discussions

Previous discussion and suggestion of hard-coding fix:
https://discordapp.com/channels/1020123559063990373/1049495067846524939/1301654971254575175

Recent mention of the bug:
https://discordapp.com/channels/1020123559063990373/1020123559831539744/1375205214839115796

Original investigation about it a year ago (yikes):
https://discordapp.com/channels/1020123559063990373/1240001897814036562

Merge Plan

ready to merge

Checklist

  • The PR has a short but descriptive title, suitable for a changelog
  • Tests added / updated (if applicable)
  • Documentation added / updated (if applicable)
  • Updated What's New copy (if doing a release after this PR)

@github-actions github-actions bot added the frontend PRs that change frontend files label May 24, 2025
Copy link
Collaborator

@psychedelicious psychedelicious left a comment

Choose a reason for hiding this comment

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

Thank you!

@hipsterusername hipsterusername force-pushed the sdxl_scaling_overrides branch from 656c438 to b122203 Compare May 25, 2025 12:13
@hipsterusername hipsterusername enabled auto-merge (rebase) May 25, 2025 12:14
@hipsterusername hipsterusername merged commit ad24c20 into invoke-ai:main May 25, 2025
12 checks passed
@dunkeroni dunkeroni deleted the sdxl_scaling_overrides branch June 8, 2025 18:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
frontend PRs that change frontend files
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants