Nodes/IAMCCS-nodes/IAMCCS WAN Shotboard Loop Chunk Select
ComfyUI Node

IAMCCS WAN Shotboard Loop Chunk Select

The node that turns a shot list into 'this iteration's shot'

By IAMCCS·Created 11 months ago·Updated 8 days ago· 113
IAMCCS WAN Shotboard Loop Chunk Select
  • timeline_plan
  • start_image
  • end_image
  • prompt
  • frames
  • motion
  • frame_rate
  • chunk_index
  • chunk_count
  • report
  • relay_local_prompts
  • relay_segment_lengths
  • relay_max_frames
  • relay_epsilon
  • relay_timeline_data
  • start_path
  • end_path
  • selected_timeline_plan
loop_index0
index_modedirect

This is the node that makes a shotboard loop actually loop. IAMCCS WAN Shotboard Loop Chunk Select takes the timeline plan and a loop index, and hands back the specific chunk you're supposed to generate this iteration - start image, end image, prompt, frame count, everything the sampler chain needs for one shot.

What it does

Two real inputs matter:

  • timeline_plan - the IAMCCS_WAN_TIMELINE_PLAN from Loop Info or Planner PURE.
  • loop_index - an INT that comes from your loop counter. It's lazy, so if nothing is wired in yet ComfyUI just asks you for the number.
  • index_mode - direct (default) throws an error if you ask for a chunk past the end of the board; clamp pins you to the last chunk instead. Clamp is nice for testing where you don't want a hard stop.

Give it index 2 and it returns chunk 2's start_image and end_image (the IMAGE outputs you'll encode and feed to your I2V node), the prompt for that shot, its frames and motion values, and the frame_rate. On top of that you get the relay outputs - relay_local_prompts, relay_segment_lengths, relay_max_frames, relay_epsilon, relay_timeline_data - which carry the per-shot prompt-relay routing for longer boards, plus start_path/end_path if you want the raw file paths.

The last output is the useful one for complex graphs: selected_timeline_plan, a copy of the plan narrowed down to just this chunk. Wire that forward instead of the full plan and every downstream node is guaranteed to be looking at one shot, not sixteen.

How it works

Under the hood it indexes into the plan's list of FLF pairs (start→end image pairs), pulls the matching pair, and rebuilds a single-chunk plan around it. That's the whole trick - the heavy lifting is done by IAMCCS_WanShotboardPlannerPure when it built the pairs; this node is a slice operation with a report.

Where it sits

Planner PURE → Loop Info → Loop Chunk Select → (encode start/end images) → WanImageMotionPro → sampler → feed the latents back as prev_samples → bump loop_index → next chunk. The frames output is also worth wiring into your motion node's length so every chunk gets the duration the plan assigned it rather than whatever you typed last week.

Installing it

Part of IAMCCS-nodes. ComfyUI Manager (search "IAMCCS"), or:

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

Restart, done. No dependencies beyond the pack itself.

Common issues

The classic error is loop_index outside active chunk_count - that's direct mode refusing an out-of-range index, and it usually means your loop counter isn't stopping at chunk_count. Either cap the counter or switch to clamp. And if it throws "no active FLF chunks," your planner board has fewer than two images; this node can't build a pair it wasn't given.

CategoryIAMCCS/Wan/PURE/Loop

Inputs (3)

NameTypeDefaultDescription
timeline_planIAMCCS_WAN_TIMELINE_PLAN
loop_indexINT00–100000
index_modeCOMBOdirect2 options: direct, clamp

Outputs (17)

NameTypeDescription
start_imageIMAGE
end_imageIMAGE
promptSTRING
framesINT
motionFLOAT
frame_rateFLOAT
chunk_indexINT
chunk_countINT
reportSTRING
relay_local_promptsSTRING
relay_segment_lengthsSTRING
relay_max_framesINT
relay_epsilonFLOAT
relay_timeline_dataSTRING
start_pathSTRING
end_pathSTRING
selected_timeline_planIAMCCS_WAN_TIMELINE_PLAN