Nodes/DemonAlone-nodes-ComfyUI/ Wan Number of Frames
ComfyUI Node

Wan Number of Frames

A frame-count slider that won't let you pick an invalid length

By DemonAlone·Created 7 months ago·Updated 22 days ago· 3
Wan Number of Frames
    • num_frames
    num_frames49

    Best click-through rate of anything in this whole batch, and it's a genuinely small, purpose-built node - which tells you the pain point it solves is real. Wan-family video models (and video diffusion models generally) don't accept an arbitrary frame count; the temporal VAE compresses frames in fixed chunks, so valid lengths follow a "4n+1" pattern - 1, 5, 9, 13… all the way up to Wan's native 81-frame context and beyond. Type the wrong number into a generic integer widget and you can hand a video pipeline a length it wasn't built to accept.

    What it does

    One input, num_frames, an INT that defaults to 49 and steps in increments of 4 starting from a minimum of 1, up to a generous maximum of 10000. That step-of-4 constraint is the entire feature: it's a plain slider, just pre-shaped so every value it can land on is a valid 4n+1 frame count for a Wan-style pipeline, instead of leaving you to remember the math yourself. The output is just num_frames, an INT - wire it into whatever length or frame-count input your video workflow's sampler or loader expects.

    Installing it

    ComfyUI Manager: search DemonAlone-nodes-ComfyUI, install, restart. Manually:

    cd ComfyUI/custom_nodes
    git clone https://github.com/DemonAlone/SimpeStringGenerator_ComfyUI
    

    No dependencies or model downloads - this is a plain integer widget, nothing more.

    Where people get burned

    The widget technically lets you type up to 10000 frames, but don't read that as "the model supports 10000 frames." Wan's native context is still 81 frames - go meaningfully past that and you're not extending the model's understanding, you're relying on chunking or extension techniques on top of it, and identity drift across those chunk boundaries is a real, documented limitation, not an edge case. If you want a genuinely long continuous clip, you need one of the extension approaches built for that (loop/chunk-and-restitch workflows), not just a bigger number in this slider.

    Frame count and render time scale together, and not gently - a 4070 Ti doing a full 81-frame Wan generation runs somewhere in the 5-6 minute range at full quality, by community reports. Before you crank this up because the slider allows a bigger number, know that you're also proportionally lengthening your render, and that past 81 frames you're leaving the model's native comfort zone regardless of what this node lets you type.

    Categoryutils

    Inputs (1)

    NameTypeDefaultDescription
    num_framesINT491–10000

    Outputs (1)

    NameTypeDescription
    num_framesINT