Nodes/ComfyUI-SA-Nodes-QQ/Wan Frames (QQ)
ComfyUI Node

Wan Frames (QQ)

The one-widget frame counter Wan's VAE demands

By siraxe·Created 11 months ago·Updated 2 days ago· 72
Wan Frames (QQ)
    • frame_count
    frames5

    Wan's 3D causal VAE compresses time by a factor of four, which means your frame count needs to land on 4n + 1 - 81, 121, 161, and so on - or you'll get latent shapes that make no sense and a sampler that either errors or silently produces a shorter clip than you asked for. WanFrames is a one-widget helper that makes this impossible to get wrong: you type the frames you want, it steps by 4 to keep you honest, and it hands the count to your sampler.

    It ships in siraxe/ComfyUI-WanVideoWrapper_QQ, the "(QQ)" Wan pack. Is it the most intellectually thrilling node in the world? No. It's a rounding fixture with a tooltip - but it's exactly the kind of tiny, boring node that stops you from tripping over a VAE constraint at 11pm.

    How it works

    Honestly? It's a passthrough. You give it an INT, it returns that same INT as frame_count. The real behavior is in the widget definition: frames is constrained to the 5–1000 range and steps by 4, so the value you can physically enter is always a multiple of 4 plus 1 (the "4n + 1" in the tooltip). The DESCRIPTION in the code says it "calculates frame count as input + 1" - a slight mismatch with the actual implementation, which just echoes the input - but the intent is the same: keep your frame count VAE-safe. The only real output is a clean frame_count INT you can wire into a latent/empty-latent node or a length-aware sampler so the whole graph agrees on how long the clip is.

    There's zero computation and zero model loading. If you know what 4n + 1 means and can count by fours yourself, this node is redundant - but that's true of a lot of good UI helpers. It's the pack author making the constraint visible in the graph instead of letting it bite you in the sampler.

    What you set

    • frames - your target count. The widget enforces the right shape; pick the nearest 4n + 1 to your target duration.

    Output: frame_count (INT).

    Installation

    cd ComfyUI/custom_nodes
    git clone https://github.com/siraxe/ComfyUI-WanVideoWrapper_QQ.git
    

    Restart ComfyUI (or ComfyUI Manager → "WanVideoWrapper_QQ"). No dependencies at all - the pack's requirements.txt is empty and this node touches nothing but an integer. If you're upgrading from before the v1.3.4 rename to ComfyUI-SA-Nodes-QQ, delete any old wanwrapper_qq folder to avoid duplicate-node warnings.

    Common issues

    There is almost nothing to break here, which is the point. The one thing to watch: because the widget enforces the 4n+1 step, you can't just type 100 and expect 100 out - the dropdown will nudge you to 101 (or wherever the step lands). That's the feature working as intended, not a bug. If you see a workflow with a manually-typed odd frame count and want a second opinion on whether it's VAE-safe, this node is the reference to check against.

    CategoryWanVideoWrapper_QQ

    Inputs (1)

    NameTypeDefaultDescription
    framesINT55–1000Number of frames, 4 * n + 1

    Outputs (1)

    NameTypeDescription
    frame_countINT