FLUX.2 Klein Token Region Controller
Steer FLUX.2 Klein by token position, not semantics
- conditioning
- CONDITIONING
Klein's text encoder reads your prompt like an instruction to an LLM, and the position of a phrase inside that instruction matters more than on old CLIP models. The FLUX.2 Klein Token Region Controller gives you a crude but effective grip on that: boost the first quarter of your tokens, or the last quarter, or a custom window, without touching the prompt text.
Let me be straight about the tradeoff up front: this node works by token position, not meaning. "Front" means the first 25% of your active tokens, period. It has no idea whether those tokens say "a red car" or "and then the moon exploded." That's the blunt-instrument nature of it - which is exactly why the pack pairs it with the Sectioned Text Encoder. If you deliberately put your subject at the front and your style at the end, then "front" and "end" become meaningful. The encoder makes the positions intentional; this node exploits them.
How it works
It finds the active token region from the conditioning's attention_mask (same mechanism as the Conditioning Enhancer - same heuristic fallback if the mask is missing, same active_end_override escape hatch), then splits that region into three slices and multiplies each by its own gain:
front_mult- first 25% of active tokensmid_mult- 25% to 75%end_mult- final 25%
There's also emphasis_start / emphasis_end / emphasis_mult, a custom window with its own multiplier. Set start and end as token indices and you can target a phrase in the middle of a long prompt that the 25/50/25 split would bury. This is the input pair I'd actually reach for when one specific instruction is being ignored.
Like its sibling nodes, it has the preserve_original / preserve_mode set (blend_after, dampen, hybrid) for softening the effect, and skip_bos defaults to True so the BOS token doesn't get caught up in your region math. Output is a single CONDITIONING that carries on to the sampler or the next conditioning node.
A workflow that uses it well
A common pattern for Klein image edits: prompt the file, not the scene - "remove blur and noise, fix exposure, keep the posture" reads like a Photoshop command list. Now think about what you want to prioritize. Put the most important instruction first in the prompt, feed it through the Sectioned Text Encoder, then:
front_mult = 1.2to push the primary edit command,end_mult = 1.0to leave the trailing constraints alone,- or drop an
emphasis_start/emphasis_endwindow on the exact instruction that keeps losing.
Keep the multipliers modest. These are applied to real hidden states, and values above ~1.5 compound across the whole region fast. If the result gets mushy or overcooked, that's your preserve_original signal, not a reason to fight with dampen.
Install
Same pack, same install. ComfyUI Manager search "Flux2Klein", or:
cd ComfyUI/custom_nodes
git clone https://github.com/xmarre/ComfyUI-Flux2Klein-Conditioning-Toolkit
Restart. No models to download, no dependencies beyond torch - the pack works on conditioning tensors only, so you're not eating VRAM for this.
One trap worth knowing: because the regions are positional, a front_mult boost lands on whatever is in the first tokens - and if your text encoder adds boilerplate or your prompt is short, the split percentages are over fewer tokens than you think. Turn on the Sectioned Text Encoder's preview (it prints the actual active-token count) before you blame the multipliers.
Inputs (12)
| Name | Type | Default | Description |
|---|---|---|---|
| conditioning | CONDITIONING | — | |
| front_multopt | FLOAT | 1.000–3 | — |
| mid_multopt | FLOAT | 1.000–3 | — |
| end_multopt | FLOAT | 1.000–3 | — |
| emphasis_startopt | INT | 00–512 | — |
| emphasis_endopt | INT | 00–512 | — |
| emphasis_multopt | FLOAT | 1.000–3 | — |
| preserve_originalopt | FLOAT | 0.000–1 | — |
| preserve_modeopt | COMBO | blend_after | 3 options: blend_after, dampen, hybrid |
| active_end_overrideopt | INT | 00–512 | — |
| skip_bosopt | BOOLEAN | true | — |
| debugopt | BOOLEAN | false | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| CONDITIONING | CONDITIONING | — |