stable-diffusion-webui icon indicating copy to clipboard operation
stable-diffusion-webui copied to clipboard

Aspect ratio selector

Open Bachine opened this issue 2 years ago • 5 comments

I would like to have a few buttons below the width/height sliders with commonly used aspect ratios (2:3, 3:4,16:9...)

When you click one of the buttons, it will automatically move the sliders to create the desired aspect ratio.

Bachine avatar Sep 15 '22 01:09 Bachine

Are there any news on this front? I just realized (thanks for this unforseen improvements btw) that I can now generate images in way higher resolutions than 1 or 2 weeks ago. My tests went to something like 896 x 896. Especially in img2img it would be nice to be able to use that "extra room" to upscale the quality of the input image - but at the right Ratio.

Rartist avatar Sep 20 '22 21:09 Rartist

I'd also like to have a drop-down box or something with common aspect ratios that upon selection would make width and height sliders auto-adjust on change to preserve that aspect ratio. It would be even better if we could add our own width/height presets to a drop-down so we can quickly set up width and height to something we often use.

Sana-A-E avatar Oct 05 '22 14:10 Sana-A-E

Hi, I would like to implement this enhancement! I think the drop-down can cover more cases than aspect ratio buttons. With the drop down listing 1:1, 2:3, 3:2, 3:4, 4:3, 9:16, 16:9. The aspect ratios will auto-adjust the height relative to the width such that: Width: 896 | Height: X -> Select 4:3 -> Width: 896 | Height: 672.

Any feedback for this initial concept is much appreciated!

azeezada avatar Nov 11 '22 04:11 azeezada

https://github.com/AUTOMATIC1111/stable-diffusion-webui/pull/5682 implements aspect ratio in settings. Let me know if this change is sufficient, reviews and approvals would be appreciated!

azeezada avatar Dec 13 '22 01:12 azeezada

While this is not implemented, you can follow this guide, just select width and height in detailed save, name a preset to your ratio. Then you can use other presets for the other settings, just don't check width and height for those ones. This way you can select a preset for sizes, and another for ...
Add Scripts into additional_components.json, if you want it to automatically swap scripts as well. I can't support every component, as there are name clashes. I have not implemented element id's yet, as I was looking for a better fix, such as having the scripts title sent through kwargs with the components, so I can identify them all without worrying about script writers doing it correctly.

https://github.com/AUTOMATIC1111/stable-diffusion-webui/issues/5922#issuecomment-1363534447

Gerschel avatar Dec 24 '22 07:12 Gerschel

Made an extension for this https://github.com/alemelis/sd-webui-ar enjoy!

alemelis avatar Feb 04 '23 12:02 alemelis

extensions available for this now.

ClashSAN avatar May 01 '23 19:05 ClashSAN