Nodes/ComfyUI-Flux-Reference-Tools/Flux Color Anchor ⚡
ComfyUI Node

Flux Color Anchor ⚡

Your multi-reference Flux edit keeps drifting off-color? This is the leash.

By ChrisColeTech·Created 5 days ago·Updated 5 days ago· 2
Flux Color Anchor ⚡
  • model
  • conditioning
  • MODEL
strength0.50
ramp_curve1.5
ref_index0
channel_weightsuniform
debugfalse

Flux edits are great at holding a face or an outfit, but they're rotten at holding a color scheme. You feed in a reference image with warm, moody lighting, the model happily changes the pose, and by step 20 the whole frame has drifted toward a neutral gray-blue. Flux Color Anchor is the node that keeps yanking the color palette back to your reference while everything else stays free.

It's part of the ChrisColeTech/ComfyUI-Flux-Reference-Tools pack - a set of nine "reference conditioning" helpers that work on any Flux-family checkpoint (Flux.1 dev, Kontext, Flux.2 Klein). Color Anchor is the pack's color-correction knob, and it's the one you reach for when your edit looks right structurally but feels chromatically off.

How it works

The node hooks into sampling the honest way: it registers a sampler_post_cfg_function on a cloned model. After ComfyUI's CFGGuider produces its denoised x0 prediction each step, the node compares that prediction's per-channel spatial mean (the average color of the frame, per R/G/B channel in latent space) against the same mean computed from a reference latent sitting in your conditioning. It then shifts denoised toward the reference's means by strength, scaled by a ramp that starts weak and grows.

Two details make it feel less blunt than it sounds. First, the ramp (ramp_curve, default 1.5) means early structure-forming steps barely move while later detail steps get the full color pull - so you don't smear composition to fix tint. Second, channel_weights="by_variance" trusts channels where the reference image has stable color (low variance) more than channels that vary all over the place. Start with uniform; switch to by_variance only if the correction looks over-eager in noisy regions.

The inputs that matter

  • strength (default 0.5) - how hard to pull toward the reference's color means. 0 disables the node entirely.
  • ramp_curve (default 1.5, range 0.5–8) - higher means the pull arrives later in sampling; lower means it bites sooner.
  • ref_index (default 0) - which reference latent to read color from, when you've attached several via Flux Multi Reference Latent.
  • channel_weights - uniform or by_variance.

Output is a single MODEL - wire it into your KSampler. It reads the reference from the conditioning you pass in, so keep conditioning on the same path that carries your reference latents.

Where it sits in the workflow

This is a post-CFG node, which matters more than any other constraint: sampler_post_cfg_function only fires through comfy's real sampling path. You need a stock KSampler (or anything using comfy's normal sampling) for this node to do anything at all. If your workflow uses a hand-rolled sampling loop, Color Anchor silently does nothing - the README says as much, and the code logs "node inactive" rather than erroring.

Typical chain: Flux Multi Reference Latent attaches the refs → Flux Ref Latent Controller scales their influence → Flux Color Anchor (model + conditioning) → KSampler. The node upstream of the KSampler, and only pulls color if you want it to; the ref latent it needs can come from conditioning.

Install

No extra dependencies, no model downloads, no API key. Clone into custom_nodes and restart:

cd ComfyUI/custom_nodes
git clone https://github.com/ChrisColeTech/ComfyUI-Flux-Reference-Tools

Or use ComfyUI Manager and search "ComfyUI-Flux-Reference-Tools". The nodes appear under 🤖 CCTech/Flux Reference. requirements.txt is a comment-only file - the only real dependencies are torch and comfy's own node_helpers, both already in any ComfyUI install.

Common issues

  • Nothing changes. You're almost certainly not sampling through stock KSampler, or your conditioning has no reference latents attached. Check you ran a reference-attachment node first.
  • Colors get flattened. Your strength is too high. This pulls toward a single per-channel mean, so at 1.0 you're effectively grading the whole frame to one tint. 0.3–0.5 is a saner band.
  • Klein especially. Klein edits are fast and clean, but the pack's own lineage is Klein-flavored; if your Klein edit drifts, this node is the designed fix.
Category🤖 CCTech/Flux Reference

Inputs (7)

NameTypeDefaultDescription
modelMODEL
conditioningCONDITIONING
strengthFLOAT0.500–1
ramp_curveoptFLOAT1.50.5–8
ref_indexoptINT00–63
channel_weightsoptCOMBOuniform2 options: uniform, by_variance
debugoptBOOLEANfalse

Outputs (1)

NameTypeDescription
MODELMODEL