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

improve hires fix efficiency; fix: better SDXL hires fix default implementation; fix: cascade bug #287

Merged
merged 12 commits into from
Jul 21, 2024

Conversation

tazlin
Copy link
Member

@tazlin tazlin commented Jul 21, 2024

  • fix: resolve bug with cascade steps not applying correctly
  • fix: better SDXL hires + calc steps more effectively
    • Hires fix now (generally speaking) does the following by default:
      • Uses fewer steps when 'hires_fix_denoise_strength' is around 0.65 and the target resolution is not too far from the baseline resolution.
        • This is consistent with a very low drop in quality for 'average' settings while on average using far fewer (1/3-1/2) of the hires res second pass steps ('upscale steps').
      • Uses slightly fewer or about the same steps when 'hires_fix_denoise_strength' is around 0.65 and the target resolution is much higher (in terms of width*hieght) from the baseline resolution.
        • This is consistent with maintaining the level of quality which is currently status quo with these types of generations. The further the target resolution is from the baseline resolution ultimately requires more upscale steps. I suspect this is the key reason @jug-dev originally implemented hires fix in the original way (always using the same requested steps and upscale steps).
      • Uses more steps when hires_fix_denoise_strength is closer to 1.0
        • This is to account for the fact that denoise this high requires many more steps to "resolve" into a coherent image.
      • As hires_fix_denoise_strength approaches 0, uses far fewer steps.
        • Low values tend to converge onto a final result very quickly, rendering many steps moot.
    • Accordingly, these new dynamics are now in play:
      • Upscale steps can never be lower than 6 unless the requested steps are less than 6, in which case upscale steps cannot be lower than that amount.
      • Upscale steps can never exceed the number of requested steps for the job.
    • SDXL hires fix now always picks the closest officially recommended SDXL resolution (by aspect ratio) for the first pass. The second pass will remain the resolution requested by the user.
      • See IDEAL_SDXL_RESOLUTIONS for the resolutions that can be chosen.
  • Several minor tweaks to the pytests for better dev-friendliness and to minimize time lost to long-running test runs that are doomed to fail.

@tazlin tazlin merged commit b35d8bf into main Jul 21, 2024
2 checks passed
@tazlin tazlin deleted the sdxl-hiresfix branch July 21, 2024 11:25
tazlin added a commit that referenced this pull request Jul 21, 2024
fix: improve hires fix efficiency; fix: better SDXL hires fix default implementation; fix: cascade bug (#287)
tazlin added a commit to Haidra-Org/horde-worker-reGen that referenced this pull request Jul 21, 2024
@db0
Copy link
Member

db0 commented Jul 21, 2024

wooo!

tazlin added a commit to Haidra-Org/horde-worker-reGen that referenced this pull request Jul 23, 2024
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