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

The aspect ratio sliders are broken #64

Open
Proquror opened this issue Jun 4, 2023 · 4 comments
Open

The aspect ratio sliders are broken #64

Proquror opened this issue Jun 4, 2023 · 4 comments

Comments

@Proquror
Copy link

Proquror commented Jun 4, 2023

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.

image

There are no errors in the console log.

How it shouldn't work:
Q6dvSbS

How it should work:
fea3383f-915d-498a-b995-5963ea5ab963

@thomasasfk
Copy link
Owner

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.

@Danamir
Copy link

Danamir commented Jun 23, 2023

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 !

@Zullian
Copy link

Zullian commented Jun 24, 2023

Can you tell me in which file did u change than line?

@thomasasfk
Copy link
Owner

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!

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

No branches or pull requests

4 participants