Nodes/ComfyUI_VideoChunkTools/Video Chunk Planner
ComfyUI Node

Video Chunk Planner

Video Chunk Planner — the map before you build the graph

By gregtee2·Created 6 months ago·Updated 6 months ago· 4
Video Chunk Planner
    • total_chunks
    • plan_info
    total_frames300
    chunk_frames81
    overlap_frames16

    Chunked video generation has a planning problem: before you build the workflow, you need to know how many chunks your 300-frame video splits into, which frames each chunk covers, and which reference each one needs. Do that math in your head and you will be wrong by one chunk somewhere. This node does the arithmetic and writes you a plain-text plan you can actually read.

    VideoChunkPlanner is the "run this first" node of the VideoChunkTools pack. It doesn't touch any pixels - it's a pure calculation node. You type in three numbers, it tells you the chunk count, every frame range, and the exact workflow steps for a rolling-reference run. Think of it as the spec for the graph you're about to build, and as a sanity check on the settings you're about to use.

    The inputs

    • total_frames - total frames in your driving video.
    • chunk_frames - frames per chunk. 81 is the Wan-native default; for Wan it must be 4n+1, and the planner will happily take a non-conforming number and show you the resulting (broken) layout - which is actually a good way to catch the mistake before it costs you a generation.
    • overlap_frames - overlap between adjacent chunks. 16 default.

    What comes out

    Two outputs:

    • total_chunks - an INT you can wire straight into other nodes, like a loop count or an input for the WanVideoChunkCalculator.
    • plan_info - a STRING with the full text plan: chunk count, stride, then a per-chunk layout showing frame ranges and which reference each one uses (original reference for chunk 0, last frame of chunk N-1 after that), followed by a numbered workflow recipe.

    So with total_frames=300, chunk_frames=81, overlap=16 you get a readable plan that starts roughly like:

    Total chunks needed: 5
      Chunk 0: frames 0-80    | ref: original reference
      Chunk 1: frames 65-145  | ref: last frame of chunk 0
      ...
    

    Wire plan_info into a Show Text / String node (or just read it in the console) and you've got your build sheet. The last chunk starting earlier than the naive stride math suggests is intentional, by the way - the pack clamps the final chunk so it stays full-size rather than ending with a stub.

    Why this matters in 2026

    The whole pack exists because video models have a hard context ceiling - Wan's is 81 frames, and everything longer is chunking with identity drift at the boundaries as the constant failure mode. Single-node chunkers hide that loop now, but if you're hand-rolling a pipeline (or debugging one that's one chunk short), the planning step is where you catch the mistakes. This node is also a good teacher: run it once for a video you know well and you'll finally internalize how stride, overlap, and chunk count interact.

    Installing

    cd ComfyUI/custom_nodes
    git clone https://github.com/gregtee2/ComfyUI_VideoChunkTools.git
    

    Or "VideoChunkTools" in ComfyUI Manager, install, restart. No pip dependencies, no model files - it's arithmetic. You can run it in a graph that has no model loaded at all, which is part of why it's the natural first node to drop in when you're planning a long-video project.

    CategoryVideoChunkTools

    Inputs (3)

    NameTypeDefaultDescription
    total_framesINT3001–100000Total number of frames in your driving video
    chunk_framesINT812–2000Frames per chunk (e.g., 81 for Wan models)
    overlap_framesINT160–200Frames of overlap between adjacent chunks

    Outputs (2)

    NameTypeDescription
    total_chunksINT
    plan_infoSTRING