Nodes/wlsh_nodes/Resolutions by Ratio (WLSH)
ComfyUI Node

Resolutions by Ratio (WLSH)

Aspect ratio and short-side length, out come the pixels

By wallish77·Created 3 years ago·Updated 2 years ago· 144
Resolutions by Ratio (WLSH)
    • width
    • height
    aspect
    direction
    shortside512

    Small honesty upfront, straight from the pack's own README: this node is "possibly deprecated," in the author's own words, now that the pack's latent-generating sibling node (Empty Latent by Ratio) also returns width/height as plain integers. If you're building a fresh graph and just need an empty latent at a given aspect ratio, that sibling node probably does the whole job in one step. This node is what you reach for when you specifically want the resolution as bare integers - no latent attached - because you're feeding those numbers somewhere else: a save filename, a resize target, the width/height fields of an SDXL conditioning node, or a third-party node that just wants two INT inputs and doesn't care about latents at all.

    How it works. You pick an aspect ratio from a list (1:1 up to 4:1, covering the common photo and cinema ratios plus SDXL-typical shapes like 4:3 and 16:9), a direction (landscape or portrait - this is what decides which of the two ratio numbers becomes width versus height), and a shortside value - the length, in pixels, of whichever edge is shorter. The node does the ratio math and hands you back real width and height integers sized so the short edge matches what you asked for and the long edge follows the aspect ratio.

    Inputs and defaults: aspect (pick from the twelve ratios offered), direction (landscape/portrait), shortside (default 512, step 64, up to 8192). Outputs: width, height - both plain INT, ready to wire into anything that wants raw numbers rather than a latent tensor.

    Installing it

    Through ComfyUI Manager: search "wlsh_nodes" (or "WLSH Nodes"), install, restart. Manually: cd ComfyUI/custom_nodes && git clone https://github.com/wallish77/wlsh_nodes, then restart ComfyUI. Nothing else needed.

    Common issues

    Because this node only outputs integers and never touches a latent, the failure mode people actually hit is forgetting that step and wondering why nothing generates - you still need a separate Empty Latent Image node downstream taking these width/height outputs, this node doesn't create one for you. The other thing worth knowing before you build around this node long-term: given the "possibly deprecated" note direct from the pack's own docs, if you're starting a new workflow from scratch it's worth checking whether Empty Latent by Ratio covers your case in one node instead of two - this one's still fully functional, just not necessarily the newest way to get there.

    CategoryWLSH Nodes/number

    Inputs (3)

    NameTypeDefaultDescription
    aspectCOMBO12 options: 1:1, 6:5, 5:4, 4:3, 3:2, 16:10, +6
    directionCOMBO2 options: landscape, portrait
    shortsideINT51264–8192

    Outputs (2)

    NameTypeDescription
    widthINT
    heightINT