Description
The Krea2 Prompt Weight node provides per-token prompt weighting for Krea2 (K2) models by scaling attention values.
Standard weighting (e.g., (word:1.5) in the prompt text) does not work with the Qwen3-VL encoder that Krea2 uses. This node applies the weighting after the CLIP text encoding, patching the model’s attention mechanism so that tokens can be boosted or suppressed in a fine-grained way.
Use a weight tag like (word:-1) to remove a concept from the generation, or (word:1.5) to emphasize it. The weighting is applied to the conditioning and also modifies the model itself, so the node outputs both a patched model and a conditioning tensor. When using this node, set the sampler’s CFG scale to 1.0 (the node handles the conditioning internally via the patched model).
Inputs
| Name | Type | Required | Default | Range / Step | Description |
|---|---|---|---|---|---|
clip | CLIP | Yes | — | — | The CLIP model (Qwen3-VL) used for text encoding. Usually the CLIP from a Krea2 checkpoint. |
model | MODEL | Yes | — | — | The diffusion model (UNet or transformer) to be patched with per‑token attention scaling. |
text | STRING | Yes | "" | — | The prompt text. Include weight tags in the format (word:weight) to control individual token contributions. |
strength | FLOAT | Yes | 1.0 | 0.0 – 4.0 (step 0.05) | Global multiplier applied to all weight tags. Useful for dialing the overall effect up or down without editing the prompt. |
Outputs
| Name | Type | Description |
|---|---|---|
model | MODEL | The input model with attention weights patched to respect the token‑level scaling. Use this model in the sampler node. |
conditioning | CONDITIONING | The conditioning tensor derived from the text, with per‑token scaling baked in. Pass this to the sampler as usual. |
Usage Notes
-
Weight syntax – inside the
textinput, write(word:float).(cat:2.0): double the influence of the token “cat”.(car:-1.0): negative weight that suppresses the concept.(sky:0.0): effectively disable that token.- Tokens without explicit weighting behave normally (weight = 1.0).
-
CFG scale must be 1.0 – because the node applies conditioning internally via the patched model, the usual CFG guidance is disabled. Set the sampler’s
cfgparameter to1.0. -
Global strength – the
strengthinput multiplies every weight tag. If you have(tree:2.0)and strength is0.5, the effective weight becomes1.0. This is useful for quickly adjusting the aggressiveness of the weighting without rewriting the prompt. -
Qwen3‑VL compatibility – this node is designed specifically for the Qwen3‑VL encoder used by Krea2. Standard ComfyUI weighting (via the
CLIPTextEncodenode) does not work with that encoder; this node provides the only reliable per‑token control. -
Output order – both outputs are required. The patched model must be used with the corresponding conditioning output, otherwise the weights will not be applied correctly.
Comments
Sign in with GitHub to join the discussion.