Nodes/ComfyUI-UtilsCollection/Advanced Visual Consensus Encoder (TokenFusion)
ComfyUI Node

Advanced Visual Consensus Encoder (TokenFusion)

The token-first alternative to the visual consensus encoder

By silveroxides·Created 2 months ago·Updated about 7 hours ago· 24
Advanced Visual Consensus Encoder (TokenFusion)
  • clip
  • visual_consensus_config
  • image_inputs
  • vae
  • CONDITIONING
prompt
system_prompt
vlm_resolution384
vae_resolutionFast (1024)
ref_latent_modeoff
multiplier1.0
vae_dimension_multiple8
semantic_anchorfalse

UC_AdvancedVisConEncoder fuses complete conditionings. This node is the other way to skin the same cat: UC_AdvancedVisConEncoderTokenFusion ("Advanced Visual Consensus Encoder (TokenFusion)") fuses the tokens first - before the conditioning encode even happens. At each encoder resolution it merges per-source visual and DeepStack tokens into one stream, runs a single conditioning encode, and only then applies the same complete-conditioning consensus across the resolution samples. If the plain VisCon Encoder is "fuse the finished pictures," this one is "fuse the ingredients."

Same schema, same config requirements, one mental-model difference. Inputs are clip, prompt, system_prompt, vlm_resolution, a required visual_consensus_config, the standard vae_resolution/ref_latent_mode/multiplier/vae_dimension_multiple/semantic_anchor stack, and image_inputs - with the same lane/broadcast routing contract as its sibling (one batched socket = separate visual sources, multiple batched sockets = index-aligned lanes, singleton sockets broadcast). Output is one CONDITIONING.

Why token-first matters

The two nodes are a genuine design fork, not a rebrand. The spatial variant (VisCon Encoder) builds a complete fused conditioning at each resolution - meaning each resolution's encode sees the full fused picture - and then consensus-blends those completes. TokenFusion instead mixes the visual tokens into one stream per resolution and encodes that combined stream once, which changes what the model sees: a single coherent token context rather than several separately-encoded images being averaged after the fact. The README is explicit that these are not alternatives you should crossfade; you pick the philosophy. TokenFusion is the additive, token-first one, and it tends to shine when your sources are already close in meaning and you want them fused tightly rather than voted on.

Because it's a _TokenFusionConditioningNode subclass, there's a behavioral nicety in the code worth knowing: when fusion is off (or no images are connected), it transparently falls back to its base node's ordinary execution - so a disconnected TokenFusion node behaves exactly like a plain encoder rather than erroring. That makes it a safe drop-in while you experiment.

One shared trap with its sibling: ref_latent_mode must be off for MiniMax H3 - the pack's generic reference latents don't apply there; H3 uses Core's dedicated reference conditioning. And this whole family is marked experimental in the source, so budget some tuning time.

Install

Via ComfyUI Manager (search ComfyUI-UtilsCollection) or:

cd ComfyUI/custom_nodes
git clone https://github.com/silveroxides/ComfyUI-UtilsCollection

Restart. Deps: opencv-python and typing-extensions.

When you'd reach for it

When your multi-source conditioning is fighting itself and you want the sources fused into one coherent token stream instead of merged after the fact. If you're not sure which philosophy you want, run both side by side on a small batch - the difference is visible in a couple of generations, and this pack made it cheap to compare.

Categoryadvanced/conditioning

Inputs (12)

NameTypeDefaultDescription
clipCLIPCLIP/T5 dual text encoder reference.
promptSTRING
system_promptSTRING
vlm_resolutionINT3840–4096Equivalent-square VLM target. Values outside 256-3584 preserve Original resolution.
visual_consensus_configVISUAL_CONSENSUS_CONFIGRequired joint configuration. At each resolution, TokenFusion fuses visual and DeepStack tokens before one conditioning encode; complete-conditioning consensus then combines the encoded resolution samples.
vae_resolutionCOMBOFast (1024)6 options: Ultra (512), Turbo (768), Fast (1024), Balanced (1280), Detailed (1536), Original
ref_latent_modeCOMBOoffGeneric reference-latent mode. MiniMax H3 requires off and uses Core's dedicated H3 reference conditioning instead.
multiplierFLOAT1.0-1000–1000
vae_dimension_multipleINT84–256
semantic_anchorBOOLEANfalsePrefixes each encoded visual slot with its numbered <Picture N>: semantic anchor.
image_inputsCOMFY_AUTOGROW_V3One batched socket equals separate visual sources. Multiple batched sockets form index-aligned lanes; singleton sockets broadcast.
vaeoptVAE

Outputs (1)

NameTypeDescription
CONDITIONINGCONDITIONING