Nodes/IAMCCS-nodes/IAMCCS WAN Chunk Gate PURE
ComfyUI Node

IAMCCS WAN Chunk Gate PURE

Send generated frames when active, source frames when not

By IAMCCS·Created 11 months ago·Updated 7 days ago· 113
IAMCCS WAN Chunk Gate PURE
  • timeline_plan
  • source_images
  • generated_images
  • images
  • active
  • report
chunk_index0

In a chunked Wan timeline loop, each chunk has a role: some chunks are actually generated by the sampler, and some are just pass-through of source material (an establishing shot, a still, an external clip you're slotting into the timeline). IAMCCS_WanChunkGatePure is the switch that decides which is which, per chunk, driven by a timeline plan. It's the "PURE" family's gate node - small, single-purpose, and it makes the loop's branching explicit instead of hidden inside a dozen conditional rewires.

How it works

Two required inputs, two optional, three outputs:

  • timeline_plan (type IAMCCS_WAN_TIMELINE_PLAN) - the plan object from a planner node in the PURE family, which carries active_chunk_count (how many chunks get generated).
  • chunk_index - the current loop iteration's index.
  • source_images (optional) - frames for chunks that aren't generated.
  • generated_images (optional) - frames for chunks that are.

The gate compares chunk_index against the plan's active count. If the chunk is active and generated_images is connected, it passes the generated frames through; if the chunk is inactive, it passes source_images (or falls back to generated if that's all there is). Outputs are images, an active boolean, and a report JSON - so downstream logic can branch on active as well as receiving the right frames.

The evaluation is lazy, which is the clever part: check_lazy_status only requests generated_images when the chunk is active and only requests source_images when it's not. ComfyUI won't compute the branch you don't need for that chunk, so inactive chunks don't drag a full sampler execution behind them.

Where it fits

This node is one tile in the pack's "WAN PURE" timeline system (chunk gate, relay/bypass, and the plan node live together in the same module). The workflow shape is: a planner builds the timeline plan once, a loop iterates chunk_index, and this gate routes each iteration's frames correctly while the sampler runs only on the chunks marked active. If you're not using that PURE timeline system, this node has nothing to consume - timeline_plan is a pack-specific type, so don't expect to hand it a random string.

Install

Part of IAMCCS-nodes:

  • ComfyUI Manager → search "IAMCCS" → install → restart.
  • Or:
cd ComfyUI/custom_nodes
git clone https://github.com/IAMCCS/IAMCCS-nodes.git

Restart ComfyUI. Requirements: ComfyUI ≥ 0.3.0, Python ≥ 3.12, Torch ≥ 2.8. No models; it works with the pack's own timeline-plan node.

CategoryIAMCCS/Wan/PURE

Inputs (4)

NameTypeDefaultDescription
timeline_planIAMCCS_WAN_TIMELINE_PLAN
chunk_indexINT00–999
source_imagesoptIMAGE
generated_imagesoptIMAGE

Outputs (3)

NameTypeDescription
imagesIMAGE
activeBOOLEAN
reportSTRING