ComfyUI Node Runs on cloud

Aspect Ratio

Pick a ratio, get width and height

By sipherxyz·Created 3 years ago·Updated 4 months ago· 352
Aspect Ratio
    • ratio
    • width
    • height
    aspect_ratio

    You want a portrait image, or a widescreen one, and you don't want to remember that "9:16 at SDXL resolution" is some specific pixel pair. This node fixes that. Pick a ratio from a dropdown - 1:1, 2:3, 3:4, 9:16, 3:2, 4:3, 16:9 - and it hands you the matching width and height as numbers, ready to wire into an Empty Latent. It's a convenience node, not a clever one, but it removes a small, repeated annoyance, which is exactly what convenience nodes are for.

    The value shows up once you're switching orientations a lot. Instead of retyping width and height every time you flip between a portrait and a landscape composition - and occasionally fat-fingering a number that isn't a clean multiple of 64 - you just change one dropdown and the dimensions follow. Fewer chances to accidentally generate at a weird resolution the model wasn't trained for.

    How it works

    Each ratio in the list maps to a preset width and height. Choose one and the node outputs those two integers, plus the ratio as text for labeling. That's the entire mechanism - a lookup from a friendly name to a dimension pair.

    Inputs and outputs

    One input:

    • aspect_ratio - the dropdown, with seven options: 1:1, 2:3, 3:4, 9:16 (the portrait side), 3:2, 4:3, 16:9 (the landscape side). Square in the middle.

    Three outputs:

    • ratio - the chosen ratio as a STRING, useful for filenames or captions.
    • width - the width as an INT, into your Empty Latent's width.
    • height - the height as an INT, into the height.

    Wire width and height into an Empty Latent Image and you've set your canvas from a single dropdown.

    Installing it

    Ships with the ArtVenture pack. ComfyUI Manager: search comfyui-art-venture, install, restart. Or by hand:

    cd ComfyUI/custom_nodes
    git clone https://github.com/sipherxyz/comfyui-art-venture
    

    Restart ComfyUI. No downloads - it's a tiny utility node.

    Common issues

    The dimensions don't suit your model. The presets are fixed pixel pairs, and they suit some base models better than others - a resolution tuned for one architecture may be small or large for another. If your base wants a different native size, this node's presets might not hit it, and you're better off setting width and height directly. Check what resolution your model actually expects.

    You wanted an exact custom size. Then this isn't your node. It only offers the seven listed ratios at their preset dimensions; there's no free-form entry. For an arbitrary resolution, type the numbers into the Empty Latent yourself.

    Portrait came out landscape. Easy mix-up: 9:16 and 3:4 and 2:3 are the tall ones; 16:9, 4:3, 3:2 are the wide ones. If the orientation's flipped, you picked the reciprocal ratio.

    Upscaling later changes the effective ratio. The node sets your starting canvas. If a downstream upscale or crop node resizes non-proportionally, the final aspect can drift from what you selected here - keep upscales proportional if the ratio matters.

    CategoryArtVenture/Utils

    Inputs (1)

    NameTypeDefaultDescription
    aspect_ratioCOMBO7 options: 1:1, 2:3, 3:4, 9:16, 3:2, 4:3, +1

    Outputs (3)

    NameTypeDescription
    ratioSTRING
    widthINT
    heightINT