Nodes/ComfyUI-Flux2Klein-Enhancer/FLUX.2 Klein Identity Feature Transfer Advanced
ComfyUI Node

FLUX.2 Klein Identity Feature Transfer Advanced

Separate control over double and single blocks

By capitan01R·Created 7 months ago·Updated 30 days ago· 551
FLUX.2 Klein Identity Feature Transfer Advanced
  • model
  • subject_mask
  • MODEL
reference_index0
modecosine_pull
top_k_percent0.25
double_enabletrue
double_strength0.15
double_start0
double_end7
single_enabletrue
single_strength0.15
single_start0
single_end23
block_scheduleflat
sim_floor0.20
mask_threshold0.50

The plain Identity Feature Transfer node treats the whole block range as one setting. Advanced splits that in two, because Klein's double and single blocks genuinely do different jobs in the network - double blocks (0–7) shape pose, color, and identity early on; single blocks (0–23) refine style and texture later. If you've ever wanted identity locked hard early but left free to refine texture late, this is the node built for exactly that split.

Same mechanism, more knobs

This is still the same attention-output-steering idea the author described when the identity-transfer family launched: after each active block, the node finds where the generation's features resemble the reference's and pulls them closer, gated by similarity so unrelated regions - new backgrounds, different poses - aren't touched. Advanced's whole contribution is giving you independent strength, range, and curve control over the double-block half and the single-block half of that process, rather than one flat schedule across both.

The inputs that matter

  • model - same requirement as the rest of the family: needs a reference already in the image stream via Multi ReferenceLatent.
  • reference_index - which reference to draw from (0 = first) when multiple are connected.
  • mode - cosine_pull (default, pull toward best matches), topk_replace (only the top-K% most similar tokens), mean_transfer (shift the overall distribution).
  • double_enable / double_strength / double_start / double_end - turn double-block transfer on or off, its cumulative per-block strength, and its range (0–7). The tooltip's own advice: raise double_strength for stronger identity guidance, especially with multiple subjects in the reference.
  • single_enable / single_strength / single_start / single_end - the same four controls for single blocks (0–23), which is where texture and style get refined.
  • block_schedule - how strength varies across the active range: flat (constant), ramp_down (stronger early), ramp_up (stronger late), peak_mid (strongest in the middle).
  • sim_floor - the cosine similarity a match needs to clear to count at all. Low (~0.05) means a wide pull and a tight identity lock, good for subtle edits like outfit swaps; higher means sparser matches and more freedom for broader edits.
  • subject_mask (optional) - restricts the cosine-similarity search to masked-in reference tokens only, without changing what Klein itself sees; mask_threshold sets how strict the pooled mask cutoff is.

Output is a patched MODEL.

Installing it

ComfyUI Manager: search ComfyUI-Flux2Klein-Enhancer, or:

cd ComfyUI/custom_nodes
git clone https://github.com/capitan01R/ComfyUI-Flux2Klein-Enhancer.git

Restart. No extra dependencies.

Where people get burned

The double/single split is the whole point of this node, and skipping past it is the main way people underuse it - leaving both at their flat defaults gives you results close to the plain Identity Feature Transfer node, at the cost of more surface area to configure. The payoff shows up when you deliberately push them apart: strong early (double) transfer for a hard identity lock, weaker or ramp_down single-block transfer so late-stage texture refinement isn't constantly fighting the identity pull.

sim_floor is the field most likely to surprise people, because lower is tighter, not looser - a low similarity floor means more tokens qualify as matches, which locks identity harder, not softer. If your edits feel too rigid and won't follow the prompt, raise sim_floor rather than lowering it.

As with the rest of the family, this needs Multi ReferenceLatent wired upstream to have anything to transfer from - without it, the node runs but has no effect.

Categoryconditioning/flux2klein

Inputs (16)

NameTypeDefaultDescription
modelMODELRequires ReferenceLatent connected. The reference must be in the image stream.
reference_indexINT00–15Which reference image to draw features from when multiple are connected (0 = first).
modeCOMBOcosine_pullcosine_pull: each generation token is pulled toward similar reference tokens. topk_replace: only the top K%% most similar tokens are affected. mean_transfer: shifts the overall feature distribution toward the reference.
top_k_percentFLOAT0.250.01–1topk_replace mode only. Fraction of generation tokens to affect.
double_enableBOOLEANtrueApply transfer on double blocks (0-7). These shape pose, color, and identity early in the network.
double_strengthFLOAT0.150–1Per-block blend factor for double blocks. Cumulative across blocks. Raise for stronger identity guidance, especially when the reference contains multiple subjects.
double_startINT00–7First double block to apply on (0-7).
double_endINT70–7Last double block to apply on (0-7).
single_enableBOOLEANtrueApply transfer on single blocks (0-23). These refine style and texture later in the network.
single_strengthFLOAT0.150–1Per-block blend factor for single blocks. Cumulative across blocks.
single_startINT00–23First single block to apply on (0-23).
single_endINT230–23Last single block to apply on (0-23).
block_scheduleCOMBOflatStrength curve across the active block range. flat = constant. ramp_down = stronger on early blocks. ramp_up = stronger on later blocks. peak_mid = strongest in the middle.
sim_floorFLOAT0.200–0.95Cosine similarity threshold gating which reference-to-generation matches contribute. Low (~0.05) = wide pull, tight identity lock, suited to subtle edits like outfit swaps. High = sparse pull, more freedom for broader edits.
mask_thresholdFLOAT0.500–1Used only when subject_mask is connected. Reference tokens whose pooled mask value falls below this are excluded from the pull. 0.5 keeps boundary tokens; raise toward 1.0 to shrink the effective mask inward.
subject_maskoptMASKOptional subject mask for the reference image. When connected, the cosine pull samples only from masked-in reference tokens, leaving everything else out of the transfer. The conditioning latent is not modified, so the model still sees the full reference. Mask aspect must match the encoded reference aspect.

Outputs (1)

NameTypeDescription
MODELMODEL