Nodes/ComfyUI-Color_Transfer/Palette RBF Transfer
ComfyUI Node

Palette RBF Transfer

Smooth, continuous palette recoloring via radial basis functions

By 45uee·Created 2 years ago·Updated 5 months ago· 42
Palette RBF Transfer
  • image
  • target_colors
  • IMAGE
rbf_functiongaussian
epsilon1.0

Most palette transfer nodes are discrete: they pick, for every pixel, one color out of your swatch list. Palette RBF Transfer is the odd one out that's continuous - it treats your palette as a set of control points and builds a smooth mathematical surface that maps every possible color to a new color, passing exactly through your swatches. Think of it like a warp grid for color: the palette colors are the pins, everything between them gets smoothly interpolated, and nothing ever gets posterized into flat bands.

How it works

The "RBF" is a radial basis function interpolation, from scipy.interpolate.Rbf - the same tool you'd use for scattered-data interpolation in geophysics or animation. It works like this:

  • Your palette colors are the known points: for each one, "input = its RGB triplet," "output = its desired channel value."
  • The node fits three separate RBF surfaces, one per channel (red, green, blue), mapping a 3D RGB input to a single output channel.
  • Every pixel in your image is pushed through all three surfaces, and the three results are recombined into the recolored pixel.

Because the surfaces are smooth, colors between palette swatches get natural intermediate values. A 4-color palette produces a full, coherent gradient instead of four hard bands. That makes this the palette node you want for anything organic - skies, skin, foliage - where abrupt color cuts would look broken.

The inputs that matter

  • image, target_colors - the usual: any IMAGE plus a COLOR_LIST from ColorPalette (or piped from ExtractPalette).
  • rbf_function (thin_plate / multiquadric / inverse / gaussian, default gaussian) - the shape of the interpolation kernel. gaussian is the safe, soft default. thin_plate and multiquadric fit more aggressively and can overshoot beyond your palette's range - great for pushing contrast and saturation, risky for smooth skin tones. inverse behaves differently again. When in doubt, gaussian; when you want punch, try thin_plate and keep an eye on clipping.
  • epsilon (0.01–100, default 1) - the "influence radius" of each swatch. Lower values make each palette color act over a tighter neighborhood (more local control, potentially more banding); higher values smooth everything together into one blended mood. It's the single most useful dial on this node, and it's cheap to sweep 0.5 → 5.0 and watch what changes.

Output is a single IMAGE.

When to reach for it

Reach for it when your palette is small but your image has smooth gradients - exactly the case where the cluster-and-snap nodes in this pack turn a sky into a 3-color bar graph. It's also the one that moves colors the most deliberately: because every swatch is a fixed pin, your palette colors show up almost literally in the result, while everything between them gets massaged. That's a nice middle ground between "statistical mood shift" (the Reinhard nodes) and "hard posterize" (the plain Palette Transfer).

The honest downside: RBF through just a few points can do unexpected things in the color volume between your swatches, especially with aggressive kernels or tiny palettes. If a midtone comes out a weird hue, that's not a bug - that's the interpolation surface doing its thing between two far-apart pins. Adding an intermediate swatch usually fixes it.

Install

Standard pack install - ComfyUI Manager search "Color_Transfer", or:

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

Restart after. No models, CPU-only. scipy (which provides Rbf) ships with ComfyUI, so this node rarely trips on dependencies; the README's pip install scikit-learn remains the fix if the pack won't import at all.

CategoryColor Transfer/Palette Transfer

Inputs (4)

NameTypeDefaultDescription
imageIMAGE
target_colorsCOLOR_LIST
rbf_functionCOMBOgaussian4 options: thin_plate, multiquadric, inverse, gaussian
epsilonFLOAT1.00.01–100

Outputs (1)

NameTypeDescription
IMAGEIMAGE