Aspect Ratio (VixUI)
Pick '3:4' and get width, height and the ratio string, all at once
- ratio
- width
- height
VixUiAspectRatioSelector is the cleanest example of what the whole VixUI family is about. It's a dropdown of fourteen common image aspect ratios - 1:1 (1024x1024), 2:3 (832x1216), 16:9 (1344x768), all the way to 21:9 (1536x640) - and it hands you three outputs in one go: the ratio string, the width and the height. Wire width and height into an EmptyLatentImage (or EmptySD3LatentImage for Flux) and your generation size follows the dropdown. That's the whole workflow.
In the Visionatrix context it doubles as a UI control - a Visionatrix user picks "3:4 portrait" from a dropdown instead of you hardcoding a latent size. But unlike most of the VixUI nodes, this one earns its keep even in plain ComfyUI, because it replaces the fiddly two-number job of typing a width and a height whenever you change aspect ratio.
Inputs
- aspect_ratio - the dropdown. Fourteen presets covering landscape, portrait and square, all sized for common SDXL/Flux latent dimensions (multiples of 64, so no rounding surprises).
- display_name (default
"Aspect Ratio"), optional, advanced, order (default20), custom_id (default"aspect_ratio") - the usual VixUI control metadata. In plain ComfyUI only the dropdown matters.
hidden is the only optional input.
Outputs
- ratio (STRING) - e.g.
"3:4". Handy if a downstream node wants the ratio as text for conditioning or naming. - width (INT) and height (INT) - the pixel dimensions. width and height go into an EmptyLatentImage / EmptySD3LatentImage node, and the ratio string can feed a
Show Textor a filename token.
How it works
The dropdown entries are literally stored as "3:4 (1152x896)" strings; the node splits on the parenthesis, parses the two numbers, and returns all three. Zero computation, zero chance of a mismatch between the label and the numbers - the source is one short method.
Install
cd ComfyUI/custom_nodes
git clone https://github.com/Visionatrix/ComfyUI-Visionatrix
Restart ComfyUI, or install ComfyUI-Visionatrix via ComfyUI Manager. No model downloads; only the standard torch/pillow/numpy deps, all pre-installed.
Where it falls short
The honest limitation: the presets are fixed, and they're SDXL/Flux-shaped. If you work at unusual resolutions or a model wants exact native sizes (some video models do), you'll still reach for a manual EmptyLatentImage. And the list is portrait-first - 1:1, 2:3, 3:4, 5:8, 9:16, 9:19, 9:21 - then landscape mirrored after. Fine for most work, mildly annoying if your default is ultrawide. But for the common case of "let the user pick the shape," it's the node I'd grab, because one dropdown replacing two number fields is the exact right trade.
Inputs (7)
| Name | Type | Default | Description |
|---|---|---|---|
| aspect_ratio | COMBO | 14 options: 1:1 (1024x1024), 2:3 (832x1216), 3:4 (896x1152), 5:8 (768x1216), 9:16 (768x1344), 9:19 (704x1472), +8 | |
| display_name | STRING | Aspect Ratio | — |
| optional | BOOLEAN | true | — |
| advanced | BOOLEAN | true | — |
| order | INT | 20 | — |
| custom_id | STRING | aspect_ratio | — |
| hiddenopt | BOOLEAN | false | — |
Outputs (3)
| Name | Type | Description |
|---|---|---|
| ratio | STRING | — |
| width | INT | — |
| height | INT | — |