Nodes/IAMCCS-nodes/Wan Long Planner
ComfyUI Node

Wan Long Planner

The math engine that turns '12 seconds of video' into a chunk plan

By IAMCCS·Created 11 months ago·Updated 7 days ago· 113
Wan Long Planner
    • total_frames
    • estimated_segments
    • continuation_generations
    • segment_index_out
    • is_first_segment
    • is_last_segment
    • current_start_frame
    • current_end_frame
    • current_visible_frames
    • remaining_frames_after
    • current_motion_count
    • use_prev_samples
    • use_end_frame
    • active_prompt_slot
    • current_trim_slots
    • report
    total_duration_s12.00
    fps16.00
    first_visible_frames81
    continuation_visible_frames81
    segment_index0
    first_motion_count0
    continuation_motion_count1
    end_overshoot_slots2
    use_end_frame_modeall

    Video models don't generate a minute of footage in one pass - you chunk it, chain it, and hope the seams disappear. IAMCCS_WanLongPlanner ("Wan Long Planner") is the node that does the planning arithmetic for you. You tell it how long the final video should be (total_duration_s), your fps, and how many visible frames each segment should use, and it answers the questions every long-video workflow needs: how many segments is that, which one am I on right now, is it the first or last, and what continuity settings should apply here?

    It's a calculator with a really well-thought-out output contract. All the outputs are plain INTs/FLOATs, so it plugs into whatever nodes you're already using - it doesn't try to be a magic all-in-one.

    The inputs you set

    • total_duration_s (default 12), fps (default 16) - your target runtime and frame rate. The whole plan derives from these.
    • first_visible_frames / continuation_visible_frames (both default 81) - the first segment is often longer (81 frames is the WAN convention for a "full" clip), and continuations carry a motion tail, so they get their own budget.
    • segment_index - your loop counter. The node uses it to figure out where you are.
    • first_motion_count / continuation_motion_count - how many prev-tail slots count as motion on the first segment vs. later ones.
    • end_overshoot_slots (default 2) - extra slots rendered past the visible end so FLF end frames converge; feeds trim_slots.
    • use_end_frame_mode - all, first_only, continuations_only, last_only, or off - decides which segments should bother locking an end frame at all.

    The outputs that actually matter

    • total_frames, estimated_segments, continuation_generations - the plan itself.
    • is_first_segment, is_last_segment - 1/0 flags that drive routing (e.g., bypass prev_samples on the first segment).
    • current_start_frame / current_end_frame / current_visible_frames - where this chunk sits in the final timeline.
    • current_motion_count, use_prev_samples, use_end_frame, active_prompt_slot, current_trim_slots - the per-segment settings you feed straight into the motion nodes (WanImageMotionPro) and the prompt planner. That's the loop's decision-making, all pre-computed for you.

    Install

    Standard IAMCCS-nodes:

    cd ComfyUI/custom_nodes
    git clone https://github.com/IAMCCS/IAMCCS-nodes.git
    

    or ComfyUI Manager → search "IAMCCS" → restart. No models, no extra deps. ComfyUI ≥ 0.3.0, Python ≥ 3.12, Torch ≥ 2.8.

    Where it pays off

    If you've ever manually calculated "how many 81-frame segments is 40 seconds at 16fps" in your head mid-workflow, this node ends that era. It also removes the classic first-segment bug: the flags make it trivial to render the opening chunk without prev_samples and every later chunk with it. Just remember the math assumes your sampler actually produces the number of frames you budget - if your length widget doesn't match continuation_visible_frames, the plan is lying to you, so keep them in sync.

    CategoryIAMCCS/Wan

    Inputs (9)

    NameTypeDefaultDescription
    total_duration_sFLOAT12.000.01–36000
    fpsFLOAT16.000.001–240
    first_visible_framesINT811–8192
    continuation_visible_framesINT811–8192
    segment_indexINT00–100000
    first_motion_countINT00–16
    continuation_motion_countINT10–16
    end_overshoot_slotsINT20–16
    use_end_frame_modeCOMBOall5 options: all, first_only, continuations_only, last_only, off

    Outputs (16)

    NameTypeDescription
    total_framesINT
    estimated_segmentsINT
    continuation_generationsINT
    segment_index_outINT
    is_first_segmentINT
    is_last_segmentINT
    current_start_frameINT
    current_end_frameINT
    current_visible_framesINT
    remaining_frames_afterINT
    current_motion_countINT
    use_prev_samplesINT
    use_end_frameINT
    active_prompt_slotINT
    current_trim_slotsINT
    reportSTRING