Nodes/XB_ToolBox/XB_WanPhantomSubjectToVideo
ComfyUI Node

XB_WanPhantomSubjectToVideo

Multi-reference conditioning with Phantom Subject

By wjluoxiao·Created 5 months ago·Updated 6 days ago· 302
XB_WanPhantomSubjectToVideo
  • positive
  • negative
  • vae
  • images
  • positive
  • negative_text
  • negative_img_text
  • latent
width832
height480
length81
batch_size1
vae_tile_size64
scale_methodlanczos
crop_modecenter

The thing that kills single-frame I2V is identity: you feed Wan one image and by frame 40 the character has subtly become someone else. XB_WanPhantomSubjectToVideo is the pack's node for the "Phantom Subject" style of Wan conditioning, and its answer is to feed the model several reference frames of your subject as time-dimension concatenated latents. Give it a few images and the model has enough visual anchor points that the subject stays on-model through the whole clip.

The display name is the bare class name - no fancy label, no Chinese flair. This is one of the pack's quieter, more technical nodes, and it's aimed at people doing character-consistency work rather than first-time video makers.

How it works

The core trick is time_dim_concat. The node VAE-encodes each image you pass into images, concatenates their latents along the temporal dimension, and writes the result into the conditioning as time_dim_concat. The model then treats those reference latents as a temporal prefix - context it can lean on throughout generation instead of a single pinned frame.

Where it gets interesting is the three-way split of the negative side:

  • positive gets the real time_dim_concat - the subject it should preserve.
  • negative_text gets the same real concat, which is the conditioning you'd feed a sampler that should still see the subject but be free of the text-negative's influence.
  • negative_img_text gets the concat zeroed out - a "no subject" negative, used when you want the model to wander rather than be anchored.

So the node outputs four sockets: positive, negative_text, negative_img_text, and latent. The exact wiring of which negative goes where depends on your sampler setup, but the split is deliberate: it gives you a clean way to run with or without the subject-anchor on the negative side.

Inputs that matter

width/height (832×480 default), length (81), batch_size, vae_tile_size. The star input is images - pass a batch of reference frames (the node encodes each one, capped at your length). More references means better consistency but more encode time and memory; 2–4 well-chosen frames (front, profile, action pose) is the sweet spot. scale_method/crop_mode handle fitting.

Install & honest caveats

Same as the whole pack: ComfyUI Manager → XB_ToolBox, or git clone https://github.com/wjluoxiao/XB_ToolBox.git into custom_nodes, restart. Declared deps opencv-python + easyocr, no weights bundled - bring the Phantom Subject Wan checkpoint and the standard VAE/CLIP/T5.

Two caveats. First, this node only builds conditioning - sampling, CFG and step setup are yours. Second, "Phantom Subject" is a niche model line, so community troubleshooting is thin; if you can't find the exact checkpoint name on your model hub, double-check which Wan 2.1/2.2 reference-to-video variant you're actually running, because this node's time_dim_concat contract is specific to that family.

CategoryXB_ToolBox/Pipeline

Inputs (11)

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

Outputs (4)

NameTypeDescription
positiveCONDITIONING
negative_textCONDITIONING
negative_img_textCONDITIONING
latentLATENT