FLUX.2 Klein Identity Feature Transfer
The original attention-steering node
- model
- MODEL
Klein is genuinely good at editing, but the one thing it's bad at is holding a face across an edit - describe your subject and it's happy to invent a slightly different person. This node is the pack author's first working fix for that, and it's worth understanding on its own terms even though a newer version (Identity Feature Transfer Final) has since superseded it in most workflows.
How it actually works
The author explained the mechanism directly when announcing it: the reference latent lives in Klein's image token stream (not the text conditioning), so after every attention layer, the node checks where the generation's features resemble the reference's features and nudges the matches closer together. Crucially it's similarity-gated - regions that are legitimately different, a new background, a different pose, get left completely alone, because there's nothing there for the transfer to latch onto. That's the whole trick: it locks in identity deep in the network without fighting the prompt everywhere else.
This node patches the model, not the conditioning, and it only works if a reference latent is already flowing through the model's attention as an image token - which means Multi ReferenceLatent has to be wired upstream of your sampler's conditioning first. Connect this node without that in place and it has nothing to pull toward; it'll run without erroring and simply do nothing useful.
The inputs that matter
model- from your checkpoint, with the reference latent already present via Multi ReferenceLatent's conditioning path. The tooltip says it outright: "the reference must be in the image stream."strength- per-block blend factor. It fires at every active block, so the effect stacks up - the author's own guidance is to start at 0.10–0.20, not crank it to 1.0.start_block/end_block- which blocks the transfer runs on. Indexing is shared and resets: 0–7 covers the 8 double blocks, then it resets to 0–23 for the 24 single blocks. Default is the full range.mode- three flavors of the same idea:cosine_pull(each generation token gets pulled toward its best-matching reference token - the default, and the one described above),topk_replace(only the top-K% most similar tokens get touched),mean_transfer(a blunter shift of the whole feature distribution toward the reference).top_k_percent- only relevant intopk_replacemode; 0.25 means the top 25% most-similar generation tokens get affected.
Output is a patched MODEL - drop it right before your sampler.
Installing it
ComfyUI Manager: search ComfyUI-Flux2Klein-Enhancer and install, or:
cd ComfyUI/custom_nodes
git clone https://github.com/capitan01R/ComfyUI-Flux2Klein-Enhancer.git
Restart ComfyUI. No extra dependencies.
Where people get burned
The most common failure - reported directly in the pack's community thread - is that the node "does nothing" or produces no visible identity pull. Almost always it's the missing ReferenceLatent wiring described above: this node reads the reference from the model's attention stream, not from an input pin on itself, so it's easy to forget to route Multi ReferenceLatent into your conditioning first.
Second, Klein's distilled checkpoints are trained on 4 sampling steps and start hallucinating detail past that - a fact the author has stated plainly in support threads. If your identity transfer looks unstable or the whole image looks "off," check your step count before blaming this node; 10 steps on a 4-step-distilled Klein checkpoint is a much bigger source of weirdness than any identity-transfer setting.
Third, this is the original implementation, kept around for backward compatibility with existing workflows. If you're starting fresh, Identity Feature Transfer Final adds presets, multi-reference support, and per-reference masking on top of the same underlying mechanism - worth reading that node's page before you build around this one.
Inputs (6)
| Name | Type | Default | Description |
|---|---|---|---|
| model | MODEL | Requires ReferenceLatent connected. The reference must be in the image stream. | |
| strength | FLOAT | 0.150–1 | Per-block blend factor. Fires at every active block so the effect is cumulative. Start at 0.10 to 0.20. |
| start_block | INT | 00–23 | First block index to apply. 0 = earliest. Index is shared across double and single blocks (resets when single blocks begin). |
| end_block | INT | 230–23 | Last block index to apply. Covers 8 double blocks (0-7) then 24 single blocks (index resets 0-23). Higher values extend coverage into later single blocks. |
| mode | COMBO | cosine_pull | cosine_pull: pulls each gen token toward its best-matching ref token. topk_replace: only affects the top K%% most similar tokens. mean_transfer: shifts overall feature distribution toward the reference. |
| top_k_percent | FLOAT | 0.250.01–1 | topk_replace mode only. Fraction of generation tokens to affect. 0.25 = top 25%% most similar. |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| MODEL | MODEL | — |