sd-webui-aspect-ratio-helper
sd-webui-aspect-ratio-helper copied to clipboard
The aspect ratio sliders are broken
The extension breaks the resolution selection. My resolution selectors are limited to 512 and 2560. With this extension I somehow can set it less than 512, but it warps back to 512. And I can't select higher that 2048.
There are no errors in the console log.
How it shouldn't work:
How it should work:
Oh okay, I reckon we should pull the maximum/minimum from the options, and use defaults if undefined:
https://github.com/thomasasfk/sd-webui-aspect-ratio-helper/blob/main/javascript/aspectRatioController.js#L6-L7
const _MAXIMUM_DIMENSION = window.opts['txt2img/Width/maximum'] || 2048;
const _MINIMUM_DIMENSION = window.opts['txt2img/Width/minimum'] || 64;
Should also probably have a txt2img/img2img specific dimensions, rather than shared.
Step should also probably be configurable, since it seems like it's a valid option.
Also need to consider race conditions, as I think window.opts
isn't immediately populated.
Apologies as I've not actually been keeping much up to date on the a1111 changes, but I'll try to implement these changes when I have a chance, open to pull requests if others want to give it a go though.
I can confirm the bug is present on my system also. This line alone does not fix the issue, as the options are not always populated as you just mentioned :
const _MAXIMUM_DIMENSION = window.opts['txt2img/Width/maximum'] || 2048;
As a temporary fix I simply adjusted the line according to my needs :
const _MAXIMUM_DIMENSION = 2560;
Watching this issue for a more permanent fix.
Thanks for your extension !
Can you tell me in which file did u change than line?
Can you tell me in which file did u change than line?
Sorry, it was just an example to show what the eventual code may look like. I don't know if that line would just work. I've not found the time to implement this, but anyone else is free to give it ago, there is only 1 js file in the repo!