Nodes/koo-nodes-pack/KoO.Resolution Next
ComfyUI Node

KoO.Resolution Next

Plan by Ratio and Max Side Instead of Typing Pixels

By kooailab·Created 15 days ago·Updated 4 days ago· 0
KoO.Resolution Next
    • width
    • height
    • resolution_label
    • latent
    ◄base_width1536►
    ◄base_height864►
    ◄ratio16:9►
    ◄max_side2048►
    ◄max_side_lockfalse►
    ◄scalex1►
    ◄latent_modeStandard SD / SDXL►
    ◄batch_size1►

    Here's the workflow problem KoO.Resolution Next solves. You want a 16:9 image, and the answer is not 1024×576 - too few pixels for a modern model. You want the largest 16:9 that fits under some sensible ceiling, and you want to not do that arithmetic again the next time you change the ceiling. So instead of asking you for width and height, this node asks for a base size, a ratio, and a max side, and works out the rest.

    Same four outputs as its older sibling - width, height, resolution_label, latent - but organised around intent rather than numbers.

    How it decides

    Two modes, controlled by max_side_lock:

    Unlocked (the default). base_width and base_height (1536×864 by default) are clamped to multiples of 8 and used directly. ratio and max_side are effectively decoration - you're typing the dimensions you want and the node is just sanitizing them. scale at x2 doubles the pair.

    Locked. Now the ratio actually drives everything. The node takes the ratio's canonical pair (16:9 → 1536×864, 9:16 → 864×1536, 4:3 → 1152×864, 21:9 → 1344×576, 4:5 → 1024×1280, and 1:1 → 1024×1024), fits it to max_side, snaps the short edge to a multiple of 8, and clamps the result. Change max_side from 2048 to 1536 and your landscape output shrinks proportionally with no manual maths.

    Which one you want: unlocked when a specific resolution matters (matching a source crop, hitting a model's trained size), locked when you're exploring and want "16:9, as big as fits."

    The latent builder, and why it matters more than the numbers

    latent_mode decides what tensor you get:

    • Resolution Only - no real latent, just the arithmetic.
    • Standard SD / SDXL - 4 channels on a /8 grid.
    • SD3 / Flux 1 / Qwen - 16 channels on /8.
    • Flux 2 - also 16 channels, /8.

    Note the last one against the pack's older KoO.Resolution, which builds Flux 2 latents at 128 channels on a /16 grid. The two nodes disagree about what a Flux 2 latent looks like. If you're building a Flux 2 workflow, verify the tensor shape your model actually wants rather than trusting either label blindly - a 16-channel latent handed to a 128-channel VAE produces noise or an outright shape error, and a 128-channel latent in a pipeline built for 16 is the same problem inverted.

    Everything is created as torch.zeros on ComfyUI's intermediate device, which is what the core Empty Latent node does too. There's no noise in an empty latent; the sampler adds it.

    The other output worth wiring is resolution_label - 2048 x 1152 | 16:9 | 2.36 MP | Batch 1. For batch runs, that string in a filename prefix is the difference between knowing what you generated and guessing.

    Inputs at a glance

    base_width / base_height (step 8, min 8), ratio (nine ratios plus Custom), max_side (default 2048), max_side_lock (boolean, off), scale (x1 / x2), latent_mode, batch_size. That's eight widgets, of which you'll touch three once you've settled on a setup.

    A practical pairing inside the pack: crop an input with KoO.Load Image & Crop, feed its cropped_width/cropped_height into base_width/base_height, and use max_side_lock when you'd rather the ratio from the crop win than some arbitrary ceiling. The numbers fan out from one authoritative source instead of being retyped.

    Installing it

    cd ComfyUI/custom_nodes
    git clone https://github.com/kevintronchin-blip/koo-nodes-pack
    

    Restart ComfyUI, refresh the browser - the node has a frontend control panel. No models, nothing to pip install beyond ComfyUI's own torch/numpy/Pillow/aiohttp. Category KoO Tools / Resolution.

    Custom canvas elements in this pack want the Legacy / LiteGraph renderer; Nodes 2.0 skips them. Registry/Manager availability at v1.0.3 depends on moderation approval - the README's supported install is the source ZIP as ComfyUI/custom_nodes/koo-nodes-pack, __init__.py directly inside.

    Where it bites

    "The ratio dropdown does nothing." max_side_lock is off, so base_width/base_height are being used verbatim. Turn the lock on if you want the ratio to drive.

    Odd dimensions at x2. Everything is snapped to multiples of 8 and clamped to 16384, so a x2 of a large base can clamp unexpectedly. Check resolution_label after changing the scale instead of trusting the mental arithmetic.

    Wrong latent mode, wrong colours. The single most common failure with any resolution node in this pack. Match the mode to the model family; don't leave the default on out of habit.

    CategoryKoO Tools / Resolution

    Inputs (8)

    NameTypeDefaultDescription
    base_widthINT15368–16384—
    base_heightINT8648–16384—
    ratioCOMBO16:910 options: 1:1, 16:9, 9:16, 4:3, 3:4, 3:2, +4
    max_sideINT20488–16384—
    max_side_lockBOOLEANfalse—
    scaleCOMBOx12 options: x1, x2
    latent_modeCOMBOStandard SD / SDXL4 options: Resolution Only, Standard SD / SDXL, SD3 / Flux 1 / Qwen, Flux 2
    batch_sizeINT11–4096—

    Outputs (4)

    NameTypeDescription
    widthINT—
    heightINT—
    resolution_labelSTRING—
    latentLATENT—