Nodes/WAS Node Suite v3/Image Palette Map
ComfyUI Node Runs on cloud

Image Palette Map

Posterize, colourise, and screen-print your renders

By WASasquatch·Created 3 years ago·Updated 4 days ago· 1,844
Image Palette Map
  • images
  • color_palettes
  • images
palette#10141f #2a4a5e #6f8f8c #c9b48a #f4ead8
mode
dither
smoothtrue
normalizefalse
reversefalse
blend1.00

Some looks you don't regenerate for - you repaint deterministically. Want a render reduced to a five-colour poster, a depth map turned into a gradient of teal and sand, or a black-and-white plate colourised from a palette? WAS Image Palette Map does all three, and it's instant, repeatable, and doesn't burn a single sampling step. The KB crowd has a name for that class of tool: the cheap deterministic primitive you should reach for before the expensive generative one.

You hand it an image (or a batch) and a palette - one colour per line, in the text box, and it accepts real colour spellings: #ff8800, #f80, orange, rgb(255, 136, 0). Several colours can share a line separated by commas, and anything that isn't a colour is skipped. The palette is the whole creative input, so this node lives or dies on the palettes you feed it.

Then pick a mode, and this is the fork that decides what you're actually doing:

  • Perceptual snaps every pixel to its nearest palette colour, measured in Oklab, so it picks the colour that's closest to the pixel, not brightest or darkest. The picture keeps its own hues as closely as the palette allows - this is your fixed-set-of-inks look. Here dither matters: none leaves flat bands (poster style), FloydSteinberg spreads the error as a fine organic stipple that flickers on an animation, and Bayer uses a fixed 8x8 crosshatch that stays put across frames. If it's moving, the tooltip's advice is clear: Bayer or none.
  • Luminance Ramp throws the original colour away and maps each pixel's brightness onto the palette read dark-to-light. That's the colourise-a-greyscale-plate and grade-a-depth-map mode. smooth on makes the palette a continuous gradient so shading survives; smooth off posterises into exactly as many bands as palette colours - the screen-print look. reverse flips the ramp end to end (a dark-to-light palette turns the image into a negative).

Two flags are easy to trip over. normalize (off by default) stretches the palette across each image's own darkest and lightest values. Tempting for a single image, but the tooltip warns plainly: leave normalize off for anything animated, or an exposure change between frames shifts the colours and your sequence breathes. And blend (default 1.0) controls how much of the repaint replaces the original. Drop it to 0.6–0.8 and you're grading rather than repainting - the colourised plate gets tied back to its own hues, and the result stops looking like a filter was slapped on.

There's also an optional color_palettes input: a list of palettes as Image Color Palette emits them, one per image, which replaces the text box. Fewer palettes than images is fine - the list repeats, so one palette covers a whole batch.

The output is simply images, repainted, at their original size. Because every image is handled on its own with the same settings, a sequence keeps a consistent look - that's the whole point of the defaults like normalize being off.

Install

In WAS Node Suite v3 - ComfyUI Manager, search "WAS Node Suite", or clone:

cd ComfyUI/custom_nodes
git clone https://github.com/WASasquatch/was-node-suite-comfyui

Restart after. Requires ComfyUI 0.14.0+ and Python 3.10+; nothing pip-installs, no weights download. (Old v2 WAS threads about dependency hell don't apply to v3 - the pack ships clean and colour-matching runs on torch.)

Common issues

  • Colours look wrong in Luminance Ramp. The palette is read dark-to-light, so check it's ordered that way - and reverse off. In Perceptual mode position doesn't matter; a colour is chosen by distance.
  • Frames flicker in a sequence. You left normalize on, or you're using FloydSteinberg dither on moving frames.
  • It looks like a flat filter, not a grade. Lower blend toward 0.6–0.8 so the original structure shows through.
CategoryWAS Suite/Image/Adjustment

Inputs (9)

NameTypeDefaultDescription
imagesIMAGEThe images to repaint. Each one is handled on its own, so a sequence keeps a consistent look.
paletteSTRING#10141f #2a4a5e #6f8f8c #c9b48a #f4ead8The palette, one colour per line: '#ff8800', '#f80', 'orange', 'rgb(255, 136, 0)'. Ignored when color_palettes is connected.
modeCOMBO`Perceptual` snaps every pixel to its nearest palette colour, for a fixed set of inks. `Luminance Ramp` places pixels along the palette by brightness.
ditherCOMBOHow the error left by matching is spread, in `Perceptual` mode. `FloydSteinberg` gives a fine organic stipple; `Bayer` a fixed 8x8 crosshatch.
smoothBOOLEANtrueWhether `Luminance Ramp` blends between neighbouring palette colours. On, the palette becomes a continuous gradient and shading survives. Off, every pixel snaps to one of the palette's colours, which posterises the picture into exactly that many bands, the poster or screen-print look. Not read by `Perceptual`.
normalizeBOOLEANfalseWhether `Luminance Ramp` stretches the palette across each image's darkest and lightest values. Off by default, which reads brightness absolutely and keeps a sequence stable.
reverseBOOLEANfalseWhether the palette is read in the opposite direction. This flips a `Luminance Ramp` end to end, so a dark-to-light palette renders the picture as a negative. It changes nothing visible in `Perceptual` mode, where a colour is chosen by distance rather than by position.
blendFLOAT1.000–1How much of the repainted image replaces the original. 1.0 is the palette alone. Lower values let the original show through, which is how a colourised plate is tied back to its own hues, around 0.6 to 0.8 grades an image without it looking like a filter.
color_palettesoptARRAYOne palette per image, as Image Color Palette emits. Connected, it replaces the text box. Fewer palettes than images is fine: the list repeats, so one palette covers a whole batch.

Outputs (1)

NameTypeDescription
imagesIMAGEThe repainted images, at their original size.