Nodes/ComfyUI-UtilsCollection/Krea2 Token Attention Weight (TokenFusion)
ComfyUI Node

Krea2 Token Attention Weight (TokenFusion)

Krea 2 attention weighting after token-first visual fusion

By silveroxides·Created 2 months ago·Updated about 7 hours ago· 24
Krea2 Token Attention Weight (TokenFusion)
  • model
  • clip
  • image_inputs
  • visual_fusion_config
  • vae
  • MODEL
  • CONDITIONING
prompt
system_prompt
attention_weights
vlm_resolution384
strength1.00
formula
padding_methodzero-pad
vae_resolutionFast (1024)
ref_latent_modeoff
multiplier1.0
vae_dimension_multiple8

This is the TokenFusion variant of UC_Krea2TokenAttentionWeight, and the difference matters mostly when you're fusing multiple reference images into one conditioning stream. The plain node patches attention and encodes in one pass. This one does the fusion first - merging the per-source visual tokens into a single sequence at the token level - then runs one shared conditioning encode, then applies your phrase-level attention weights on top.

Same promise, slightly different pipeline: (arms:1.5) (painting:0) (photo:2) style attention odds for Krea 2, but arranged for workflows where several images need to be blended into a single coherent visual context before the text weighting is applied. If you're building multi-image setups - a character sheet, a scene reference plus a style reference - the TokenFusion version is the one that matches how you're already thinking about the data.

How it works

The input surface is essentially identical to the plain node: a Krea 2 model, the clip (Qwen3-VL text encoder), prompt, system_prompt, attention_weights (space-separated (phrase:odds) pairs), vlm_resolution, strength (the global multiplier that compounds over all attention blocks), plus the fallback stack of formula / padding_method / vae_resolution / ref_latent_mode / multiplier / vae_dimension_multiple, and the autogrowing image_inputs.

The architectural difference is what the display name says: token fusion happens before the single encode. Instead of encoding each visual source and stitching the conditionings together downstream, the node fuses the visual tokens per-source into one interleaved sequence, runs one shared conditioning encode, and then applies the attention weighting. That's one less encode pass and, more importantly, the visual and text tokens share a single conditioning context when the weights land.

Outputs: the patched MODEL and the resulting CONDITIONING - same wiring as its sibling. As with the plain node, fusion accepts image_input_fusion or image_input_1 for its single visual slot, and numbered multi-image inline placement is deliberately unavailable.

Which one should you use?

If you're doing single-image Krea 2 work, take the plain UC_Krea2TokenAttentionWeight - fewer moving parts, same weighting. If you're fusing multiple references, this one. One thing to check when you load a workflow: this pack actively registers node replacements, so older graphs may auto-migrate to these canonical IDs - if a workflow references the older TextEncodeKrea2SysEditScaledAdvAttn style names, ComfyUI should offer to upgrade them when the pack is installed.

Install

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

Restart (or ComfyUI Manager → search "ComfyUI-UtilsCollection"). You need the Krea 2 model stack - checkpoint, Qwen3-VL text encoder (~8GB), Qwen-Image VAE - and the pack's own dependencies are just opencv-python and typing-extensions. Multi-image fusion plus a patched model is heavier on VRAM than the single-image path, so if you're on 16GB, keep vlm_resolution at the Fast setting and test with one image before piling on references.

Categoryadvanced/conditioning

Inputs (16)

NameTypeDefaultDescription
modelMODELDiffusion model to apply the attention monkeypatch to.
clipCLIPCLIP/T5 dual text encoder reference.
promptSTRINGMain prompt. Fusion accepts image_input_fusion or image_input_1 for its single visual slot. Numbered multi-image inline placement is intentionally unavailable in this attention node.
system_promptSTRINGSystem prompt injected prior to user description.
attention_weightsSTRINGSpace-separated non-negative attention odds weights. Example: (arms:1.5) (painting:0) (photo:2)
vlm_resolutionINT3840–4096Equivalent-square VLM target from 256 to 3584. Values outside that range preserve original resolution.
strengthFLOAT1.000–4Global multiplier on the weighting effect. Effect compounds over all blocks.
formulaSTRINGOptional conditioning formula used only when visual fusion is off. Empty selects the first image pass.
padding_methodCOMBOzero-padAlignment method for images with different aspect ratios/resolutions. Active ONLY if visual_fusion_config is disconnected or set to 'off'.
vae_resolutionCOMBOFast (1024)Resolution of the reference latent encoded by the VAE (structural path).
ref_latent_modeCOMBOoffReference latent encoding mode. 'single'/'multi' append latents; 'parallel-single'/'parallel-multi' run them in a separate conditioning stream to prevent semantic override.
multiplierFLOAT1.0-1000–1000Overall multiplier applied to the final conditioning vector.
vae_dimension_multipleINT84–256Pixel multiple used to align reference images before VAE encoding.
image_inputsCOMFY_AUTOGROW_V3Multimodal images. Maps active inputs sequentially to variables (a, b, c, ...).
visual_fusion_configoptVISUAL_FUSION_CONFIGOptional spatial visual fusion configuration from UC_VisualFusionConfig. Blends isolated visual blocks without coordinate blur.
vaeoptVAE

Outputs (2)

NameTypeDescription
MODELMODEL
CONDITIONINGCONDITIONING