LCS Color Anchor
The zero-config fix for mid-generation color drift
- model
- lcs_data
- vae
- reference_image
- mask
- model
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
model→lcs_data→ leavemodeon 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_imagetogether flip auto into reference mode ("keep it close to this photo's palette"). Amaskwith 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.
Inputs (7)
| Name | Type | Default | Description |
|---|---|---|---|
| model | MODEL | — | |
| lcs_data | LCS_DATA | Calibration data from LCSLoadData | |
| mode | COMBO | auto | auto: infer mode and intensity from connected inputs; smooth: bilateral filter; reference: anchor to image; self_anchor: auto-detect drift |
| intensity | FLOAT | 0.500–1 | Correction intensity (0 = none, 1 = full) |
| vaeopt | VAE | Required for reference mode (VAE-encodes reference image) | |
| reference_imageopt | IMAGE | Reference image for reference mode | |
| maskopt | MASK | Optional mask for localized correction |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| model | MODEL | — |