ComfyUI Node

Get Resolution

A Base Dimension, an Aspect Ratio, and You're Done With the Calculator

By 5agado·Created 12 months ago·Updated 17 days ago· 1
Get Resolution
    • width
    • height
    base_dimension512
    aspect_ratio1.0
    orientationportrait

    You know the feeling: you want a portrait image around 512 on the short side, roughly a 4:3 look, and now you're staring at a calculator deciding whether it's 512×683 or 512×666 or whatever. Get Resolution is the node that takes "base dimension + aspect ratio + orientation" and hands you a clean width and height you can drop straight into an Empty Latent Image.

    How it works

    The logic, straight from the source, is dead simple:

    • Portrait: width = base_dimension, height = width * aspect_ratio
    • Landscape: height = base_dimension, width = height * aspect_ratio

    So with the default base_dimension = 512 and aspect_ratio = 1.0, you get 512×512. Bump the ratio to 1.5 and portrait becomes 512×768, landscape 768×512. No rounding tricks, no divisibility snapping - it's integer cast of the product, and the base dimension widget steps by 32, which keeps you on the multiples most latent spaces like.

    Inputs and output

    • base_dimension (INT, default 512, step 32) - the short-ish side your resolution is built from.
    • aspect_ratio (FLOAT, default 1.0, range 1.0–2.0, step 0.2) - how much longer the long side is.
    • orientation (dropdown: landscape / portrait, default portrait) - which axis is the long one.
    • Outputs: width (INT) and height (INT) - wire these into Empty Latent Image (or Empty SD3 / Empty LTXV latent) width and height.

    Install

    Nothing special - it's the pack's standard install. ComfyUI Manager → "Sagado Nodes for ComfyUI", or:

    cd ComfyUI/custom_nodes
    git clone https://github.com/5agado/ComfyUI-Sagado-Nodes
    pip install -r ComfyUI-Sagado-Nodes/requirements.txt
    

    Restart. No models.

    The honest caveats

    The aspect ratio is capped at 2.0, which covers portrait/landscape up to 2:1 - fine for most posters and phone formats, but you can't type 2.39 for anamorphic widescreen. You can get around that by wiring a FLOAT from a math node into aspect_ratio and ignoring the slider, since the cap is a widget constraint, not a code constraint.

    Second caveat, and it's the real one for modern models: this node does not snap to the divisibility rules your specific checkpoint wants. A 512 base with ratio 1.3 gives 512×665, which is neither a multiple of 8 nor 64 - some models and pipelines will quietly work, others will refuse. It also doesn't know about your model's native resolution, so "base 512" is on you. If you're feeding a Flux or a video model with strict requirements, you'll still be rounding this node's output yourself. For the "I just need a sensible width and height" case, though, it's genuinely convenient.

    CategorySagado-Nodes

    Inputs (3)

    NameTypeDefaultDescription
    base_dimensionINT512
    aspect_ratioFLOAT1.01–2
    orientationCOMBOportrait2 options: landscape, portrait

    Outputs (2)

    NameTypeDescription
    widthINT
    heightINT