Nodes/ComfyUI-UtilsCollection/Resolution Selector Extended
ComfyUI Node

Resolution Selector Extended

Stop doing megapixel math by hand

By silveroxides·Created 2 months ago·Updated about 7 hours ago· 24
Resolution Selector Extended
    • width
    • height
    aspect_ratio1:1 (Square)
    megapixels1.0
    multiple8

    Every model generation these days starts with a resolution decision, and the decision is usually "what aspect ratio, at roughly how many megapixels." UC_ResolutionSelectorExtended turns that sentence into a node: pick an aspect ratio, set a megapixel target, and it hands you exact width and height, rounded to a pixel multiple you choose. One node replaces the fixed-resolution dropdown lists that every pack used to ship and that always seem to be missing the one size you need.

    How it works

    Three inputs. aspect_ratio is a combo of eleven presets - 1:1 (Square), photo (3:2), standard (4:3), canvas (5:4), widescreen (16:9), ultrawide (21:9), panorama (3:1), and their portrait mirrors - so the arithmetic is handled for you. megapixels (default 1.0, range 0.1–16) is the area you're aiming for; 1.0 MP is about 1024×1024 square. multiple (default 8, range 8–128 in steps of 4) rounds the result so the dimensions stay divisible by the number you feed it. Outputs are width and height as INTs.

    The rounding matters more than it looks. ComfyUI latents want dimensions divisible by your VAE's compression factor - 8 covers most modern models, but SDXL-era checkpoints and some video pipelines prefer 16 or higher, and a 1024×1024 canvas at multiple: 16 gives you a clean 1024×1024 while an awkward aspect like 21:9 lands on a sensible 2016×864 instead of 2013.9×862.6. The megapixel framing is also the modern way to think about it: new models are trained at a specific MP and degrade if you push far past it. Set 1.0 MP for Flux/Z-Image-style image models, and 0.5–0.6 MP if you're feeding SD 1.5-era checkpoints that trained smaller - then raise the multiple to whatever your pipeline needs.

    Where it goes

    The classic wiring: convert the width and height widgets on Empty Latent Image to inputs, connect the two INT outputs, and one canvas definition drives your whole workflow. Swap the aspect ratio or megapixels once and every Empty Latent downstream follows. It's also handy for conditioning the resolution of an image-to-image run or a video model's Create Video node, where you want the same framing rules applied consistently.

    Install

    Part of ComfyUI-UtilsCollection:

    cd ComfyUI/custom_nodes
    git clone https://github.com/silveroxides/ComfyUI-UtilsCollection
    

    Restart, or grab it via ComfyUI Manager (search "UtilsCollection"). No models to download; opencv-python and typing-extensions are the pack's only requirements.

    Notes

    Remember the rule of thumb from the KB: don't stretch a model far past its native resolution or you invite artifacts - this node makes it easy to stay at the right MP instead of letting a widescreen preset quietly balloon past your model's training size. And expect the usual pack quirk: UtilsCollection replaces some logic/primitive nodes from other packs, so a "replace node?" prompt on load is normal.

    Categoryutilities

    Inputs (3)

    NameTypeDefaultDescription
    aspect_ratioCOMBO1:1 (Square)The aspect ratio for the output dimensions.
    megapixelsFLOAT1.00.1–16Target total megapixels. 1.0 MP ≈ 1024×1024 for square.
    multipleINT88–128Round the selected resolution to this pixel multiple.

    Outputs (2)

    NameTypeDescription
    widthINTCalculated width in pixels multiplied by the selected multiple.
    heightINTCalculated height in pixels multiplied by the selected multiple.