SDXL Aspect Ratio
SDXLAspectRatioSelector — pick an aspect ratio, get SDXL-friendly width and height
- ratio
- width
- height
Choose "16:9" from a dropdown and get back the exact width and height SDXL wants for that shape. That's the entire job, and it exists because SDXL is fussier about resolution than SD 1.5 was. SDXL was trained on a specific set of ~1-megapixel buckets - 1024×1024, 1152×896, 1216×832, 896×1152, and so on - and it looks best when you generate at one of them. Pick an off-book size and you're more likely to get bad composition or duplicated subjects. This node just hands you the right numbers so you don't have to memorize the bucket table.
Drop it in front of your Empty Latent Image, wire width and height across, and switch aspect ratios from one clean dropdown instead of typing dimensions and hoping they're SDXL-legal. Small node, saves you a reference tab.
How it works
It's a lookup table. Each aspect_ratio option maps to a hand-picked width/height pair that sits near 1MP and matches an SDXL training bucket. Select the ratio, and the node outputs the corresponding numbers plus the ratio string itself.
The inputs and outputs that matter
aspect_ratio- a dropdown of common ratios:1:1,2:3,3:4,5:8,9:16,9:19,9:21,3:2,4:3,8:5,16:9,19:9, and one more. Portrait ratios (thex:ywhere the second number's bigger) come first, landscape after. Pick the shape you want the image to be.
Outputs:
widthandheight(INT) - wire straight into an Empty Latent Image (or wherever you set generation size).ratio(STRING) - the ratio label as text, handy for filenames or captions so your output records what shape it was.
How to install it
Part of the Art Venture pack. ComfyUI Manager → search comfyui-art-venture → Install → restart. Manually:
cd ComfyUI/custom_nodes
git clone https://github.com/sipherxyz/comfyui-art-venture
then pip install -r comfyui-art-venture/requirements.txt and restart. No model download.
Common issues & troubleshooting
These are SDXL numbers - don't use them raw on SD 1.5. SD 1.5 was trained around 512px, so an SDXL 1024-class resolution will often give it repeated heads and mangled composition. If you're on 1.5, halve these or use a 512-based selector. For SDXL, Flux, and other ~1MP models, they're spot on.
My generation still looks stretched or duplicated. Two things to check: that you actually wired width/height into the latent (not left the latent at its default), and that your model matches - these buckets are for SDXL-scale models. A ControlNet or img2img input at a different aspect will also fight the target; match your input's shape to the ratio you picked.
I want a ratio that's not in the list. Then this isn't your node - it's a fixed menu of SDXL buckets by design. For arbitrary sizing, set width/height directly, or use ImageScaleToMegapixels to hit a pixel budget at any aspect ratio.
Node missing after a workflow import. The pack isn't installed - Manager → Install Missing Custom Nodes.
Inputs (1)
| Name | Type | Default | Description |
|---|---|---|---|
| aspect_ratio | COMBO | 13 options: 1:1, 2:3, 3:4, 5:8, 9:16, 9:19, +7 |
Outputs (3)
| Name | Type | Description |
|---|---|---|
| ratio | STRING | — |
| width | INT | — |
| height | INT | — |