Nodes/ComfyUI UX Nodes/Easy Resolution Picker
ComfyUI Node

Easy Resolution Picker

Pick an aspect ratio, get a model-safe width and height

By Anibaaal·Created 2 years ago·Updated 2 years ago· 2
Easy Resolution Picker
    • width
    • height
    • resolution_string
    aspect_ratio16:9 (HD)
    custom_aspect_ratio
    orientationHorizontal
    length_typeLong Side
    side_length1024
    other_side0
    divisible_by2
    megapixels1.05
    use_megapixelsfalse

    Most people set width and height by half-remembering "1024 is safe" and typing numbers until the aspect ratio looks roughly right. That's not a knock - ComfyUI gives you two plain integer fields and expects you to know the rest. Easy Resolution Picker replaces the guesswork: pick an aspect ratio by name, tell it how big you want one side (or one total megapixel budget), and it hands you back a width and height that actually match.

    This matters more than it sounds like it should. Feeding a model a wildly off-ratio canvas is a well-documented cause of stretched anatomy and warped compositions - the model was trained on a distribution of aspect ratios and resolutions, and straying far outside it degrades quality in ways that are easy to blame on the prompt when the real cause is the canvas shape.

    How it works

    Pick aspect_ratio from a named list - thirteen options covering everything from 1:1 (Square) to cinematic ratios like 21:9 and 2.39:1 (Anamorphic), plus a custom slot via custom_aspect_ratio if none of the presets fit. orientation flips your choice horizontal or vertical. Then you choose how to size it: length_type plus side_length pins either the long or short side to a specific pixel count and solves the other side from the ratio, or you flip use_megapixels on and let megapixels target a total pixel budget instead - useful for keeping compute and VRAM roughly consistent across different aspect ratios, rather than letting an ultra-wide ratio balloon to some enormous side length. divisible_by rounds the final numbers to a safe multiple - latent-space VAEs downsample by a fixed factor, and dimensions that aren't multiples of it are a classic source of shape errors or quiet cropping further down the graph.

    The inputs and outputs that matter

    • aspect_ratio / custom_aspect_ratio - the shape you want.
    • orientation - horizontal or vertical.
    • side_length (with length_type) or megapixels (with use_megapixels toggled on) - how big.
    • divisible_by - default 2; bump it to 8 or 64 if you're seeing shape errors downstream.
    • other_side - defaults to 0, which reads as "let the ratio math compute it" - leave it there unless you specifically need to override the computed value.
    • Outputs: width, height as integers, plus resolution_string - a formatted text version you can drop straight into a filename or metadata field instead of wiring width/height through a string-format node yourself.

    How to install it

    One of six nodes in ComfyUI UX Nodes, a side-project pack from Reddit user Anibaaal - known there mainly for a well-liked Flux realism LoRA, not for node development. The README is a bare six-item list with no install instructions, so the standard path applies: through ComfyUI Manager, search ComfyUI UX Nodes, install, restart; or manually:

    cd ComfyUI/custom_nodes
    git clone https://github.com/Anibaaal/ComfyUI-UX-Nodes
    

    then restart. It's pure arithmetic - no models, no extra dependencies.

    Common issues & troubleshooting

    Blindly trusting the megapixel mode on an older checkpoint. Newer models tend to tolerate any resolution inside a rough megapixel band, but older SDXL-era checkpoints were trained on a fixed list of resolution buckets (1024×1024, 1152×896, 1216×832, 1344×768, 1536×640, and their rotations). If you're on one of those, match an actual trained bucket instead of trusting the ratio math to land somewhere the model has actually seen.

    Shape errors even though the numbers look reasonable. divisible_by defaults to 2, which is the bare minimum - plenty of samplers and tiling nodes want a multiple of 8 or 64 to behave. If something downstream complains about tensor shape, that's the first field to raise.

    Custom ratio not applying. custom_aspect_ratio only matters when aspect_ratio is set to the custom option in the list - leaving a value in that field while a named preset is selected elsewhere won't do anything.

    CategoryUX Nodes

    Inputs (9)

    NameTypeDefaultDescription
    aspect_ratioCOMBO16:9 (HD)13 options: 1:1 (Square), 5:4 (Standard), 4:3 (Standard), 3:2 (Classic), 16:10 (Widescreen), 7:4 (IMAX), +7
    custom_aspect_ratioSTRING
    orientationCOMBOHorizontal2 options: Horizontal, Vertical
    length_typeCOMBOLong Side2 options: Long Side, Short Side
    side_lengthINT1024
    other_sideINT0
    divisible_byINT2
    megapixelsFLOAT1.05
    use_megapixelsoptBOOLEANfalse

    Outputs (3)

    NameTypeDescription
    widthINT
    heightINT
    resolution_stringSTRING