Flux Identity Guidance ⚡
When a reference image won't hold the face, pull the whole latent toward it
- model
- identity_latent
- MODEL
Reference conditioning gets you maybe 80% of the way to a consistent identity. The last 20% - the thing where the subject's face drifts into a different person by the end of a chain of edits - is what Flux Identity Guidance is for. Where the other nodes in this pack steer attention, this one steers the actual denoised prediction: every step, it nudges the model's x0 toward a VAE-encoded reference latent, so the pixels themselves get pulled back on course.
It's from the same ChrisColeTech/ComfyUI-Flux-Reference-Tools pack as Flux Color Anchor, and it's the heavier sibling. Color Anchor only chases color means; Identity Guidance can chase the whole latent.
How it works
Same plumbing family as Color Anchor: the node clones your model and registers a sampler_post_cfg_function, which fires after each CFG step through comfy's own sampling path. It computes a progress value from the current sigma and only acts inside the window you set with start_percent and end_percent (defaults 0.0 to 0.8 - so it leaves the last 20% of sampling alone, which protects fine detail). The reference latent is resized/padded to match the denoised prediction's shape, and then one of three blend modes applies:
- adaptive (default) - weights the pull per-pixel by cosine similarity between the prediction and the reference. Where the prediction already looks like the reference, it leans in; where they disagree, it holds back. This is the mode that usually does the right thing without you thinking about it.
- direct - a straight linear blend toward the reference at
strength. Stronger, blunter, faster to overcorrect. - channel_match - matches the per-channel mean and standard deviation of the prediction to the reference's. This is essentially "match the color grade and contrast statistics," the gentlest of the three, closest to what Color Anchor does with extra math.
The inputs that matter
- identity_latent - the tooltip is the whole story: "VAE-encoded reference image at full resolution." Encode your reference image with the same VAE your checkpoint uses. The tooltip says full resolution for a reason - a small or low-detail reference gives the pull less to work with.
- strength (default 0.3) - how hard each in-window step pulls. 0.3 is a good starting point; this is a strong correction, so go up in 0.05 steps.
- start_percent / end_percent - the sigma window. Shortening the window (say 0.2 → 0.7) confines the pull to the composition-forming phase.
- mode - adaptive / direct / channel_match.
Output is a single MODEL - upstream of your KSampler. Note there's no conditioning input: the identity latent comes straight into the node, independent of whatever reference latents are flowing through your conditioning path.
Where it sits in the workflow
This is the node to add when a multi-reference Klein or Flux edit has the right subject but keeps losing the face across a chain of edits - exactly the "identity drift on faces" failure the community hit with edit models generally (see the KB's character-consistency writeup: each edit pass re-emits the frame, and faces slide). Wire it in after your reference setup, before the KSampler.
And yes - the KSampler requirement from Color Anchor applies here too. sampler_post_cfg_function only fires through comfy's CFGGuider, so stock KSampler (or anything using comfy's normal sampling path) is mandatory. Hand-rolled sampling loops will silently ignore this node.
Install
Same pack, same install as the rest of the family - no extra deps, no models to download:
cd ComfyUI/custom_nodes
git clone https://github.com/ChrisColeTech/ComfyUI-Flux-Reference-Tools
Restart ComfyUI and look under 🤖 CCTech/Flux Reference (or search "Flux Identity Guidance").
Common issues
- Face looks pasted on / "IP-Adapter-ish".
directmode at high strength does that. Drop toadaptiveorchannel_match, or narrow the sigma window. - Details get smeared. Your window runs too late into sampling. Push
end_percentbelow 0.7 so the final refinement steps are left alone. - Nothing happens. Stock KSampler again - this node is dead weight on any custom sampling path. And double-check the reference was VAE-encoded at full resolution, not a tiny thumbnail.
Inputs (6)
| Name | Type | Default | Description |
|---|---|---|---|
| model | MODEL | — | |
| identity_latent | LATENT | VAE-encoded reference image at full resolution. | |
| strength | FLOAT | 0.300–1 | — |
| start_percent | FLOAT | 0.000–1 | — |
| end_percent | FLOAT | 0.800–1 | — |
| mode | COMBO | adaptive | 3 options: adaptive, direct, channel_match |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| MODEL | MODEL | — |