Nodes//Nougan Resolution Picker
ComfyUI Node

Nougan Resolution Picker

One node for aspect ratios that survive snapping

By Winnougan·Created 3 months ago·Updated about 16 hours ago· 10
Nougan Resolution Picker
    • width
    • height
    • megapixels
    • info
    ◄modeRatio + Megapixels►
    ◄aspect_ratio16:9 (Widescreen)►
    ◄custom_ratio_w16.00►
    ◄custom_ratio_h9.00►
    ◄megapixels1.00►
    ◄preset_resolution1280x720 (HD 720p)►
    ◄snap_presetstrue►
    ◄multiple32►
    ◄swap_orientationfalse►

    Resolution is the setting people get wrong most often and understand least. Not because the numbers are hard, but because three constraints fight each other: the aspect ratio you want, the megapixel count the model was trained at, and the multiple-of-N the VAE and patch size demand. Type a number that ignores the third and you get an off-by-8 latent, a warning, or a subtly broken image.

    Nougan Resolution Picker makes you choose in the terms you actually think in, and does the arithmetic.

    Two ways in

    mode decides which half of the node is live.

    Ratio + Megapixels - pick aspect_ratio from 21 presets (1:1, 5:4, 4:3, 3:2, 16:10, 16:9, 1.85:1 Cinema Flat, 2:1, 2.35:1, 2.39:1, 21:9, 32:9, plus the portrait side). Set megapixels (0.05–16, default 1.0) and the node solves for width and height. If the preset list doesn't have your shape, put whatever you want in custom_ratio_w and custom_ratio_h - decimals work, so 2.39 and 1 is a legitimate input.

    Preset Resolution - 40 fixed WIDTHxHEIGHT entries from 512×512 up through 4K-ish territory, each labelled with its ratio and class (1024x1024 (Square 1MP), 1280x720 (HD 720p), and so on). Pick one and go.

    Either way, multiple (default 32, range 1–256) is the snapping grid, and snap_presets decides whether presets get snapped too or run exactly as listed. swap_orientation flips portrait/landscape without you picking a different ratio - which is the single most-used toggle on this node in practice.

    The 1.0 megapixel convention is 1024×1024, the same one ComfyUI's own ResolutionSelector uses, so "1 MP" means what you expect rather than a decimal megapixel.

    Outputs

    width (INT) and height (INT) - wire them anywhere a size is wanted: Empty Latent Image, Nougan Bounding Boxes 🔲, the width/height of an upscale, a video sampler. megapixels (FLOAT) tells you the real area you ended up with, which is not always the number you asked for once snapping is applied. info (STRING) is the one-line summary - 1344×768 | 16:9 | 1.01 MP style - and it's the cheapest debugging tool in the pack: put a Preview Any on it and you never guess what size you rendered again.

    Why snapping is not a detail

    Diffusion models work on a latent grid; the VAE downscales by 8 (or 16 for the newer 128-channel models), and patch sizes stack on top. A width of 1016 isn't a legal latent width for most architectures, so ComfyUI rounds it behind your back and your carefully computed aspect ratio moves. Multiplying by 32 up front keeps the ratio honest and stops the "why is my 2.39:1 crop slightly off" class of complaint.

    If you're feeding a video model, going to 64 costs you nothing and avoids a family of latent-shape complaints.

    Install

    cd ComfyUI/custom_nodes
    git clone https://github.com/Winnougan/Nougan_Nodes
    # restart ComfyUI
    

    Or ComfyUI Manager → "Nougan". No dependencies, no models - it's arithmetic with a nice face on it. The ratio and preset lists are plain labelled strings parsed for their numbers, which means adding an entry to the Python list is enough to add it to the dropdown and the browser preview both; nothing else needs editing.

    One note on the brief vs the code: the node's source also declares a latent output in some builds, and the pack's own description mentions an empty latent at the chosen size. Check what your version actually exposes before wiring - if you see a latent socket, you can skip the Empty Latent node entirely.

    Where people get burned

    Width/height linked to two different sources. One from a picker, one typed by hand, and now your aspect ratio is a rumour. Link both or type both.

    Megapixels asked vs megapixels got. Snapping changes the area slightly. Read the megapixels output if a workflow is sensitive - some models get moody well past ~1MP at their training resolution.

    Portrait renders coming out landscape. swap_orientation off, or a preset that was already landscape. It's the first thing to check, and it's always the first thing people check last.

    Assuming presets are model-native. 1024x1024 is right for SDXL-class models and some video models; the Flux/Klein 128-channel family and the video models all have their own sweet spots. The picker gives you a legal size, not a recommended one - that part is still on you.

    CategoryNougan

    Inputs (9)

    NameTypeDefaultDescription
    modeCOMBORatio + Megapixels2 options: Ratio + Megapixels, Preset Resolution
    aspect_ratioCOMBO16:9 (Widescreen)21 options: 1:1 (Square), 5:4 (Large Format), 4:3 (Standard), 3:2 (Photo), 16:10 (Laptop), 16:9 (Widescreen), +15
    custom_ratio_wFLOAT16.000.1–100—
    custom_ratio_hFLOAT9.000.1–100—
    megapixelsFLOAT1.000.05–16—
    preset_resolutionCOMBO1280x720 (HD 720p)40 options: 512x512 (Square S), 768x768 (Square M), 1024x1024 (Square 1MP), 1280x1280 (Square L), 1536x1536 (Square XL), 2048x2048 (Square 4MP), +34
    snap_presetsBOOLEANtrue—
    multipleINT321–256—
    swap_orientationBOOLEANfalse—

    Outputs (4)

    NameTypeDescription
    widthINT—
    heightINT—
    megapixelsFLOAT—
    infoSTRING—