Nodes/ComfyUI-Nunchaku-Klein/Nunchaku FLUX.2 Klein Color Anchor
ComfyUI Node

Nunchaku FLUX.2 Klein Color Anchor

The fix for Klein's warm color-shift-on-edit problem

By tom-m-2020·Created 2 months ago·Updated 17 days ago· 2
Nunchaku FLUX.2 Klein Color Anchor
  • model
  • conditioning
  • MODEL
strength0.50
ramp_curve1.5
ref_index0
channel_weightsuniform
debugfalse

Klein has a reproducible habit: edit a photo and the whole thing drifts warmer. Community tests confirmed it on fp8 and fp16, independent of quantization - change one thing and the color temperature slides. People fixed it with histogram matching afterwards, one tile at a time. This node fixes it during sampling instead. The NunchakuKleinColorAnchor anchors the output's color to a reference latent while the model denoises, so the palette stays put while the content changes.

Why you'd reach for it

If you do any Klein editing with references, the warm cast is the first thing you'll notice on a second edit. This node sits on the MODEL branch (it's a post-CFG patch, not a conditioning patch) and pulls the colors back toward the reference each step. It's one of the genuinely useful small wins in this pack - it exists because the underlying problem is real and measured, and the node is engineered around that specific failure mode.

The inputs that matter

  • model - from the pack's NunchakuKleinModelLoader.
  • conditioning - must carry the reference latents; this is where it reads colors from.
  • strength - max correction strength, 0-1, default 0.5. The tooltip's guidance is spot on: 0.3-0.6 is the starting range. Too high and you override the model's color decisions entirely and every edit comes out looking like a copy of the reference.
  • ramp_curve - shapes when correction kicks in, via progress^(1/curve). 1.0 is linear; for 4-8 step distilled schedules, values of 2-4 work best because the correction reaches useful strength early while the later steps run freer. The tooltip says this explicitly and it's worth listening to.
  • ref_index - which reference latent to anchor from (0-63). Pick the one whose colors you trust.
  • channel_weights - uniform corrects all channels equally; by_variance weights correction by how stable each channel's mean is in the reference, trusting stable channels more. by_variance is the smarter default for noisy refs.

Output: MODEL, chained toward the KSampler.

Wiring and install

Reference latents → conditioning, and the MODEL from the loader passes through this node on the way to the sampler. Same pack install as everything here:

cd ComfyUI/custom_nodes
git clone https://github.com/tom-m-2020/ComfyUI-Nunchaku-Klein

Backend: Vitoom Nunchaku wheel from huggingface.co/tonera/vitoom-nunchaku, tonera's Klein checkpoint in diffusion_models/.

Common issues

  • Output still warm - strength too low for your step count; bump it toward 0.6 and try a higher ramp_curve so correction lands early in a 4-step schedule.
  • Output looks like a clone of the reference - strength too high. Dial back to 0.4 and lean on by_variance so you're correcting statistics, not copying pixels.
  • No effect on plain T2I - expected; there's no reference to anchor to.
CategoryNunchaku/FLUX.2 Klein/Enhancer/Post-CFG

Inputs (7)

NameTypeDefaultDescription
modelMODEL
conditioningCONDITIONING
strengthFLOAT0.500–1Maximum correction strength. 0.3-0.6 is a good starting range. Too high and you override the model's color decisions entirely.
ramp_curveoptFLOAT1.50.5–8Controls the shape of the correction ramp. Formula: progress^(1/curve). 1.0 = linear. >1 = fast start, tapers off (e.g. sqrt for curve=2). <1 = slow start, aggressive late (e.g. squared for curve=0.5). For few-step schedules (4-8 steps) values of 2-4 work well because they reach useful strength quickly.
ref_indexoptINT00–63Which reference latent to anchor colors from.
channel_weightsoptCOMBOuniformuniform: correct all channels equally. by_variance: weight correction by how stable each channel's mean is in the reference (low-variance channels trusted more).
debugoptBOOLEANfalse

Outputs (1)

NameTypeDescription
MODELMODEL