Fixed BUG -- sd-webui-aspect-ratio-helper -- Inaccurate aspect ratio calculations #17001
ghostNic8
started this conversation in
Show and tell
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
I refactored the javascript aspect ratio helper for webUI because it was bothering me that when selecting sizes above smaller values like 512 and above the aspect ratio was inaccurate.
I found that the aspect ratio was being recalculated while resizing between fields a couple times. This redundancy caused the miscalculation of accurate aspect ratio when being passed through the clamp to 8-bit calculation in clampToBoundaries function.
Here's a list of changes I made. I also annotated my changes to the areas I changed. It works pretty much flawlessly now, for now:
aspectRatioController.zip
I've attached my updated javascript. I hope it's useful to others.
Beta Was this translation helpful? Give feedback.
All reactions