Nunchaku FLUX.2 Klein Identity Feature Transfer (Final)
The strongest identity lock in the pack — and the most demanding
- model
- sigmas
- subject_mask_1
- subject_mask_2
- subject_mask_3
- subject_mask_4
- subject_mask_5
- subject_mask_6
- subject_mask_7
- subject_mask_8
- MODEL
This is the node the whole pack builds toward: identity feature transfer for Nunchaku Klein, the technique that keeps a person being that person through an edit by transplanting reference features directly into the diffusion transformer's blocks. Where Identity Guidance nudges latents toward a face, this one re-routes the feature bank itself, block by block, at strengths you can set per layer. It's the difference between "similar" and "this is the same person," and it's also the most demanding node here - it needs the extended Nunchaku fork and the newer backend API, and it doesn't support two features the original had.
What you're actually tuning
The visible structure is simple: model in, MODEL out, plus a preset - HARD_LOCK, MID_LOCK, SOFT_LOCK, or custom. Those three presets are the whole game for beginners: HARD_LOCK for "do not let this face change," SOFT_LOCK for "keep the vibe but let the prompt move things." Under custom, the strings do the real work:
double_blocks/single_blocks- per-block feature strength specs like0-7:mid_img=0.55. Each block gets its own transfer weight; the defaults ship tuned, and the two debugprobeinputs (debug_probe_block_type/debug_probe_block_index) let you inspect a specific block's behavior.similarity_floor(0.04) andsoftmax_temperature(0.025) - how aggressively features get matched and transferred. These are the "if it's this similar, take it" thresholds.mask_behavior-focus_only(default) keeps the original masking behavior, where the mask limits this node's reference bank but Klein still sees the full reference.zero_unmasked_tokensis the harder mode: it blocks each wired reference's unmasked tokens as attention sources in every block, which is stricter and the README flags it as not supported in this first Nunchaku slice.subject_mask_1throughsubject_mask_8- optional masks, one per reference.
The sigmas input exists in the schema but the tooltip is candid: sigma-aware strength scheduling is not supported in this Nunchaku slice. Don't wire a scheduler expecting per-step strength curves; you'll get flat behavior.
The install is the hard part
cd ComfyUI/custom_nodes
git clone https://github.com/tom-m-2020/ComfyUI-Nunchaku-Klein
Backend requirements are the strictest in the pack: tom-m-2020/vitoom-nunchaku-extended (or an exact-match repack), and the README notes this node requires the newer Nunchaku backend APIv3. If your fork is older, it errors. Tonera's Klein checkpoint in diffusion_models/, and it's Direct K/V family, so this is the 9B/4B both-supported tier.
Common issues
- Backend/API errors at load - your Nunchaku build predates APIv3 or isn't the extended fork. Update before debugging anything else.
- Identity still drifts - start at HARD_LOCK and only loosen from there. And remember the model's own known limit: Klein holds identity worse than Qwen-Image-Edit; this node closes most of the gap, not all of it.
- Outcome differs run to run, same seed - the pack documents Nunchaku nondeterminism; feature transfer amplifies whatever the backend already does.
Inputs (27)
| Name | Type | Default | Description |
|---|---|---|---|
| model | MODEL | — | |
| preset | COMBO | HARD_LOCK | 4 options: HARD_LOCK, MID_LOCK, SOFT_LOCK, custom |
| enabled | BOOLEAN | true | — |
| reference_index | INT | 00–15 | — |
| reference_indices | STRING | all | — |
| similarity_floor | FLOAT | 0.0400–0.95 | — |
| softmax_temperature | FLOAT | 0.02500.0001–0.25 | — |
| mask_threshold | FLOAT | 1.000–1 | — |
| double_blocks | STRING | 0-7:mid_img=0.55 | — |
| single_blocks | STRING | 0:mid_img=0.22; 1:mid_img=0.24; 3:mid_img=0.28; 4:mid_img=0.22; 6:mid_img=0.26; 7:mid_img=0.27; 8:mid_img=0.25; 10:mid_img=0.27; 13:mid_img=0.27 | — |
| debug | BOOLEAN | false | — |
| mask_behavior | COMBO | focus_only | focus_only preserves the original masking behavior: the mask limits this node's reference bank while Klein still sees the complete reference. zero_unmasked_tokens blocks each wired reference's unmasked tokens as attention sources in every block. References without a wired mask remain complete and unchanged. |
| sigmasopt | SIGMAS | Sigma-aware strength scheduling is not supported by this first Nunchaku slice. | |
| debug_spatialopt | BOOLEAN | false | — |
| debug_probe_block_typeopt | COMBO | double | 2 options: double, single |
| debug_probe_block_indexopt | INT | 00–23 | — |
| debug_eligible_bank_capopt | INT | 00–65536 | — |
| debug_reference_pool_heightopt | INT | 00–4096 | — |
| debug_reference_pool_widthopt | INT | 00–4096 | — |
| subject_mask_1opt | MASK | — | |
| subject_mask_2opt | MASK | — | |
| subject_mask_3opt | MASK | — | |
| subject_mask_4opt | MASK | — | |
| subject_mask_5opt | MASK | — | |
| subject_mask_6opt | MASK | — | |
| subject_mask_7opt | MASK | — | |
| subject_mask_8opt | MASK | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| MODEL | MODEL | — |