Nodes/ComfyUI Easy Use/Image Color Match
ComfyUI Node Runs on cloud

Image Color Match

Match one image's colors to another

By yolain·Created 3 years ago·Updated 8 days ago· 2,633
Image Color Match
  • image_ref
  • image_target
  • image
method
image_outputPreview
save_prefixComfyUI

You upscaled a frame and it came back a touch warmer than the original. You ran img2img and the palette drifted. You stitched two segments together and the color doesn't quite line up at the seam. easy imageColorMatch fixes all of those in one pass: give it a reference image and a target, and it re-grades the target so its colors match the reference. No manual curves, no eyeballing.

How it works

Every image has a distribution of color - how much sits in the reds, where the shadows lean, how the midtones spread. Color matching reads the reference's distribution and warps the target's to line up with it. It's classical color-transfer math from the color-grading world, not an AI model, which is why it's fast, repeatable, and doesn't hallucinate detail. The node offers several published algorithms to do that warping, and they differ in how aggressively they force the match.

The common thread it solves: any time one part of your pipeline shifts color away from another and you want them to agree again. Because it runs inside the graph at generation time, it's part of the pipeline rather than a separate step in an external editor afterward.

The inputs and outputs

Getting the first two straight is the whole game:

  • image_ref - the image whose look you want. The color source. It comes out unchanged.
  • image_target - the image that gets changed to match. This is the one that comes out re-graded.

Flip those two and you'll re-color the wrong image.

  • method - which algorithm, and there are eight: wavelet, adain, mkl, hm, reinhard, mvgd, hm-mvgd-hm, hm-mkl-hm. Practical guidance: mkl and reinhard are gentle, reliable defaults; adain and wavelet transfer differently and are worth trying when the others miss; the hm- compounds match hardest and can overcook. They fail differently, and swapping is free, so if one looks wrong, cycle through a couple.
  • image_output - Preview, Save, Hide, or Hide/Save. This node is a terminal node that can write the result to your ComfyUI output folder, so pick Save when you want the file on disk, Preview while you're dialing it in.
  • save_prefix - the filename prefix when saving.

The single image output is the re-graded target, ready to save or feed onward.

Installing it

ComfyUI Manager: search ComfyUI Easy Use, install, restart. Or:

cd ComfyUI/custom_nodes
git clone https://github.com/yolain/ComfyUI-Easy-Use

then install the requirements (install.bat on Windows, else pip install -r ComfyUI-Easy-Use/requirements.txt) and restart. If the node fails to import, the color-transfer library from that requirements install is the usual culprit - re-run it with ComfyUI's Python.

Common issues

  • The result looks overcorrected. Switch to a gentler method - the hm- compounds are the most aggressive; try mkl or reinhard for a subtler transfer.
  • Reference and target are wildly different scenes. Color matching works best when the two share a subject or lighting. Match a sunset to a snowfield and it'll do exactly what you asked and look strange doing it - that's the math, not a bug.
  • Which image is which. By far the most common mistake is swapping image_ref and image_target. Reference = the look you want (untouched); target = the image that changes. If the wrong picture got recolored, that's the wire to check.
CategoryEasyUse/Image

Inputs (5)

NameTypeDefaultDescription
image_refIMAGE
image_targetIMAGE
methodCOMBO8 options: wavelet, adain, mkl, hm, reinhard, mvgd, +2
image_outputCOMBOPreview4 options: Hide, Preview, Save, Hide/Save
save_prefixSTRINGComfyUI

Outputs (1)

NameTypeDescription
imageIMAGE