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
406 stars 66 forks source link

How I can switch blocked size #52

Closed LLKoder closed 1 year ago

LLKoder commented 1 year ago

By default the extension block one side as we can at screenshot see this is width. It's mean if the height will be changed width will be recalculated.

2023-05-19_13-13

I have question how can I change blocked side if I don't want to change orientation of finally picture?

I.e. I want to set width to 1024 and height must recalculate to ~2300px in this case.

thomasasfk commented 1 year ago

Oh... hmm. So the reason I disabled one of the inputs was to remove the concern of potentially erroneous user input. But I think I see your use case here.

You want to be able to enter the minimum number and have the higher on scale up, as opposed to only being able to enter/modify the higher value, right?

I'll take a look at this on the week-end when I have some time, and see what options we have!

thomasasfk commented 1 year ago

Okay, I've changed how they work now. So you should now be able to input both (neither width or height get blocked anymore).

https://github.com/thomasasfk/sd-webui-aspect-ratio-helper/pull/57

One thing to be considerate of, is in your example, you mentioned:

I want to set width to 1024 and height must recalculate to ~2300px in this case

The maximum dimension is 2048, so your example isn't valid, in this scenario we'd resize to: 1024x2048 as 2300 is above the maximum. 👍

Please let me know if you can think of alternative suggestions or if this isn't a good change, happy to take feedback.

CCpt5 commented 1 year ago

Just an FYI, and I'm sorry I can't elaborate yet w/ a method to reproduce, but I've had it a few times in IMG2IMG where manually setting the image resoluations, then clicking match the AR of the image, and then locking/unlocking/etc leads to a case of the values for Height & Width not being correct.

It wasn't hard to have it happen, but unfortunately I don't have time atm to pin down a way to reproduce. I just wanted to mention that I think this needs to be looked at for a bug.

fdfdfddfd

thomasasfk commented 1 year ago

Just an FYI, and I'm sorry I can't elaborate yet w/ a method to reproduce, but I've had it a few times in IMG2IMG where manually setting the image resoluations, then clicking match the AR of the image, and then locking/unlocking/etc leads to a case of the values for Height & Width not being correct.

It wasn't hard to have it happen, but unfortunately I don't have time atm to pin down a way to reproduce. I just wanted to mention that I think this needs to be looked at for a bug.

fdfdfddfd

Hey - by "match the AR of the image" do you mean the new ruler button? That previously didn't exist, so it could definitely be causing some issues as I never implemented the functionality with that in mind. I'll try to find some time to take a look at it, for now I'd advise not using the ruler button, and instead using the frame/picture option on this extension, as it should do the same theoretically. Thanks again for mentioning.

Please feel free to clarify if I've missed or misinterpreted anything.