Nodes/ComfyUI-UtilsCollection/Krea2 System Prompt Scaled Attention Encoder (Advanced)
ComfyUI Node

Krea2 System Prompt Scaled Attention Encoder (Advanced)

Reweight what Krea 2 actually looks at, word by word

By silveroxides·Created 2 months ago·Updated about 7 hours ago· 24
Krea2 System Prompt Scaled Attention Encoder (Advanced)
  • 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

Krea 2 is the 12B DiT that opened in June 2026 with a Qwen3-VL text encoder instead of CLIP, and that one architectural swap quietly breaks an old habit. On SD/SDXL you emphasized a word with (word:1.4) and the tokenizer scaled it up. On an LLM encoder there is no such per-token emphasis knob - so the trick moved down a level, into attention itself. That's what this node does. It patches the diffusion model so specific words in your prompt get more (or less) attention during sampling, then hands you back the patched model and the conditioning to feed it.

The name is a mouthful, and the first thing to know is that it's a deprecated alias - the pack registers this class for old-workflow compatibility while the canonical node lives on as UC_Krea2TokenAttentionWeight. If ComfyUI offers to replace it with the UC_ version, take the offer. Same behavior, no legacy cruft.

What it actually does

Two outputs tell you it's doing two jobs at once. The MODEL output is a patched clone of your diffusion model with attention monkeypatched per the weights string; the CONDITIONING output is the normal text-encode result. You wire both into the same KSampler branch - patched model in, conditioning in - and the sampling run reweights which visual blocks the model attends to.

The input that matters most is attention_weights. It's a plain space-separated list of non-negative "odds" weights, and the author's own example is the best tutorial there is:

(arms:1.5) (painting:0) (photo:2)

That means: pay a little extra attention to arms, roughly zero attention to painting, and double down on photo. Values are odds, so 0 actively suppresses a concept rather than merely underweighting it. strength (default 1, range 0–4) is a global multiplier that compounds across all blocks - push it when a single word isn't biting.

Everything else is the pack's standard visual-conditioning stack: clip and prompt plus a system_prompt injected before your description, image_inputs for reference images, vlm_resolution to size the images for the semantic path (256–3584, outside that range it keeps the original resolution), and vae_resolution/ref_latent_mode for the structural VAE-reference path. Optional visual_fusion_config (from UC_VisualFusionConfig) blends isolated visual blocks spatially. One honest quirk the tooltip flags: numbered multi-image inline placement like <Picture N> is intentionally unavailable here - that's the price of attention-level control.

Install

Grab the pack via ComfyUI Manager (search ComfyUI-UtilsCollection) or manually:

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

Then restart ComfyUI. Dependencies are just opencv-python and typing-extensions - nothing exotic.

When you'd reach for it

This is the node for the stubborn-case fight: Krea 2 keeps painting a jacket when you said no jacket, or a style tag keeps swamping your subject. It's fiddly - you're tuning by eye, and weights that work at one seed won't perfectly transfer to another. Start with one suppressed word at 0 and one boosted word at 1.5–2, leave strength at 1, and only stack more entries once you know what direction each one pushes. And since you're monkeypatching the model, cache-bust: any change to the weights string is a new patched model on the next queue. It's a scalpel, not a hammer - but it's a scalpel nothing else in the pack comes close to.

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