Nodes/IAMCCS-nodes/IAMCCS Wan-Animate-2 Extend Plan
ComfyUI Node

IAMCCS Wan-Animate-2 Extend Plan

Plan your Wan-Animate-2 chunks without loading the model — the math that always goes stale

By IAMCCS·Created 11 months ago·Updated 4 days ago· 113
IAMCCS Wan-Animate-2 Extend Plan
    • source_frames
    • chunk_count
    • generated_frames
    • chunk_plan
    source_frames161
    chunk_length81

    If you've ever chained Wan-Animate-2 chunks by hand, you know the exact tax this node removes: divide the driving video into 81-frame segments, then manually account for the 4n+1 frame-count requirement and the overlap on the final segment. Get it wrong and the clip comes back a couple of frames short or the tail behaves weirdly. IAMCCS_WanAnimate2ExtendPlan is the "do the arithmetic before you commit GPU time" node: two inputs, four outputs, zero model loading, instant result.

    Why the 4n+1 rule exists

    The Wan VAE compresses time ~4×: N frames become ((N-1)//4)+1 latents and decode back to (latents-1)*4+1 frames. So a chunk you think of as "111 frames" actually decodes to fewer, and naive chunking accumulates the shortfall until the final segment comes out too short. The plan node normalizes every chunk to a valid 4n+1 length (_to_4n1) and reports what will actually be generated.

    Inputs and outputs

    • source_frames (INT, default 161) - your driving-video frame count.
    • chunk_length (INT, default 81) - the generation chunk; it gets bumped to the nearest 4n+1 automatically.

    Outputs:

    • source_frames - echoed back.
    • chunk_count - how many chunks the full source splits into.
    • generated_frames - the total the chunked run will actually produce: chunk_length + (chunk_count-1) * (chunk_length-1), i.e. the first chunk's full length plus continuation chunks minus one shared frame each.
    • chunk_plan - a STRING of the per-chunk plan, useful for logging or for the segment planner.

    How to use it

    Wire it in front of the extend node as a sizing oracle: feed it your driving-video frame count and chosen chunk length, read chunk_count and generated_frames, and you know before a single sample whether your target length is even reachable in whole chunks. It pairs naturally with IAMCCS_WanAnimate2Extends (which does the actual chunked sampling) and the Shotboard Easy shell. Because it never touches the model, you can put it anywhere in the graph and call it freely during setup without paying VRAM for a model load.

    The honest read

    It's a small node and it's exactly as useful as its niche: people who build Wan-Animate-2 long-form graphs for others. If you hardcode 81-frame chunks once and never change the source length, you don't need it. The moment your driving videos vary in length - which is the real-world case for V2V - this becomes the thing that keeps your saved workflow honest instead of silently shipping clipped or padded takes.

    Ships with IAMCCS-nodes: ComfyUI Manager → search "IAMCCS", or cd ComfyUI/custom_nodes && git clone https://github.com/IAMCCS/IAMCCS-nodes.git, restart. No dependencies beyond the pack.

    CategoryIAMCCS/video/WanAnimate-2

    Inputs (2)

    NameTypeDefaultDescription
    source_framesINT1611–100000
    chunk_lengthINT815–1025

    Outputs (4)

    NameTypeDescription
    source_framesINT
    chunk_countINT
    generated_framesINT
    chunk_planSTRING