Nodes/ComfyUI-Color_Transfer/Palette Transfer Reinhard
ComfyUI Node

Palette Transfer Reinhard

The two-input palette node that's a whole look transfer

By 45uee·Created 2 years ago·Updated 5 months ago· 42
Palette Transfer Reinhard
  • image
  • target_colors
  • IMAGE

Here's the node to try first if the palette idea appeals to you but the cluster-and-posterize look of the main Palette Transfer doesn't. Palette Transfer Reinhard takes the classic Reinhard color-transfer algorithm - the same one behind the pack's reference-image node - and feeds it a swatch list instead of a photo. Two inputs, one output, zero knobs. It's the least fiddly color node in the pack, and for a lot of uses it's the best-looking one too.

How it works

Reinhard transfer works in LAB color space by matching statistics: shift your image so its mean and standard deviation match a target's. The reference-image version computes those statistics from a whole photo; this one computes them directly from your palette colors. So your palette is treated as data about a mood - its average hue, its spread - and your image is stretched to share that mood, while keeping its own structure and gradients.

There's one subtlety worth knowing: before computing stats, the node densely interpolates your palette (three extra points between each pair of colors, plus pure black and white). Why? A 4-color swatch has a weird, lumpy distribution - interpolating fills it out so the "average" and "spread" it computes actually describe a believable palette instead of four lonely points. The practical effect: you don't need a big swatch to get a smooth, full-range result. A two or three-color palette gives you a coherent grade, which is rare in this family of nodes.

Inputs and output

  • image - your source, any IMAGE.
  • target_colors - a COLOR_LIST, from the pack's ColorPalette node (type a list like [(40, 30, 60), (200, 180, 160)]), or piped straight from ExtractPalette if you're borrowing a photo's look.

One output, an IMAGE, ready for preview or save.

When to reach for it

Reach for it when you want a global palette mood without the posterized flatness that hard KMeans mapping produces. Because it's a statistical shift, your image keeps all its gradients and detail - skin tones stay smooth, skies don't band into four flat bands. That makes it the palette node you'd pick for photography-style grading: warm a scene with an amber-and-cream palette, cool it with blues, punch contrast by giving the palette a wide spread.

Skip it when you need specific colors in specific places - "make that wall that exact red" is a cluster-mapping job, not a statistics job. The pack's Palette Transfer node does the specific-recoloring thing; this one does the mood. Blend-mode fans will also note this node has no blend control at all - the shift is all-or-nothing, so if you want a subtler touch, mix the output with the original in a blend node or look at PalletteSoftTransfer, which adds exactly that dial.

Install

The whole pack installs at once, so this is the same three commands as always:

cd ComfyUI/custom_nodes
git clone https://github.com/45uee/ComfyUI-Color_Transfer

…or search "Color_Transfer" in ComfyUI Manager, then restart. No models, CPU-only, and the dependencies (scikit-learn, opencv-python, POT) mostly arrive with ComfyUI; if import complains, pip install scikit-learn is the README's fix. One nice safety net this node has that the cluster nodes lack: an empty palette just returns your image unchanged, so it's an easy thing to bypass with an empty list.

CategoryColor Transfer/Palette Transfer

Inputs (2)

NameTypeDefaultDescription
imageIMAGE
target_colorsCOLOR_LIST

Outputs (1)

NameTypeDescription
IMAGEIMAGE