Nodes/ComfyUI-Nunchaku-Klein/Nunchaku FLUX.2 Klein Identity Feature Transfer (Final)
ComfyUI Node

Nunchaku FLUX.2 Klein Identity Feature Transfer (Final)

The strongest identity lock in the pack — and the most demanding

By tom-m-2020·Created 2 months ago·Updated 17 days ago· 2
Nunchaku FLUX.2 Klein Identity Feature Transfer (Final)
  • 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
presetHARD_LOCK
enabledtrue
reference_index0
reference_indicesall
similarity_floor0.040
softmax_temperature0.0250
mask_threshold1.00
double_blocks0-7:mid_img=0.55
single_blocks0: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
debugfalse
mask_behaviorfocus_only
debug_spatialfalse
debug_probe_block_typedouble
debug_probe_block_index0
debug_eligible_bank_cap0
debug_reference_pool_height0
debug_reference_pool_width0

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 like 0-7:mid_img=0.55. Each block gets its own transfer weight; the defaults ship tuned, and the two debug probe inputs (debug_probe_block_type / debug_probe_block_index) let you inspect a specific block's behavior.
  • similarity_floor (0.04) and softmax_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_tokens is 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_1 through subject_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.
CategoryNunchaku/FLUX.2 Klein/Enhancer/Reference

Inputs (27)

NameTypeDefaultDescription
modelMODEL
presetCOMBOHARD_LOCK4 options: HARD_LOCK, MID_LOCK, SOFT_LOCK, custom
enabledBOOLEANtrue
reference_indexINT00–15
reference_indicesSTRINGall
similarity_floorFLOAT0.0400–0.95
softmax_temperatureFLOAT0.02500.0001–0.25
mask_thresholdFLOAT1.000–1
double_blocksSTRING0-7:mid_img=0.55
single_blocksSTRING0: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
debugBOOLEANfalse
mask_behaviorCOMBOfocus_onlyfocus_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.
sigmasoptSIGMASSigma-aware strength scheduling is not supported by this first Nunchaku slice.
debug_spatialoptBOOLEANfalse
debug_probe_block_typeoptCOMBOdouble2 options: double, single
debug_probe_block_indexoptINT00–23
debug_eligible_bank_capoptINT00–65536
debug_reference_pool_heightoptINT00–4096
debug_reference_pool_widthoptINT00–4096
subject_mask_1optMASK
subject_mask_2optMASK
subject_mask_3optMASK
subject_mask_4optMASK
subject_mask_5optMASK
subject_mask_6optMASK
subject_mask_7optMASK
subject_mask_8optMASK

Outputs (1)

NameTypeDescription
MODELMODEL