Nodes/ComfyUI-Desert-Pixel-Nodes/DP Aspect Ratio Picker
ComfyUI Node

DP Aspect Ratio Picker

A dropdown of good resolutions, two int outputs

By DesertPixelAi·Created 2 years ago·Updated about a year ago· 25
DP Aspect Ratio Picker
  • custom_settings
  • width
  • height
aspect_ratio

Stop typing width and height by hand and stop guessing which dimensions your model was trained on. This node is a dropdown of 26 sensible, pre-baked resolutions - square, portrait, landscape, 16:9, the usual gen-ready sizes - and it outputs the two integers you feed straight into an Empty Latent Image. Small node, real friction removed.

It's a utility from DesertPixelAi's Desert Pixel pack, in the same spirit as the pack's other little "pick a value cleanly" helpers.

How it works

There's essentially one control, aspect_ratio, and it's a menu of labeled presets: 1024x1024 1:1 square, 768x1024, 1024x768, 1280x768 5:3 gen3Ready landscape, 1152x864 4:3 landscape, 1600x900 16:9 landscape, and twenty more covering portrait/landscape pairs and the common SD, SDXL, and video-gen sizes. Pick one and the node parses the label into numbers.

The two outputs are width and height (both INT). Wire them into an Empty Latent Image's width and height, and your canvas is set to a resolution the model actually likes. The labels are the value here - they encode which sizes are "gen3Ready" (i.e. friendly to modern video/image gen), so you're not accidentally asking SDXL for 900×900 and getting mush.

There's also an optional custom_settings input for feeding in your own ratio configuration if the 26 presets aren't enough, but for most people the dropdown is the whole story.

The input that matters

Just aspect_ratio. Choosing the right one matters more than it looks: SDXL wants ~1 megapixel (1024×1024 and its portrait/landscape siblings), SD 1.5 is happiest near 512–768, and going far off a model's training resolution is a classic cause of duplicated heads and stretched bodies. Pick the preset that matches your model's era and you sidestep that whole class of problem.

The presets aren't arbitrary, either - SDXL was trained on a set of "bucket" resolutions (the 1024×1024, 1152×896, 1216×832 family), and several of the labeled options here line up with those buckets. Staying on a native bucket size is the cheapest quality win there is, and having them in a dropdown means you don't have to memorize the list or recompute the numbers every time you change orientation.

How to install it

ComfyUI Manager: search Desert Pixel, install, restart. Manual:

cd ComfyUI/custom_nodes
git clone https://github.com/DesertPixelAi/ComfyUI-Desert-Pixel-Nodes

Restart ComfyUI. No downloads. Under the DP category.

Common issues & troubleshooting

Bodies stretch or subjects duplicate. That's usually a resolution mismatch, not the picker's fault. If you're on SD 1.5, don't pick a giant SDXL size; if you're on SDXL, don't pick a tiny 512 one. Match the preset to your model.

The outputs go to the wrong slots. width and height come out in that order - double-check you didn't cross them into height/width on the Empty Latent, which silently rotates your whole composition.

You need a size that isn't listed. The 26 presets don't cover everything. Either use the optional custom_settings input, or just drop in a plain integer/primitive node for the odd dimension - this node is a convenience, not a requirement.

CategoryDP/Utils

Inputs (2)

NameTypeDefaultDescription
aspect_ratioCOMBO26 options: 1024x1024 1:1 square, 768x768 1:1 square, 512x512 1:1 square, 768x1024, 1024x768, 1280x768 5:3 gen3Ready landscape, +20
custom_settingsoptCUSTOM_SETTINGS

Outputs (2)

NameTypeDescription
widthINT
heightINT