ComfyUI Node

Int Wan

A Wan-flavored integer node — the 4n+1 frame-count nudge

By 1hew·Created about a year ago·Updated 7 days ago· 33
Int Wan
    • int
    value1

    Let's be upfront about this one: it's the thinnest node in this batch. Int Wan is a single integer input wired to a single integer output, and its whole personality is the step size on the widget - step=4 - because it's aimed at Wan video frame counts.

    Here's why that step matters. Wan's temporal VAE doesn't like arbitrary frame counts; the video length you feed it needs to land on a 4n+1 value - 1, 5, 9, 13, ... 81, 161, 165. (The community shorthand for this is "4n+1," and you'll see pack authors like ComfyUI-AV-Handles building rounding for it in explicitly.) Feed Wan 80 frames and you get an error or a crop; feed it 81 and it works. That off-by-one pattern catches everyone the first time they hit Wan video.

    So Int Wan is basically a labeled, typed integer widget that nudges you toward that rhythm: you can't set its value to anything - it just passes whatever integer you dial through to the int output, but the step-of-4 slider makes it natural to land on 5, 9, 13... and the Wan name in the title is a constant reminder of which numbers are valid. It's convention-as-UI.

    How it works

    Mechanically: value in, int out, no transformation. The node's own schema is just io.Int.Input("value", step=4)io.Int.Output("int"). You could replace it with a stock INT widget in a pinch and lose nothing functional. What you lose is the hint. If you're building a Wan 2.x video workflow and you need a frame-count knob feeding into your sampler's length input, this node keeps that wire labeled, typed, and aimed at the right number line.

    It's honest about being a utility, and the pack positions it in its integer nodes group alongside the more capable Int Split and Int Image Size. If you need sequences of Wan-valid lengths rather than a single value - like stepping 81, 85, 89 for a comparison grid - the pack's List Custom Int with a 81-161:4 range is the better tool for that job, and it'll happily produce values that satisfy 4n+1 when you start from one.

    Installing it

    It's part of 1hewNodes. ComfyUI Manager → search "ComfyUI 1hewNodes" → install → restart, or:

    cd ComfyUI/custom_nodes
    git clone https://github.com/1hew/ComfyUI-1hewNodes
    

    Restart ComfyUI. No dependencies beyond torch, no model downloads.

    Common issues

    The only real "gotcha" is expectation management: it won't round your input to a valid 4n+1 value for you. Type 80 and you get 80 - it's a hint, not a validator. If you want automatic correction, you'd need a math step after it (or the frame-count-aware plumbing some video node packs ship). And don't confuse it with the pack's old changelog description of generating 4n+1 sequences - the current version is the simple passthrough. Set it, use it, and let the step size do its quiet work.

    Category1hewNodes/int

    Inputs (1)

    NameTypeDefaultDescription
    valueINT11–10000

    Outputs (1)

    NameTypeDescription
    intINT