Nodes/WAS Node Suite v3/Image Color Match
ComfyUI Node Runs on cloud

Image Color Match

Match a whole batch to one frame's look — flicker-free

By WASasquatch·Created 3 years ago·Updated 4 days ago· 1,844
Image Color Match
  • images
  • reference
  • IMAGE
methodmkl
color_spaceLab
strength1.00
luminance_onlyfalse
regrain_strength0.00

The colors are off. Maybe your batch of frames drifted warm as it rendered, maybe you cut a subject out of one image and it refuses to sit in the background's light, maybe you upscaled a tile and it glows against its neighbors. The expensive habit is to re-roll the generation and hope the seed gods fix it. The cheap fix is a colour match: take the offending pixels and move their statistics onto a reference. That's what this node does, and the twist that makes it worth your time is in its name - Image Color Match matches a whole batch to one reference using a single fixed transform, which is exactly what keeps an image sequence from flickering.

It lives under WAS Suite/Image/Adjustment in the Add Node menu. Feed it two IMAGE inputs: images (the batch to fix, and every frame gets the same treatment) and reference (the look you're aiming at). Out comes your batch, re-graded. If your images carry an alpha channel, it's passed through untouched - the node only touches colour.

How it actually works

The important part is the word "fixed." ComfyUI's own node graph will happily let you do something like this per-image, but per-frame matching that recalculates against each frame's own statistics will pump and shimmer on video. This node measures the reference's colour distribution once - as a mean and covariance, or mean and standard deviation, or a whole sorted tonal curve - then applies that one transform to every frame in the batch. Nothing about the transform changes between frames, so nothing can flicker. The reference batch itself is pooled into a single distribution too, not read from its first frame.

Which method you pick changes what "the look" means:

  • mkl (default) matches the full colour covariance - brightness and how colours correlate with each other. It keeps hue the most accurate, at the cost of being the heaviest. This is the one to reach for when you want the whites of someone's eyes to stay white.
  • reinhard matches only mean and standard deviation per channel. It's the cheap classic (it's basically the transfer everyone's colour-match node is copying), fast, but it can shift hue and it does nothing about contrast.
  • histogram matches the entire tonal curve, so it also fixes contrast and gamma mismatches - handy when your footage is just flat. Its trade is that it can band or blotch, which is what the regrain_strength knob exists to fix by blending a bit of each pixel's original local value back in.

Do the matching in Lab colour space (the default) and brightness is separated from colour, which keeps mkl and histogram holding hue steadier. RGB is cheaper and skips the round trip, at the cost of some hue drift. strength from 0 to 1 blends between "unchanged" and "full match" - and honestly, a partial match like 0.5–0.8 often reads more natural than a hard 100% on a re-graded batch. luminance_only only does anything for reinhard, and it's the trick for "match the brightness, keep my own colour cast."

Where people actually use it

Three jobs, all from the same family: making an inpainted or outpainted region agree with the original it was cut out of, making a tiled upscale's edges match their neighbours, and making a composited subject sit in a new scene's light instead of floating above it. The rule of thumb from the post-processing crowd applies: reach for the deterministic, instant fix before you burn a diffusion pass. The batch behaviour is the bonus - match a whole frame sequence to one graded still and your video comes out looking like one continuous shot.

Installing and running it

The node ships in WAS Node Suite v3 (WASasquatch/was-node-suite-comfyui), WASasquatch's long-running MIT pack - over a million downloads, going since 2023. The v3 rewrite is notable for what it doesn't do: no default pip packages, nothing downloaded. Color matching runs on torch, on ComfyUI's own device.

Install via ComfyUI Manager (search WAS Node Suite v3), or manually:

cd ComfyUI/custom_nodes
git clone https://github.com/WASasquatch/was-node-suite-comfyui

Then restart ComfyUI. It needs ComfyUI 0.14.0+ and Python 3.10+. The first start is a second or two slower while it writes its config.yaml under your ComfyUI user directory - that's normal.

Where people get burned: histogram blotches and they don't notice regrain_strength exists; reinhard shifts skin hue and they don't know mkl holds it steadier; or they feed a 20-frame clip and expect the result to match the last frame instead of the whole reference batch's pooled look. Each has a one-knob fix. Match on a single frame first to see what each method does to your footage - the methods disagree most on skin and saturated colour.

CategoryWAS Suite/Image/Adjustment

Inputs (7)

NameTypeDefaultDescription
imagesIMAGEBatch to correct; IMAGE. Every frame gets the same transform.
referenceIMAGETarget colour; IMAGE. A batch is pooled into one distribution, not just its first frame.
methodCOMBOmkl`mkl`: matches full covariance, keeps hue accurate. `reinhard`: matches mean/std per channel, cheap, can shift hue. `histogram`: matches the whole tonal curve, fixes contrast/gamma too, can blotch without regrain_strength.
color_spaceCOMBOLab`Lab` separates brightness from colour, so `mkl` and `histogram` hold hue steadier. `RGB` is cheaper and skips a colour-space round trip.
strengthFLOAT1.000–1How much of the match applies; FLOAT. 0 = unchanged, 1 = full match.
luminance_onlyBOOLEANfalse`reinhard` only: match brightness, leave the batch's own colour cast alone. No effect on `mkl` or `histogram`.
regrain_strengthFLOAT0.000–1`histogram` only: blend back this much of each pixel's original local value, to fix banding. No effect on `mkl` or `reinhard`.

Outputs (1)

NameTypeDescription
IMAGEIMAGEimages with reference's colour applied; IMAGE.