Nodes/ComfyUI-RyuuNoodles/Color Match 🐲
ComfyUI Node

Color Match 🐲

Color Match β€” for when your inpainted face is a different shade than the face

By DraconicDragonΒ·Created about a year agoΒ·Updated 2 months agoΒ· 12
Color Match 🐲
  • image_target
  • image_ref
  • image
β—„methodmklβ–Ί
β—„strength0.970β–Ί

The classic ComfyUI fail: you run a face-detail pass, the face comes back crisp but the skin tone doesn't match the neck it's sitting on. Or you generated a batch of images and every frame drifted a little in white balance. Color Match is the fix for both: it transfers the color statistics of a reference image onto a target image. One node, one output, and it quietly fixes the thing that's been bugging you all week.

What it does

You feed it a target image (the one you want to change) and a reference image (the one whose colors you want), pick a method, and it returns the target recolored to match the reference. The core is the color-matcher Python library (by hahnec), which implements several well-known color transfer algorithms - Reinhard et al.'s approach, the Monge-Kantorovich Linearization (MKL) from Pitie et al., a Multi-Variate Gaussian Distribution (MVGD) transfer, and combinations like histogram matching + MVGD. If that sounds like academic color-grading literature, that's exactly what it is; the library is used in film and stop-motion correction.

The methods you actually choose from, in order of how often you'll use them:

  • mkl (default) - the author's pick, and for good reason: transfers colors well with the least artifacts when the two images are structurally similar.
  • hm - pure histogram matching.
  • reinhard - the classic mean/std transfer, fast and simple.
  • mvgd, hm-mvgd-hm, hm-mkl-hm - the fancier compound methods for when the simple ones misbehave.

There's also a strength input (0 to 10, default 0.97) that blends the result back toward the original - at 1.0 you get a full transfer, below that you get a partial one. That's the knob for "match the tone but don't flatten my image into the reference's palette."

The one thing that's different here

This is the same Color Match node from ComfyUI-KJNodes (it's GPL-3 code, and this pack carries the license note), with one deliberate modification: the target image is the first input. Why does that matter? When you bypass a node in ComfyUI, it passes through its first input. So with the target first, bypassing this node passes the target through untouched. In the KJNodes original, the reference was first - bypass it and you'd get the reference image shoved into your pipeline instead of your actual image. That's the "bypass-friendly" in the feature name, and it's genuinely thoughtful for a node that lives in the middle of a workflow where you'll toggle it on and off while tuning.

Inputs and output

  • image_target - the image you want recolored.
  • image_ref - the color source. A single reference works for a whole batch; or give it a matching batch, one reference per target.
  • method - see above, default mkl.
  • strength - blend amount, default 0.97.
  • Output: a single image.

Installing it

cd ComfyUI/custom_nodes
git clone https://github.com/DraconicDragon/ComfyUI-RyuuNoodles

Restart, or install via ComfyUI Manager (search "RyuuNoodles"). This is the one node in the pack with a real dependency: it needs color-matcher, which the pack's requirements.txt installs for you. If you see Can't import color-matcher, did you install requirements.txt?, the fix is pip install color-matcher in your ComfyUI Python environment.

Where people get burned

The library wants float data, so batch images are converted internally - if your reference has a different resolution than the target, results get unpredictable. And that "use one reference for a whole batch" behavior: the code explicitly errors if you feed a mismatched batch, so keep refs either singular or exactly batch-matched. The common color-shift complaint from ADetailer and inpaint passes is exactly what this node kills - see the troubleshooting docs on VAE color drift - so wire a Color Match after your face-detailer pass and dial strength down to taste.

CategoryRyuuNoodles 🐲/Images

Inputs (4)

NameTypeDefaultDescription
image_targetIMAGEβ€”
image_refIMAGEβ€”
methodCOMBOmklColor transfer method to use. I personally like 'mkl' most because it transfers colors well with least 'artifacts' in scenarios where both input images are structually the same or very close to same.
strengthoptFLOAT0.9700–10β€”

Outputs (1)

NameTypeDescription
imageIMAGEβ€”