Nodes/Nifty Nodes for ComfyUI/Image Color Match
ComfyUI Node

Image Color Match

Steal another image's color grading with ten different algorithms

By Stibo·Created 5 months ago·Updated 2 months ago· 9
Image Color Match
  • image_target
  • image_ref
  • IMAGE
enabledtrue
methodmkl
transfer_modeall
strength1.00
multithreadtrue

Nifty Image Color Match transfers the color distribution of a reference image onto a target - no model, no training, no prompt. Point image_ref at the photo whose look you love, feed image_target whatever you generated, and the node makes the target's colors statistically resemble the reference's. It's the color-grading cousin of everything the photorealism crowd obsesses over, and it runs in seconds.

The headline feature is the ten transfer methods, which differ in how aggressively and how smartly they move color around:

  • mkl - Monge-Kantorovich linear map. Best overall quality, the recommended default. Start here.
  • reinhard_lab - fast statistical match in LAB space, great for natural/photographic content. CPU-only.
  • reinhard_lab_gpu - same, GPU-accelerated. Requires the kornia package; prefer it over the CPU version if you've got kornia installed.
  • wavelet / adain - structure-preserving. They move low-frequency color and leave texture and fine detail alone, so they're the pick when you must not smear detail.
  • hm - histogram matching. Fast, broad tonal correction, less precise on complex palettes.
  • reinhard - the classic RGB Reinhard. Quick and simple, struggles with complex distributions.
  • mvgd, hm-mvgd-hm, hm-mkl-hm - the heavy statistical hitters from the color-matcher package, best for tricky distributions. hm-mkl-hm is the highest-quality combo of the lot. These require color-matcher.

The inputs that matter

  • image_target - whose colors get changed.
  • image_ref - whose colors you're stealing.
  • enabled - off = image_target passes through untouched.
  • method - the algorithm above. Default mkl.
  • transfer_mode - all (full transfer), color (hue/chroma only, keep the target's luminance), or luminance (brightness only, keep the colors).
  • strength - blend amount, 0–10. 1.0 = full match, 0.5 = halfway between original and matched, above 1.0 exaggerates.
  • multithread - process batch frames on parallel CPU threads. On by default and the right call for big batches.

Output: IMAGE - the matched batch. Returns None if either image input is disconnected.

Gotchas, honestly

Two things bite people. First, the fancy methods are not built in: mvgd and the combos need color-matcher, and reinhard_lab_gpu needs kornia. If they're missing, the node raises an ImportError telling you to pip install them - install both up front and you won't think about it again:

pip install color-matcher kornia

Second, this is a statistical transfer, not a style transfer. If the reference has a strong cast (orange teal, heavy contrast), the target will inherit the distribution, and with strength above 1.0 it'll overshoot into "fake" territory fast. The transfer_mode tricks - matching only luminance, or only hue - are how you get believable results instead of a target that looks recolored. For batch work, reference frames are matched by index (the ref cycles at its own batch size), so a single ref image works against a whole video's worth of frames.

Install

The pack itself: ComfyUI Manager → search "Nifty Nodes", or

cd ComfyUI/custom_nodes
git clone https://github.com/Stibo/comfyui-nifty-nodes

Restart ComfyUI, keep ComfyUI current (v3 API). color-matcher and imageio-ffmpeg come with the pack; add kornia for the GPU reinhard method. This is one of the pack's most capable image tools - for a "keep the detail, steal the mood" look, the wavelet method alone is worth the install.

Categorynifty/image

Inputs (7)

NameTypeDefaultDescription
enabledBOOLEANtrueWhen disabled, image_target is passed through unchanged.
methodCOMBOmklColor transfer algorithm. 'wavelet' and 'adain' = structure-preserving, good for textures. 'reinhard_lab' = fast statistical match in LAB space. 'mkl' = accurate linear color mapping (recommended default). 'hm' = histogram matching. 'reinhard_lab_gpu' = GPU-accelerated reinhard (requires kornia). 'mvgd', 'hm-mvgd-hm', 'hm-mkl-hm' = advanced methods from color-matcher package.
transfer_modeCOMBOall'all' = transfer full color. 'color' = transfer only hue/chroma, keep original luminance. 'luminance' = transfer only brightness, keep original colors.
strengthFLOAT1.000–10Blend strength of the color transfer. 1.0 = full match, 0.5 = half-way blend with original, values above 1.0 exaggerate the effect.
multithreadBOOLEANtrueProcess batch images in parallel using multiple CPU threads. Recommended for large batches.
image_targetoptIMAGEThe image whose colors will be adjusted to match the reference.
image_refoptIMAGEThe reference image whose color distribution is used as the target.

Outputs (1)

NameTypeDescription
IMAGEIMAGE