XB-BOX - Wan Infinite Relay Node
The relay node that chains Wan clips into a continuous video stream
- wan_bus
- start_image
- prev_video
- 📦 WAN_BUS (Pass to next)
- 🖼️ Current End Image (Connect to next Start Image)
- 🎞️ Accumulated Video Stream
Wan's native context is 81 frames - about five seconds. Everything longer is a stitch. For years the community's answer was manual chaining: generate clip A, grab its last frame, feed it back in as clip B's start image, repeat, and pray the seams don't show. XB_Wan_InfiniteRelayNode ("XB-BOX - Wan Infinite Relay Node") is that entire loop collapsed into one node. You give it a bus, a start image and a prompt, and it runs one full segment internally: condition, sample, decode, trim, accumulate - then hands you the end image so the next relay can continue.
It's the "infinite" building block of the XB_ToolBox pack. The author's framing in the README is all about making long video on consumer GPUs tractable - spatiotemporal chunking, VRAM offloading, and this chain-based extension. Each relay is a self-contained 81-frame unit, so VRAM stays flat no matter how many segments you stack.
How it works
The node reads everything it needs off the WAN_BUS it receives (from XB_Wan_ParamBus), then:
- Encodes your
positive_promptagainst the bus's CLIP and negative prompt. - Prepares the segment by calling the pack's
XB_WanImageToVideowith yourstart_image- the bus's resolution, length, VAE tiling and clip-vision settings all apply. - Samples in two passes, matching Wan 2.2's high-noise/low-noise split:
KSamplerAdvancedrunsmodel_highfrom step 0 tohigh_noise_steps, thenmodel_lowfinishes the run. It even guardshigh_noise_stepsso you can't accidentally set it ≥ total steps and collapse the ODE schedule. - Decodes, trims, corrects - it drops the duplicated head frames (
cut_first_frame/trim_head_framesfrom the bus), then runs a progressive color-correction pass against the start image to fight the brightness/exposure drift that makes chained Wan clips visibly flicker over time. - Accumulates the segment into the running video (GPU or CPU concat per the bus's
concat_mode).
Three outputs: the WAN_BUS to pass downstream, the current segment's end image (feed it into the next relay's start_image), and the accumulated video stream of everything so far.
Wiring it
The classic chain is: one XB_Wan_ParamBus → N relay nodes in sequence, each taking the previous WAN_BUS and the previous end image. Wire the final 🎞️ Accumulated Video Stream into a preview or save node and you've got a continuous take. The prev_video optional input lets you start from footage you already generated, rather than from zero.
Install
ComfyUI Manager → XB_ToolBox, or git clone https://github.com/wjluoxiao/XB_ToolBox.git into custom_nodes, restart. Pack deps are opencv-python and easyocr; the Wan checkpoints, VAE and text encoders are yours. Expect this to be slow - each relay is a full 81-frame generation, and a 20-second clip is four relays of 40-minute-egg-sitting on a 3090-class card. The seams are better than hand-chaining, not invisible. Identity drift across segments is still the thing to watch.
Inputs (4)
| Name | Type | Default | Description |
|---|---|---|---|
| wan_bus | WAN_BUS | — | |
| start_image | IMAGE | — | |
| positive_prompt | STRING | Describe the specific action for this segment... | — |
| prev_videoopt | IMAGE | — |
Outputs (3)
| Name | Type | Description |
|---|---|---|
| 📦 WAN_BUS (Pass to next) | WAN_BUS | — |
| 🖼️ Current End Image (Connect to next Start Image) | IMAGE | — |
| 🎞️ Accumulated Video Stream | IMAGE | — |