FLUX.2 Klein Reference Latent Mixer
The honest reference-strength dial for FLUX.2 Klein edits
- conditioning
- CONDITIONING
Klein edits carry your source image into the model as reference latents - separate conditioning metadata, not part of the text-conditioning tensor. The moment you want an edit to stray further from the source, or hold tighter to it, you're reaching for a reference-strength control that ComfyUI's stock Klein nodes don't really give you. This is that control.
The FLUX.2 Klein Reference Latent Mixer is deliberately named a mixer, not a booster. That's a design decision, and it's the honest one. Raw latent multiplication to make the reference stronger than baseline is a known shaky claim - there's an open issue in the source repo this pack was rebuilt from literally questioning whether it works. What reliably works is weakening and fading. So this node gives you dependable ways to turn the reference down, and it does it by changing the latent's content, not just its amplitude.
How it works
The reference latents live in your conditioning metadata under reference_latents. The node reads them, mixes each toward a replacement, and writes them back - leaving the text conditioning untouched. The mix amount is reference_keep (0–1): 1 keeps the reference as-is, 0 fully replaces it with whatever replace_mode says:
zeros- the strongest weakening. The reference signal basically disappears.gaussian_noise- replaces with noise scaled to the latent's own standard deviation. Loosens structure while keeping a latent-like signal, so the sampler doesn't choke on a flat input.channel_mean- replaces each channel with its spatial mean. Kills local structure, keeps coarse per-channel statistics. Weird, subtle, occasionally exactly right.lowpass_reference- replaces with a blurred copy of the original reference. This is the interesting one: it keeps broad color and illumination cues while dropping the fine detail lock. Great when you want to loosen how tightly Klein clings to the source's texture without discarding its palette.
Then the finer levers: channel_mask_start / channel_mask_end restrict the whole thing to a slice of latent channels, and spatial_fade (center_out, edges_out, top_down, left_right) with spatial_fade_strength fades the effect across the spatial field - handy for edits where you want the center of the frame to stay faithful but the edges to drift.
The multi-reference part matters if you edit with more than one source image: target_reference_index defaults to -1, which updates all references. The original repo it was rebuilt from only touched reference_latents[0], which was quietly wrong for multi-reference edits. Set a specific index if you want to weaken only one source.
Inputs that matter
reference_keep- the main dial. 0.6–0.9 for "loosen slightly," 0.3 and below for "barely a reference."replace_mode- pick your target.zerosfor true reference-off,lowpass_referencewhen you want to keep the colors.target_reference_index--1for all, or a specific one.
Output is a CONDITIONING, wired back into your sampler path.
Install and gotchas
Same pack, same install as the others - ComfyUI Manager search "Flux2Klein", or:
cd ComfyUI/custom_nodes
git clone https://github.com/xmarre/ComfyUI-Flux2Klein-Conditioning-Toolkit
Restart. No models, no deps beyond torch.
One caveat the README states plainly: the node assumes Klein conditioning metadata uses the reference_latents key the way the source repo described. If your conditioning doesn't carry that key (say you're feeding it conditioning from a text encoder with no reference path), the node passes it through untouched. So the mixer has to sit after the node that adds the reference latents - usually the reference/KSampler conditioning node - and before the sampler. And remember: reference_keep = 1.0 means "leave the reference alone," which is also what makes the node a no-op and hand the tensor straight through.
Inputs (9)
| Name | Type | Default | Description |
|---|---|---|---|
| conditioning | CONDITIONING | — | |
| reference_keep | FLOAT | 1.000–1 | — |
| replace_modeopt | COMBO | zeros | 4 options: zeros, gaussian_noise, channel_mean, lowpass_reference |
| channel_mask_startopt | INT | 00–4096 | — |
| channel_mask_endopt | INT | 1280–4096 | — |
| spatial_fadeopt | COMBO | none | 5 options: none, center_out, edges_out, top_down, left_right |
| spatial_fade_strengthopt | FLOAT | 0.500–1 | — |
| target_reference_indexopt | INT | -1-1–64 | — |
| debugopt | BOOLEAN | false | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| CONDITIONING | CONDITIONING | — |