Nodes/XB_ToolBox/XB_Wan22FunControlToVideo
ComfyUI Node

XB_Wan22FunControlToVideo

Wan 2.2 reference + control-video conditioning, prebuilt so you don't hand-build concat latents

By wjluoxiao·Created 5 months ago·Updated 6 days ago· 302
XB_Wan22FunControlToVideo
  • positive
  • negative
  • vae
  • ref_image
  • start_image
  • control_video
  • positive
  • negative
  • latent
width832
height480
length81
batch_size1
vae_tile_size64
scale_methodlanczos
crop_modecenter

Wan 2.2's Fun Control variants can steer generation with a reference image and a control video - depth, pose, or whatever driving signal you encode - but ComfyUI doesn't hand you that conditioning as a single friendly node. XB_Wan22FunControlToVideo is the pack's prebuilt version: it takes your positive/negative conditioning, a VAE, and up to three image/video inputs, and builds the concat-latent structure that Wan's architecture expects, so your sampler sees the reference and control signals without you assembling multi-channel latent tensors by hand.

The mechanism is where the "this is fiddly, be glad it's a node" feeling comes from. Look at the source and you'll see it constructing a 48-channel concat latent for Wan 2.2 (latent_channels == 48 path uses Wan22().process_out, doubling channels for the MoE's reference branch), or the 16-channel 2.1 path otherwise, then stuffing the VAE-encoded start image, reference, and control video into the right channel slices and writing the concat mask. If you've ever tried to wire this manually you know the failure mode: one wrong channel index and the reference silently bleeds into the noise.

Inputs that matter

Required: positive and negative (CONDITIONING), vae, then the geometry - width, height, length (default 81, stepped in 4), batch_size, and vae_tile_size (default 64), which tiles the VAE encode so large control videos don't OOM you.

Optional, and this is the interesting part:

  • ref_image - a single reference frame for identity/character.
  • start_image - the first-frame image for I2V-style anchoring.
  • control_video - the driving video (pose, depth, etc.) that gets encoded and fed as the control branch.
  • scale_method / crop_mode - how inputs get resized to your width/height.

Outputs: positive, negative (the now-conditioned versions), and latent (the empty-but-shaped latent your sampler fills). Wire all three into a KSampler and you have the full pipeline.

The honest framing

This is not a node you need every day - you reach for it when you specifically want Wan 2.2's Fun Control, which is the reference + control-video workflow rather than plain image-to-video. The pack also ships XB_Wan22ImageToVideoLatent for the simpler I2V case; if you only need a start image, that one's less machinery. One thing to keep in mind: the concat-latent trick requires your sampler to be Wan-compatible (the pack's XB_WanSampler or Kijai's WanVideoWrapper), because the conditioning fields this node sets (concat_latent_image, concat_mask, reference_latents) are read by the Wan model, not by a generic sampler.

Install

cd ComfyUI/custom_nodes
git clone https://github.com/WJLUOXIAO/XB_ToolBox.git

then restart, or install via ComfyUI Manager (search "XB_ToolBox"). You'll still need a Wan 2.2 model, its text encoder, and a Wan-compatible sampler - the node builds conditioning, it doesn't load models for you.

CategoryXB_ToolBox/Pipeline

Inputs (13)

NameTypeDefaultDescription
positiveCONDITIONING
negativeCONDITIONING
vaeVAE
widthINT83216–8192
heightINT48016–8192
lengthINT811–8192
batch_sizeINT11–4096
vae_tile_sizeINT6464–3840
ref_imageoptIMAGE
start_imageoptIMAGE
control_videooptIMAGE
scale_methodoptCOMBOlanczos5 options: lanczos, bilinear, bicubic, nearest-exact, area
crop_modeoptCOMBOcenter2 options: center, disabled

Outputs (3)

NameTypeDescription
positiveCONDITIONING
negativeCONDITIONING
latentLATENT