Nodes/Flux_ID_Adjuster/FLUX Identity Adjuster
ComfyUI Node

FLUX Identity Adjuster

Klein 9B's likeness dial, no LoRA required

By Magirad·Created 4 months ago·Updated 4 months ago· 59
FLUX Identity Adjuster
  • model
  • subject_mask
  • MODEL
layout_blocks3-7
identity_blocks8-19
saliency_scan_blocks6-23
photorealistic_smoothingtrue
total_sampling_steps4
boost_fade_curveEase-In
identity_strength1.50
background_text_strength0.60
dynamic_text_balancingtrue
target_likeness_metric0.35
soft_blend_k1
face_isolation_strictness1.00
confidence_gate0.15
hard_anchor_margin0.06
contrast_and_texture_floor0.18

FLUX Identity Adjuster (class FluxIDAutoAdjuster) is a one-wire patch for Flux.2 Klein 9B that pushes a reference face into the generation at sampling time, so you get the same person in a new scene without training a LoRA. Klein is already the strongest local editor of its size - its whole party trick is multi-reference consistency - but it drifts when your prompt gets ambitious, and it still has that glossy "Flux skin" problem the community has been complaining about since 2024. This node exists to fix both: it re-weights the model's attention so identity wins where it should and your text styling wins everywhere else.

It comes from Magirad, the r/StableDiffusion handle of the author (who posts as Stock_Mycologist1104). This is a vibe-coded node - the author says so himself, three AIs and a week and a half - tested almost entirely on the Klein 9B fp8 distilled checkpoint from an RTX 2060. Treat the defaults as a starting point, not gospel.

How the trick actually works

The node has one model input and one output. It clones your model, wraps the UNet function, and patches the attention output - everything happens invisibly inside the sampler call.

During denoising, the Flux 2 reference image rides in through the model's context as extra tokens, and the node compares the generated tokens' attention vectors to those reference tokens using cosine similarity. In the first couple of steps a "saliency radar" scans blocks 6–23 to figure out which reference tokens are actually the face. After that it soft-pulls each generated token toward its best reference match, and when the same match survives several steps with enough margin it "commits" that token as a hard anchor - the eyes, the lips - and snaps it at full strength. If your likeness score is under the target_likeness_metric, it pulls harder; if it's over, it lets the text prompt breathe so the background and style still read.

Two block groups do different jobs: the layout (double) blocks 3–7 run at a fraction of the identity strength specifically to stop Janus artifacts, while the identity (single) blocks 8–19 carry the face at full power. And when photorealistic_smoothing is on, the patch runs an FFT low-pass filter on the attention delta to strip high-frequency static - that's the "mathematically deletes noise" bit, and it's why faces come out less waxy.

The inputs that matter

Most of the 15 knobs are tuned well enough to leave alone. The ones you'll actually touch:

  • total_sampling_steps (default 4) - must match your KSampler steps exactly. Klein's distilled checkpoints run 4 steps, so 4 is right out of the box; change one, change the other.
  • identity_strength (default 1.5, range 0–3) - the main likeness dial. Crank it and faces get tighter but poses stiffen.
  • background_text_strength (default 0.6) - how hard the prompt fights for the background. The node auto-mutes it during delicate anatomy phases.
  • photorealistic_smoothing (default on) - off to preserve brushstrokes and film grain for art; on for real skin.

Output is a single MODEL, wired into the KSampler's model input. That's it - one wire.

Setting it up

The README's install is the boring, reliable one:

cd ComfyUI/custom_nodes
git clone https://github.com/Magirad/Flux_ID_Adjuster.git

Restart ComfyUI and you should see "[FLUX Identity Projector] Loaded Successfully." in the console. No model downloads, no pip installs - the source only needs torch and numpy, which you already have.

There's no reference-image input on the node itself. The reference enters through ComfyUI's official Flux 2 Klein image-editing workflow (the reference-image nodes that feed the model), which is exactly what the bundled example does: Load Image → reference conditioning → this node → KSampler.

Where people get burned

The big one, reported by a real user on an RTX 5080: enabled vs disabled makes zero difference. That's not a crash - it's a silent no-op. If the model has no reference tokens in context (a plain text-to-image graph), the patch returns attention untouched by design. If you see no change, your reference image isn't actually wired into the model.

Second: steps mismatch. If your KSampler runs 20 steps but total_sampling_steps says 4, the internal fade curve and step counting inject at the wrong anatomical phases and identity lands late or not at all. Keep them synced.

Third: it's Klein-9B-only, and the author tested the normal KSampler exclusively - he's upfront that advanced/custom samplers are untested territory. If you're on Z-Image or Flux 2 Dev, this won't help you; skip it.

The takeaway: if Klein 9B is your daily driver and you're fighting for the same face across scenes, this is a genuinely useful, zero-cost lever - just don't expect it to behave in any workflow you can dream up. It wants the reference in the model and the steps matched.

CategoryAdvanced/Model Bending

Inputs (17)

NameTypeDefaultDescription
modelMODEL
layout_blocksSTRING3-7Double Blocks. Establishes global layout and integrates the subject into the background safely. Anchors run at 25% strength to prevent Janus artifacts.
identity_blocksSTRING8-19Single Blocks. Synthesizes high-frequency identity, facial micro-geometry, and photorealism. Hard snapping runs at 100% strength here.
saliency_scan_blocksSTRING6-23The specific blocks where the script analyzes the canvas to dynamically isolate the face from the background during Step 1.
photorealistic_smoothingBOOLEANtrueON = Mathematically deletes static/noise for photorealistic skin. OFF = Transfers raw reference textures like brushstrokes or film grain.
total_sampling_stepsINT41–100MUST match your KSampler steps! Syncs the internal curve to ensure style and geometry inject at the correct anatomical phases.
boost_fade_curveCOMBOEase-InControls how the identity injection fades out over time. Ease-In is highly recommended for preserving late-stage text styling.
identity_strengthFLOAT1.500–3Primary multiplier for facial likeness. Higher values force a stronger resemblance but may stiffen the pose.
background_text_strengthFLOAT0.600–10Amplifies the text prompt to construct the background. Automatically muted during delicate anatomy phases (Step 2).
dynamic_text_balancingBOOLEANtrueON = Automatically throttles text strength when the face is struggling to form, preventing the prompt from crushing the identity.
target_likeness_metricFLOAT0.35-1–1The raw cosine goal. 0.35 is mathematically ideal for Flux. Pushing higher forces aggressive pulling; lower allows more stylistic freedom.
soft_blend_kINT11–10Averages the top K matches for smooth skin and soft regions. Committed anchors ignore this and snap exactly to K=1 for sharp eyes/lips.
face_isolation_strictnessFLOAT1.000.01–1Top % of tokens to lock as the 'Face'. 1.0 pulls the full body/background. Lower values (e.g., 0.35) isolate just the face for hybrids.
confidence_gateFLOAT0.150–1Minimum confidence required to soft-pull a token. Higher values prevent artifacts but might freeze rendering. 0.0 disables the gate.
hard_anchor_marginFLOAT0.060–0.2The margin difference required to permanently lock a token (like a pupil). Lower means anchors lock faster; higher requires absolute certainty.
contrast_and_texture_floorFLOAT0.18-1–1Base similarity cutoff. Increasing this boosts visual contrast and removes noise, but pushing too high creates waxy, over-smoothed skin.
subject_maskoptMASKOptional. Restricts the Saliency Radar to only consider tokens inside this drawn area.

Outputs (1)

NameTypeDescription
MODELMODEL