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

XB-BOX - Wan Relay Node

Stitch a whole video from first-and-last frames

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

This is the workhorse of XB-BOX's "first/last frame" long-video pipeline - the one where you give each segment a start frame, an end frame, and a prompt, and the model fills in the motion between them. Chain several of these relay nodes and you get a coherent multi-minute video out of a model that can only natively do a few seconds. Display name "XB-BOX - Wan Relay Node".

How it works

Each relay instance generates one segment, then passes the baton. It reads the whole generation config from the wan_bus that comes out of the pack's ParamBus node - model, CLIP, VAE, width/height, steps, cfg, seed, negative prompt all travel in that one wire, so the relay node itself only asks you for the segment-specific stuff. Per segment it: encodes your positive_prompt with the bus CLIP, builds the first/last-frame conditioning and latent via the pack's XB_WanFirstLastFrameToVideo (using the start image plus the end image, with CLIP-Vision identity on the start frame), then runs a two-layer KSamplerAdvanced - a "high noise" pass from step 0 to high_noise_steps with a different model than the "low noise" pass that finishes it. That two-model trick is Wan 2.1's classic high/low-noise relay, where one checkpoint handles the coarse motion and a second refines the details. Then it decodes and appends to the accumulated stream.

There's a guard worth knowing: if high_noise_steps from the bus would equal or exceed the total steps, it clamps it down and warns - a "moat" against ODE timestep collapse. And if you leave the end frame empty, it just skips generation and passes the accumulated video through, which is how you make the last segment of the chain end naturally.

The inputs that matter

  • wan_bus - the WAN_BUS output of XB_Wan_ParamBus. Everything global comes from here.
  • start_image - the frame to start from (your first frame, or the previous relay's end image).
  • positive_prompt - the per-segment action description.
  • end_image_file - a file picker over your ComfyUI input folder, or wire opt_end_image instead to hand it an image from the graph (e.g. a ControlNet'd pose frame).
  • prev_video (optional) - the accumulated stream from earlier relays, so this segment can align its tail.

Outputs: WAN_BUS (Pass to next), Current End Image (which you connect to the next relay's start), and Accumulated Video Stream.

Install

Pack install - ComfyUI Manager search XB_ToolBox, or git clone https://github.com/WJLUOXIAO/XB_ToolBox into custom_nodes, restart. You also need the ParamBus and a Wan 2.1 first/last-frame model. This node won't do anything meaningful standalone; it's a framework node for a multi-node pipeline.

Common issues

If a segment silently doesn't generate, it's almost always the end frame: the node prints "no end frame specified, skipping" and passes through when end_image_file points at nothing or the folder is empty. Keep start/end images at the bus's width/height. And if the video visibly jumps between segments, your end frame of one segment and start frame of the next aren't matching up - they should be the same image.

CategoryXB_ToolBox/Pipeline

Inputs (6)

NameTypeDefaultDescription
wan_busWAN_BUS
start_imageIMAGE
positive_promptSTRINGDescribe the specific action for this segment...
end_image_fileCOMBO2 options: example.png, vrgdg_placeholder_i2i.png
prev_videooptIMAGE
opt_end_imageoptIMAGE

Outputs (3)

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