Files
sd-webui-aspect-ratio-helper/README.md
2023-03-20 21:45:47 +00:00

1.7 KiB

Aspect Ratio Helper pytest

Simple extension to easily maintain aspect ratio while changing dimensions.

Install via the extensions tab on the AUTOMATIC1111 webui.

Main features:

  • Scale to maximum width or height
    • Upon clicking, the dimensions will scale according to the configured maximum value
    • Aspect ratio will be retained, the smaller or equivalent dimension will be scaled to match
  • Scale by percentage
    • Upon clicking, the current dimensions will be multiplied by the given percentage, with aspect ratio maintained
    • i.e 150% of 512x512 = 768x768 75% of 512x256 = 384x192 etc.

user-interface.png

Settings:

  • Expand by default
    • Determines whether the 'Aspect Ratio Helper' accordion expands by default
  • Show maximum width or height button
  • Maximum width or height default
  • Show predefined percentage buttons
  • Predefined percentage buttons
    • Comma separated list of percentages
    • i.e 25, 50, 75, 125, 150, 175, 200 50, 125, 300 etc.
  • Predefined percentage display format

settings.png

Contributing:

  • Open to suggestions
  • Pull requests are appreciated
  • Write tests if possible and useful
  • Run pre-commit

Dependencies:

Developed using existing AUTOMATIC1111 webui dependencies.

However - for running unit tests, we use pytest:

pip install pytest

Testing:

From the root of the repository run:

pytest