Nodes/ComfyUI-CustomNodeKit/CLIP Vision Multi-Ref Switch
ComfyUI Node

CLIP Vision Multi-Ref Switch

CLIP Vision Multi-Ref Switch

By user2318·Created 4 months ago·Updated about a month ago· 56
CLIP Vision Multi-Ref Switch
  • clip_vision_output
  • clip_vision_output
enabledfalse

Here's a quietly annoying truth about multi-reference video generation: the model only really listens to the first image. Feed a CLIP Vision encoder a batch of five reference images and the Wan/SCAIL conditioning path typically only uses the features of image zero; the rest are decorative. CLIP Vision Multi-Ref Switch is the small but real fix for that - a toggle that flattens all N images' CLIP features together so every reference contributes to the conditioning.

Mechanically it's barely a node. It sits between CLIPVisionEncode and WanSCAILToVideoMultiRef (or WanAnimateToVideoCustom), takes the clip_vision_output, and when enabled is on it reshapes the penultimate_hidden_states tensor from [N, 257, 1280] into [1, N*257, 1280] - packing all the reference images' tokens into the token dimension instead of leaving them stacked in the batch dimension, where only the first one gets used. The 257 comes from 256 patch tokens plus the CLS token per image. When enabled is off, it passes the output through completely untouched, preserving the stock behavior (first image only).

What you set

There's one real input: enabled. That's it. Turn it on when you want multi-image conditioning, off when you don't. If the input batch has only a single image, it short-circuits and passes through regardless, so there's no penalty for leaving it on in a single-ref workflow.

Output is clip_vision_output, ready to wire straight into the SCAIL/WanAnimate conditioning node. This is one of the pack's nodes built on ComfyUI's newer node API (io.ComfyNode), which means it shows up correctly in recent ComfyUI builds - if you're on an older frontend and it doesn't appear, update ComfyUI before blaming the install.

Why this matters in practice

SCAIL-2's whole selling point is multi-reference - a few character shots from different angles driving one animation. Without this switch, the extra references are mostly for show. Flip it on and the model gets the combined visual context of all of them, which is precisely the workflow the pack's WanSCAIL2 multi-ref graph is built around. It's also marked experimental by the author, so treat it as "works, but may evolve."

Install

It's part of user2318/ComfyUI-CustomNodeKit. ComfyUI Manager: search "CustomNodeKit". Or manually:

cd ComfyUI/custom_nodes
git clone https://github.com/user2318/ComfyUI-CustomNodeKit.git
cd ComfyUI-CustomNodeKit
pip install -r requirements.txt

then restart. No model downloads - this node touches no weights, it just rearranges a tensor that's already in memory. The heavy models (the Wan/SCAIL checkpoint, the CLIP vision model) are your own responsibility, same as any video workflow.

The gotcha

It's a switch, not a tool - it changes how features are packed, and the downstream conditioning node has to be the pack's own multi-ref node for the flattened shape to be meaningful. Drop it in front of a stock WanAnimate node that expects the original shape and "enabled" buys you nothing. Also keep in mind token length: N×257 tokens grows conditioning memory as N grows, so with many references you're trading VRAM for coverage. That's the actual cost of making every reference count.

Categoryconditioning/video_models/scail

Inputs (2)

NameTypeDefaultDescription
clip_vision_outputCLIP_VISION_OUTPUTCLIP vision output from CLIPVisionEncode. Supports batch (N images).
enabledBOOLEANfalseEnable multi-image CLIP feature concatenation. When ON, all N images in the batch contribute. When OFF, passes through unchanged (only 1st image used).

Outputs (1)

NameTypeDescription
clip_vision_outputCLIP_VISION_OUTPUTProcessed CLIP vision output. If enabled, penultimate_hidden_states is reshaped from [N, 257, 1280] to [1, N*257, 1280].