Nodes/XB_ToolBox/XB-BOX - Wan Infinite Relay Node
ComfyUI Node

XB-BOX - Wan Infinite Relay Node

The relay node that chains Wan clips into a continuous video stream

By wjluoxiao·Created 5 months ago·Updated 6 days ago· 302
XB-BOX - Wan Infinite Relay Node
  • wan_bus
  • start_image
  • prev_video
  • 📦 WAN_BUS (Pass to next)
  • 🖼️ Current End Image (Connect to next Start Image)
  • 🎞️ Accumulated Video Stream
positive_promptDescribe the specific action for this segment...

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:

  1. Encodes your positive_prompt against the bus's CLIP and negative prompt.
  2. Prepares the segment by calling the pack's XB_WanImageToVideo with your start_image - the bus's resolution, length, VAE tiling and clip-vision settings all apply.
  3. Samples in two passes, matching Wan 2.2's high-noise/low-noise split: KSamplerAdvanced runs model_high from step 0 to high_noise_steps, then model_low finishes the run. It even guards high_noise_steps so you can't accidentally set it ≥ total steps and collapse the ODE schedule.
  4. Decodes, trims, corrects - it drops the duplicated head frames (cut_first_frame/trim_head_frames from 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.
  5. 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.

CategoryXB_ToolBox/Pipeline

Inputs (4)

NameTypeDefaultDescription
wan_busWAN_BUS
start_imageIMAGE
positive_promptSTRINGDescribe the specific action for this segment...
prev_videooptIMAGE

Outputs (3)

NameTypeDescription
📦 WAN_BUS (Pass to next)WAN_BUS
🖼️ Current End Image (Connect to next Start Image)IMAGE
🎞️ Accumulated Video StreamIMAGE