Krea2T Enhancer Adds Attention-Weighted Phrases for Krea 2
capitan01R's Krea2T Enhancer adds an Attention-Weighted Phrases node for Krea 2: boost or suppress individual prompt phrases directly in the DiT attention.
(phrase:weight) and the node adjusts how strongly Krea 2's image tokens attend to exactly those words.
Why conventional prompt weighting does not work on Krea 2
Krea 2 does not consume a conventional single-layer CLIP embedding. Its text encoder supplies twelve selected Qwen hidden-state taps, producing a 12 x 2560 representation per token, which then passes through an internal text-fusion path before text and image tokens enter the shared DiT blocks. Standard emphasis tricks do not map cleanly onto this pipeline: multiplying conditioning rows can be neutralized by later normalization, and token repetition changes sequence length.
The new node keeps the original prompt sequence intact. It encodes the clean text normally, locates the Qwen token rows belonging to each weighted phrase, and adds log(w) to the selected image-to-text attention logits inside the shared DiT blocks. After softmax, this multiplies the phrase's attention odds by w without copying, deleting, averaging, or rescaling any conditioning rows.
Phrase-level attention control on Krea 2 with the new encoder node
How the weighting behaves
| Weight | Effect |
|---|---|
1.0 | Exact neutral, no change |
Above 1.0 | More attention priority for the phrase |
0.0 to 1.0 | Reduced attention priority |
0.0 | Strongest suppression of the phrase |
Weights are relative odds multipliers, not size or visibility guarantees. The author recommends starting at 1.5 or 2.0 and tuning one phrase at a time on a fixed seed before combining weights. A practical example looks like:
A scene containing a (primary subject:2.0) beside a (secondary object:0.6)The annotation is stripped before tokenization, and overlapping weighted sections are rejected. The node also validates the model layout: it only runs on text-only Krea 2 conditioning with the 12 x 2560 layout and fails loudly on mismatched encoders or unsupported architectures instead of applying an uncertain mapping.
Example output generated with weighted-phrase conditioning
Inspection output and debuggability
A STRING output records the clean text, every weighted phrase, its numeric weight, and the exact Qwen token rows, token IDs, and decoded pieces selected. Hook it to a text preview when you need to verify what a weight actually landed on. It is not required for sampling.
Workflows
The repository ships an example workflow for the new encoder node:
Install
Clone the repository into ComfyUI/custom_nodes and restart:
cd ComfyUI/custom_nodes
git clone https://github.com/capitan01R/ComfyUI-Krea2T-Enhancer.gitNo extra Python packages are required beyond a working Krea 2 setup. The node sits between your LoRA loaders and the sampler: connect the final model chain and the Krea2 CLIP to it, send its MODEL output to the sampler, and its CONDITIONING output to the positive path. The v1.3 update also includes the existing enhancer nodes: ComfyUI-Krea2T-Enhancer, Krea2T Enhancer Advanced (with a post-txtmlp text_scale control), and Krea2 Turbo Reference Sigmas (From Latent) for the official Turbo 8-step schedule.
Comments
Sign in with GitHub to join the discussion.