thomasasfk / sd-webui-aspect-ratio-helper

Simple extension to easily maintain aspect ratio while changing dimensions. Install via the extensions tab on the AUTOMATIC1111 webui.
https://github.com/thomasasfk/sd-webui-aspect-ratio-helper.git
415 stars 66 forks source link

lock button gone #61

Open alenknight opened 1 year ago

alenknight commented 1 year ago

after recent updates the drop down button ... with the lock ratio and multiple custom ratios seems to be missing completely. Screenshot 2023-06-02 at 12 18 51 PM

search620 commented 1 year ago

also mine the same. help!!! :)

thomasasfk commented 1 year ago

Do you have any error messages in either your a111 logs or your browser console? I don't experience this locally so can't quite debug it, happy to look into it if you can give me more information

alenknight commented 1 year ago

Do you have any error messages in either your a111 logs or your browser console? I don't experience this locally so can't quite debug it, happy to look into it if you can give me more information

no errors unfortunately.... well not in console... how would I check logs?
that reminds me... I could update my other desktop with A1111 and test there when I install it.

thanks for looking at it, and yeah if it's not happening to you makes sense it'd be super hard to troubleshoot :)

thomasasfk commented 1 year ago

Do you have any error messages in either your a111 logs or your browser console? I don't experience this locally so can't quite debug it, happy to look into it if you can give me more information

no errors unfortunately.... well not in console... how would I check logs? that reminds me... I could update my other desktop with A1111 and test there when I install it.

thanks for looking at it, and yeah if it's not happening to you makes sense it'd be super hard to troubleshoot :)

hmm thanks, let me know if you find anything, is there anything unique about your install, like a custom theme or something? not sure how id go about replicating it, i pulled the latest a1111 booted it and it was just working on my end, so assumed nothing was up. maybe its browser issue, are you on chrome/firefox, etc?

alenknight commented 1 year ago

I'm on Edge/safari/chrome... all same. as far as custom... yeah I mean tons of extensions and scripts... so I'll have to try with a new install to see... likely something interfering.... the other menu items all work though...

catboxanon commented 1 year ago

This has been occurring for me on the latest commits of the dev branch for a while now. Did a trace with only this extension enabled, and it looks like it's due to window.opts.arh_javascript_aspect_ratio_show returning undefined here: https://github.com/thomasasfk/sd-webui-aspect-ratio-helper/blob/0bccd48788e08fce844937c997ee7d213570be73/javascript/aspectRatioController.js#L401-L405

So this just needs to wait for opts to load/not return undefined by not immediately disconnecting the observer.

thomasasfk commented 1 year ago

This has been occurring for me on the latest commits of the dev branch for a while now. Did a trace with only this extension enabled, and it looks like it's due to window.opts.arh_javascript_aspect_ratio_show returning undefined here:

https://github.com/thomasasfk/sd-webui-aspect-ratio-helper/blob/0bccd48788e08fce844937c997ee7d213570be73/javascript/aspectRatioController.js#L401-L405

So this just needs to wait for opts to load/not return undefined by not immediately disconnecting the observer.

Oh okay so it's a race condition thing, okay I think adding && window.opts && window.opts.arh_javascript_aspect_ratio_show !== undefined before we disconnect should fix it. Thanks for pointing to this.

thomasasfk commented 1 year ago

I've added this change in https://github.com/thomasasfk/sd-webui-aspect-ratio-helper/pull/63 - can anyone who experiences the issue try again after updating and let me know if it's still there? Not sure how you're replicating the race condition but it doesn't happen for me locally. Theoretically it should be fixed though, which I've tried to replicate.