Implement JavaScript aspect ratios (#25)

* Implement JavaScript aspect ratios

- Add options to enable and specify JavaScript aspect ratios
- Add JavaScript to load when enabled, which adds dropdown & functionality
- Update docs for JavaScript aspect ratios
- Add video to README.md for JavaScript aspect ratios
- Update options image on README.md
This commit is contained in:
thomas
2023-03-24 00:58:00 +00:00
committed by GitHub
parent d602ddf3bf
commit be365af8f9
7 changed files with 332 additions and 5 deletions

View File

@@ -6,6 +6,18 @@ Install via the extensions tab on the [AUTOMATIC1111 webui](https://github.com/A
## Features
- JavaScript aspect ratio controls
- Adds a dropdown of configurable aspect ratios, to which the dimensions will auto-scale
- When selected, you will only be able to modify the higher dimension
- The smaller or equivalent dimension will scale accordingly
- If "Lock/🔒" is selected, the aspect ratio of the current dimensions will be kept
- If you click the "Swap/⇅" button, the current dimensions will swap
- Configurable aspect ratios will also flip, reducing the need for duplication of config
https://user-images.githubusercontent.com/22506439/227396634-7a63671a-fd38-419a-b734-a3d26647cc1d.mp4
</br>
- Scale to maximum dimension
- Upon clicking, the width and height will scale according to the configured maximum value
- Aspect ratio will be retained, the smaller or equivalent dimension will be scaled to match
@@ -29,6 +41,9 @@ Install via the extensions tab on the [AUTOMATIC1111 webui](https://github.com/A
- Determines whether the 'Aspect Ratio Helper' accordion expands by default
- UI Component order (`MaxDimensionScaler, PredefinedAspectRatioButtons, PredefinedPercentageButtons`)
- Determines the order in which the UI components will render
- Enable JavaScript aspect ratio controls
- JavaScript aspect ratio buttons `(Off, 🔓, 1:1, 4:3, 16:9, 9:16, 21:9)`
- i.e `Off, 🔓, 1:1, 4:3, 16:9, 9:16, 21:9`, `Off, 🔓, 9:2, 1:3`
- Show maximum dimension button (`True`)
- Maximum dimension default (`1024`)
- Show pre-defined aspect ratio buttons (`True`)
@@ -43,7 +58,7 @@ Install via the extensions tab on the [AUTOMATIC1111 webui](https://github.com/A
- `Raw percentage (50%, 150%)`
- `Multiplication (x0.5, x1.5)`
![settings.png](docs%2Foptions.png)
![settings.png](docs%2Fopts.png)
## Contributing