ComfyUI Node

TBG Model Agnostic Color Anchor

TBG Model Agnostic Color Anchor

By Ltamann·Created about a year ago·Updated 19 days ago· 156
TBG Model Agnostic Color Anchor
  • model
  • model
strength0.00
start_percent0.00
end_percent1.00
ramp_curve1.50

Color drift is the classic img2img/refinement failure: your upscale comes back with the same composition but the whites went yellow and the skin got a green cast. The usual fix is post-hoc color matching - patches after the fact, trying to pull the image back. This node fixes it during sampling instead. It's a model patch that locks the per-channel spatial mean of the latent to your source image's latent, so the overall color grade simply can't wander. It's called "model agnostic" because it patches any model's sampling the same way - FLUX, Qwen, SDXL, whatever you've got.

It's a standalone node extracted from TBG ETUR (Tobias Laarmann's tiled upscaler-and-refiner pack), one of the "lightweight takeaway nodes" the 1.2 release spun out of the big ETUR graph. Where the full Refiner has tile-aware color stabilization built in, this is the stripped-down version you drop into any workflow.

How it works

The node patches the model so that during sampling it computes the per-channel spatial mean of the source latent - the VAE-encoded input image - and steers the denoised latent's mean back toward it, weighted by strength. Crucially, it does this over a controllable window: start_percent to end_percent define where in the sampler-step progress the lock turns on and off, and ramp_curve shapes how quickly it arrives (higher curve values = the effect kicks in earlier in that window).

The one gotcha is in the tooltip, and it's easy to miss: "The sampler must receive the primary VAE-encoded source/input image latent. Do not use this with an Empty Latent if you expect source-image color preservation." If your graph uses an Empty Latent, there is no source color to preserve - the anchor is locking to noise. Wire a real encoded image latent into the sampler.

Inputs

  • model - the model to patch. Output is the patched model, same slot.
  • strength (0.0) - how hard to lock the mean. Starts at 0 (disabled, so the node is a no-op until you turn it up). You'll typically live between 0.2 and 0.8.
  • start_percent (0.0) / end_percent (1.0) - the lock window across sampling progress. Defaults run the whole way; narrowing it means the model gets creative freedom early and you pin the grade later.
  • ramp_curve (1.5) - the arrival curve. Higher = effect arrives earlier in the window.

Output: a single model, which you chain into your KSampler. In TBG's own graph you can also feed it into the Refiner's pipeline if you want the anchor applied on top of tile fusion.

Install

Part of the whole pack:

cd ComfyUI/custom_nodes
git clone https://github.com/Ltamann/ComfyUI-TBG-ETUR
cd ComfyUI-TBG-ETUR && pip install -r requirements.txt

or ComfyUI Manager → "TBG Enhanced Upscaler," restart. Needs a current ComfyUI (v3 API) and the pack's heavy requirements.

Common issues

  • Nothing happens - strength defaults to 0, which is "disabled." Turn it up before you debug anything else.
  • No color preservation with Empty Latent - read the tooltip again: the anchor is only meaningful when the sampler's input latent is a real VAE-encoded image. This is the #1 misconfiguration, and it's not a bug.
  • Overshoot - at high strength on a low-denoise job, the mean-lock can fight the model and produce a flat, hazy look. Back the strength off rather than shrinking the window; the mean lock is a blunt instrument by design.
CategoryTBG/ETUR Tiled Upscaler and Refiner

Inputs (5)

NameTypeDefaultDescription
modelMODEL
strengthFLOAT0.000–1How strongly to preserve the sampler input latent per-channel spatial mean. The sampler must receive the primary VAE-encoded source/input image latent. Do not use this with an Empty Latent if you expect source-image color preservation. 0 disables.
start_percentFLOAT0.000–1Linear sampler-step progress where the mean lock starts. 0.0 starts at the first sampler step.
end_percentFLOAT1.000–1Linear sampler-step progress where the mean lock ends. 1.0 ends at the last sampler step.
ramp_curveFLOAT1.500.1–8Progress curve for applying the mean lock over sampler steps. Higher values make the effect arrive earlier.

Outputs (1)

NameTypeDescription
modelMODEL