Nodes/Smart Aspect Ratio/Smart Resolution
ComfyUI Node

Smart Resolution

A pass-through that keeps video dimensions legal

By dawncreatescode·Created 3 months ago·Updated 3 months ago· 2
Smart Resolution
    • width
    • height
    • ratio
    megapixels1.0
    aspect_ratio1:1 (Perfect Square)
    divisible_by64
    keyword_modeLimited keywords
    randomizefalse
    seed0
    prompt

    Resolution Wan is the most literal node name in the pack: it takes a width and a height, and returns them. The entire feature is that both sliders step by 16, defaulting to 832x480 - the 480p-ish resolution Wan 2.1 was tuned around - so the numbers you hand to a Wan workflow stay in the multiples-of-16 range the model expects. That's it. No calculation, no aspect-ratio presets, no magic.

    Which is why the README is worth flagging, because it's wrong in a way that will confuse you: it describes this node as offering "aspect_ratio" presets (1:1, 16:9, 9:16...) and a "megapixels" target. The shipped code has none of that. It's just width and height INTs with step-16 constraints, wired straight through. The README documented a node that doesn't exist; the code is a pass-through with guardrails. Trust the code.

    What you get

    • width (INT, 16–16384, step 16, default 832)
    • height (INT, 16–16384, step 16, default 480)

    Outputs: width and height INTs, to wire into EmptyLatentImage, a Wan sampler, a latent upscale target, or anywhere else dimensions are inputs.

    How it fits

    In a Wan 2.1/2.2 workflow, resolution hygiene matters: video models are picky about non-16-multiples in ways that show up as errors or silent degradation, and the modidex Wan notes list 480p/720p as the reference outputs with higher resolutions (960x544, 1280x720, up to 1536x864) reserved for beefier GPUs. This node's value is that the slider can't land on an illegal number. The other Wan-ish node in this pack, Image Dimensions (Multiple of 16), covers the same ground and adds the frame-count input (the 81-frame / 4n+1 thing) - so if you're setting up a full Wan graph, that one is the more complete pick, and this one is the minimal fallback.

    Honest take

    A pass-through node that enforces multiples of 16 is handy for a graph you build by hand and reuses often. If you expected aspect-ratio math or megapixel targets based on the README, you'll be disappointed - this isn't a resolution calculator. But as a way to keep your Wan dimensions legal without thinking about it, it does exactly what it says, minus the part the README invented.

    Installation

    Part of Praveen's ComfyUI Tools. Install via ComfyUI Manager (search "Praveen" / "praveen-tools"), or:

    cd ComfyUI/custom_nodes
    git clone https://github.com/Praveenhalder/praveen-tools
    

    Restart ComfyUI. No dependencies beyond stock ComfyUI, no model downloads. Small node, small expectations, one job done.

    CategoryResolution

    Inputs (7)

    NameTypeDefaultDescription
    megapixelsCOMBO1.025 options: 0.1, 0.2, 0.3, 0.4, 0.5, 0.6, +19
    aspect_ratioCOMBO1:1 (Perfect Square)23 options: 1:1 (Perfect Square), 2:3 (Classic Portrait), 3:4 (Standard Portrait), 3:5 (Tall Portrait), 4:5 (Artistic Portrait), 5:7 (Balanced Portrait), +17
    divisible_byCOMBO644 options: 8, 16, 32, 64
    keyword_modeCOMBOLimited keywords4 options: Off, AR only, Limited keywords, All keywords
    randomizeBOOLEANfalse
    seedINT00–18446744073709550000
    promptoptSTRING

    Outputs (3)

    NameTypeDescription
    widthINT
    heightINT
    ratioSTRING