KJNodes/experimentalgenerated

Krea2 Prompt Weight(Krea2PromptWeight)

Per-token prompt weighting for Krea2 (K2) via attention value scaling. Use (word:-1) to remove a concept, (word:1.5) to emphasize one -- works through the Qwen3-VL encoder where normal weighting doesn't. Outputs the patched model + conditioning; set the sampler CFG to 1.0.

Krea2 Prompt Weight

clip
model
model
conditioning
text
STRING
strength
1.00
KJNodes

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

NameTypeRequiredDefaultRange / StepDescription
clipCLIPYesThe CLIP model (Qwen3-VL) used for text encoding. Usually the CLIP from a Krea2 checkpoint.
modelMODELYesThe diffusion model (UNet or transformer) to be patched with per‑token attention scaling.
textSTRINGYes""The prompt text. Include weight tags in the format (word:weight) to control individual token contributions.
strengthFLOATYes1.00.04.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

NameTypeDescription
modelMODELThe input model with attention weights patched to respect the token‑level scaling. Use this model in the sampler node.
conditioningCONDITIONINGThe 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 text input, 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 cfg parameter to 1.0.

  • Global strength – the strength input multiplies every weight tag. If you have (tree:2.0) and strength is 0.5, the effective weight becomes 1.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 CLIPTextEncode node) 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.

Loading comments…
Krea2 Prompt Weight (Krea2PromptWeight) - ComfyUI-KJNodes | ComfyUI Wiki