Image Color Palette
Extract a palette from an image in ComfyUI
Image Color Palette looks at an image and pulls out its dominant colors - the handful of swatches that define its look. Feed it a reference render and it tells you, in actual RGB, what the image is "made of" color-wise. Handy for building a consistent look across a set, matching a target palette, or just generating a nice swatch strip to eyeball or reuse.
It's a small analysis utility rather than something in the generation path, but it's exactly the sort of thing WAS Node Suite exists to cover - the odd-job tools that core ComfyUI never bothered to include.
How it works
Under the hood it uses k-means clustering (via scikit-learn) to group the image's pixels into a set number of representative colors. You tell it how many colors you want and it finds the centers that best summarize the image. The WAS docs note it supports a color range of 8 to 256 - so anything from a tight 8-swatch palette to a rich 256-color breakdown. It renders those colors out as a palette image (using a bundled font for any labels), which you can preview, save, or feed into other color-driven nodes.
That range is the main creative lever. Eight colors gives you the "poster" version - the broad strokes. Crank it toward 256 and you get a fine-grained map of every subtle shade, which is more of a technical readout than a design palette.
The inputs and outputs that matter
You feed it an image and set the number of colors (8–256), plus a mode for how the palette is generated/laid out. The output is a palette image - the swatches - which you can wire to a preview/save node or use as a reference elsewhere. For most design uses, keep the color count low (8–16); reach for high counts only when you actually want a dense breakdown.
How to install it
Part of WAS Node Suite. Easiest via ComfyUI Manager: search WAS Node Suite, install, restart. Or by hand:
cd ComfyUI/custom_nodes
git clone https://github.com/WASasquatch/was-node-suite-comfyui
pip install -r was-node-suite-comfyui/requirements.txt
then restart. On Windows portable, run the pip step with python_embeded\python.exe -s -m pip install -r ... (or install.bat). One thing specific to this node: it depends on scikit-learn, and per the WAS README the suite will try to install it on first run if it's missing. That first-run auto-install is a common place things wedge - see below.
Common issues & troubleshooting
First run fails or hangs on scikit-learn. This node needs scikit-learn, and the auto-install-on-first-use can fail silently, especially on portable installs where pip targets the wrong Python. If the node errors the first time you run it, install the dependency yourself into ComfyUI's environment (python_embeded\python.exe -s -m pip install scikit-learn on portable) and restart.
The palette looks muddy or off. k-means summarizes average colors, so a busy image with lots of blended tones can produce grayish swatches that don't feel like the image's "real" colors. Try a higher color count so distinct hues aren't averaged together, or crop to the region whose palette you actually care about before feeding it in.
Labels/text look wrong. The node uses a font from its own ./res/ folder and falls back to a basic internal font if that's missing. If you did the legacy single-file install (just WAS_Node_Suite.py), you skipped the res/ resources - do the full git clone install so the bundled font is present.
The whole suite won't import. WAS Node Suite is large and unmaintained since late 2023; the recurring failure is an "Import Failed" after a ComfyUI update, from a dependency version clash (opencv is the usual culprit). Reinstall the requirements against your ComfyUI Python and restart.
Inputs (0)
No inputs
Outputs (0)
No outputs