Nodes/Link Comfy Nodes/Match Color Palette
ComfyUI Node

Match Color Palette

Grade one image's colors onto another with Reinhard Lab transfer

By Mister-Link·Created 9 months ago·Updated 25 days ago· 0
Match Color Palette
  • image_ref
  • image_target
  • graded_images

You generated a batch of frames and they don't match your reference plate. Or you're stitching together clips from two different generations and the color temperature jumps between them. Or an i2v run has slowly drifted warmer than the source image it started from. All the same problem: two images (or an image and a batch) that should share a look, and don't. Match Color Palette forces one onto the other's color statistics in a single pass - no manual curves, no color-match layer stack in Photoshop.

How it works

The pack's own README calls this "Reinhard Lab color grading," and that's a real, well-known technique - the 2001 Reinhard/Ashikhmin/Gooch/Shirley "Color Transfer between Images" method. The mechanism is simple once you know it: convert both images to Lab color space (which separates lightness from color, unlike RGB), then shift the target image's per-channel mean and standard deviation to match the reference's. Convert back to RGB and you're done. It's a statistical match, not a content-aware one - it doesn't know what's a face versus what's a sky, it just makes the target's overall color distribution look like the reference's.

That matters for what this node is good at and what it isn't. It's excellent at fixing an overall color-temperature or saturation mismatch between two shots of similar content. It's not going to relight a night scene to match a daytime reference convincingly - statistics can only take you so far when the underlying content is very different.

The inputs and outputs that matter

Just two required inputs, and no strength dial - this is a full match, not a blend:

  • image_ref - the image whose color palette you want to copy. This is your target look.
  • image_target - the image (or batch) getting re-graded. Because ComfyUI's IMAGE type is inherently batched, image_target can be a whole sequence of frames, not just one - feed it a video's worth of frames and every one gets graded against the same single reference. That's the practical use case in a pack this focused on WAN video work: lock a whole clip's color grade to one anchor frame instead of letting it drift shot to shot.

One output: graded_images - the re-graded result, same shape as image_target, ready to feed into your save node, upscaler, or whatever comes next.

How to install it

Search "Link Comfy Nodes" in ComfyUI Manager and install from there. Or by hand:

cd ComfyUI/custom_nodes
git clone https://github.com/Mister-Link/link-comfy-nodes
pip install -r link-comfy-nodes/requirements.txt

Restart ComfyUI. This is a lightweight color-math node inside a much bigger pack - no extra models or heavy dependencies specific to this one.

Common issues & troubleshooting

Reference and target don't share lighting conditions. Reinhard transfer is statistics-only, so a reference shot in warm indoor light applied to a target shot in cool daylight will push the target's whole palette warm rather than doing anything intelligent about the mismatch. Pick a reference that's actually representative of the look you want, ideally from similar lighting to the bulk of your target frames.

Low-color-variety images give weird results. If your reference is mostly one or two colors (a flat background, a solid-color card), its mean/std statistics are thin, and the transfer can push the target toward an oddly narrow palette. A reference with a reasonably full range of tones grades more predictably.

No partial-strength option. Because there's no strength parameter, you can't dial in a subtle nudge - it's the full statistical match or nothing. If you need a lighter touch, the workaround is compositing: blend the graded output back with the original at whatever opacity looks right, outside this node.

Alpha and transparency aren't handled. Both inputs are plain IMAGE, so if you're working with RGBA content, split off the alpha channel first and reattach it after grading - this node only touches color.

Categorycolor

Inputs (2)

NameTypeDefaultDescription
image_refIMAGE
image_targetIMAGE

Outputs (1)

NameTypeDescription
graded_imagesIMAGE