Nodes/ComfyUI Sahib Nodes/Choose Resolution
ComfyUI Node

Choose Resolution

Pick the right Wan 2.2 or Qwen Image resolution without doing the math

By sahibalejandro·Created 10 months ago·Updated 10 months ago· 0
Choose Resolution
    • width
    • height
    model
    resolution
    invert
    use_custom
    custom_width1024
    custom_height1024

    Choose Resolution is the boring node you reach for when you're tired of guessing. Every model was trained at a native resolution, and feeding it something off that band is the classic way to get stretched limbs, doubled anatomy, or a Wan clip that takes 25 minutes at a size nobody asked for. This node doesn't generate anything - it just hands you the right width and height for the model you're actually running, so you can stop typing 1280x720 from memory and wondering if it was a lie.

    What it actually does

    It's a pure value node, the same plumbing family as the core Primitive nodes: no model loading, no API calls, nothing that touches pixels. Pick your model family and an aspect-ratio bucket, and it outputs two integers - width and height - which you wire into the resolution inputs of whatever latent node your workflow uses (an Empty Latent Image, or the video-latent node in your Wan setup). One source of truth instead of four text boxes.

    Under the hood it's a lookup table, and this is the whole spec:

    | Model | Buckets | |---|---| | Wan 2.2 | (16:9) 832x480, (16:9) 1280x720 | | Qwen Image / Qwen Image Edit | (1:1) 1328x1328, (16:9) 1664x928, (4:3) 1472x1104, (3:2) 1584x1056 |

    That's the entire codebase, more or less. The Wan pair is your standard 480p and 720p video sizes; the Qwen ones all land in the 1.5–1.8MP band that the current Qwen-Image generation handles without degrading (the KB's 2026 rule of thumb: most modern models take any resolution in a megapixel band and fail softly, not catastrophically). Note these are curated buckets, not Qwen's official recommendation table - treat them as "resolutions someone sane picked for you," which is the whole point.

    The inputs that matter

    Most of them are self-explanatory, and two do the real work:

    • model - Wan 2.2 or Qwen Image / Qwen Image Edit. This gates which bucket list you see.
    • resolution - the aspect-ratio bucket from that model's list.
    • invert - swaps width and height. The Wan list is 16:9 only, so this is your portrait-video lever: (16:9) 832x480 inverted becomes 480x832.
    • use_custom - if you toggle this, the presets are ignored and it just outputs custom_width and custom_height (both default to 1024). This is your escape hatch when your target isn't in the list.

    Outputs are just the two INTs, width and height. That's it. Everything else is decoration.

    Installing it

    It's a single-node pack from sahibalejandro/comfyui-sahib-nodes, and it's about the lightest install in ComfyUI: zero Python dependencies (the pyproject.toml dependency list is empty), no model files, no VAE, no text encoder to hunt down. ComfyUI Manager finds it if you search "ComfyUI Sahib Nodes"; manually it's the usual two lines:

    cd ComfyUI/custom_nodes
    git clone https://github.com/sahibalejandro/comfyui-sahib-nodes
    

    Restart ComfyUI and it'll be under the comfyui-sahib-nodes category. No requirements.txt to fight with, no pip install, nothing.

    The honest caveats

    This is a personal utility pack - it started life as a cookiecutter template and ships exactly one real node. So know what you're signing up for. The bucket list is baked into the code, which means: SDXL, Flux, and friends aren't here at all, and if you want a Wan bucket that isn't 16:9, invert only gets you so far. When the list runs out, use_custom is the answer, not a feature request. It's the kind of tiny tool that either slots into your workflow immediately or you move on - but for anyone stringing together a Qwen-Image or Wan 2.2 workflow, having a node that emits native-resolution numbers instead of trusting your eyeballs is a genuinely useful habit.

    Categorycomfyui-sahib-nodes

    Inputs (6)

    NameTypeDefaultDescription
    modelCOMBO2 options: Wan 2.2, Qwen Image / Qwen Image Edit
    resolutionCOMBO6 options: (16:9) 832x480, (16:9) 1280x720, (1:1) 1328x1328, (16:9) 1664x928, (4:3) 1472x1104, (3:2) 1584x1056
    invertBOOLEAN
    use_customBOOLEAN
    custom_widthINT1024
    custom_heightINT1024

    Outputs (2)

    NameTypeDescription
    widthINT
    heightINT