Nodes/LCS/LCS Color Anchor
ComfyUI Node

LCS Color Anchor

The zero-config fix for mid-generation color drift

By facok·Created 6 months ago·Updated 2 months ago· 160
LCS Color Anchor
  • model
  • lcs_data
  • vae
  • reference_image
  • mask
  • model
modeauto
intensity0.50

It fixes the "why did my sky turn purple" problem

You queue a 50-step generation, everything looks right at step 20, and by step 45 the sky has drifted purple. Or you inpaint a region and there's a visible color seam where your patch meets the original image. That's color drift during sampling, and it's exactly what LCS Color Anchor is for - no reference image, no tuning, no LoRA.

The pack (facok/ComfyUI-LCS) is a community implementation of "The Latent Color Subspace" research: color in the latent patch space lives in a 3D subspace, separate from the 61 dimensions of structure and detail. Most LCS nodes push colors toward a target. Color Anchor instead keeps the colors the model is already producing stable - it anchors them in place.

How it works

It's a sampler patch. The node clones your model, installs a post-CFG hook, and at every step decides whether it's safe to correct. Early steps are mostly noise → skipped (or, in self_anchor mode, used to learn the image's color relationships). Middle steps → a correction applied with a smooth ramp in and out. Late steps → skipped again, so fine detail isn't disturbed. Only the 3D color coordinates change; structure, texture, and detail are never touched.

The inputs that matter

  • modellcs_data → leave mode on auto. That's the whole config. In auto mode the node measures actual drift and picks its own correction strength (the README cites a 0.15–0.6 range), so it never over-corrects or does nothing.
  • intensity (0–1) - manual control only when you're not in auto. Set to 0 and the node disables itself entirely.
  • Optional vae + reference_image together flip auto into reference mode ("keep it close to this photo's palette"). A mask with no reference flips auto into smooth mode, which blurs color seams - the inpainting fix.

Output is a single model, wired into your KSampler.

Reference mode is a two-input trap

This is where people get burned: reference mode needs both reference_image and vae, and the node checks before patching. If one is missing it prints a warning and silently skips - your drift fix just disabled itself. Auto mode picks reference only when both are connected, so hooking up an image but forgetting the VAE quietly neuters the node. If you want full control instead, set mode to smooth, reference, or self_anchor explicitly and dial intensity yourself.

Install & first run

cd ComfyUI/custom_nodes
git clone https://github.com/facok/ComfyUI-LCS.git

Then restart. The only dependencies are einops + safetensors, usually already present. You need an LCS Load Data node feeding lcs_data - that's the pack's calibration node, and its first run per VAE is slow on purpose (512 VAE encodes), then cached.

When to reach for it

Inpainting with visible seams, characters whose skin tone wanders across a long run, or any workflow where you keep re-seeding because the color balance shifted. If you want to force a specific color instead of stabilizing the current one, that's LCS Color Intervene's job - Anchor is the "don't let it drift" option. One tip from the README: on step-distilled models (z-image-turbo and friends) that run few steps, start interventions earlier - even from step 0.

CategoryLCS/intervention

Inputs (7)

NameTypeDefaultDescription
modelMODEL
lcs_dataLCS_DATACalibration data from LCSLoadData
modeCOMBOautoauto: infer mode and intensity from connected inputs; smooth: bilateral filter; reference: anchor to image; self_anchor: auto-detect drift
intensityFLOAT0.500–1Correction intensity (0 = none, 1 = full)
vaeoptVAERequired for reference mode (VAE-encodes reference image)
reference_imageoptIMAGEReference image for reference mode
maskoptMASKOptional mask for localized correction

Outputs (1)

NameTypeDescription
modelMODEL