Nodes/ComfyUI-Desert-Pixel-Nodes/DP Image Color Analyzer
ComfyUI Node

DP Image Color Analyzer

Extract a palette and get SD-friendly color words

By DesertPixelAi·Created 2 years ago·Updated about a year ago· 25
DP Image Color Analyzer
  • image_input
  • color_images
  • color_names
  • color_theme
  • detailed_info
  • hex_values
image
num_colors5
color_sample_width512
color_sample_height512

Point this at an image and it tells you what colors are in it - not just hex codes, but actual words you can paste into a prompt. It pulls the dominant colors out of a reference, hands you swatches, color names, an overall "theme" description, and the hex values. The clever part is the SD-friendly naming: instead of #8B4513 it gives you something a text encoder understands, so you can steer a new generation toward a reference image's palette using language the model actually reads.

That's the real use. You've got a mood board image with a color scheme you love. Run it through here, grab the color_names or color_theme string, drop it into your prompt, and your generation leans toward that palette. It's color-matching by description - a lightweight alternative to dragging colors around by hand.

The inputs that matter

  • num_colors (3–16, default 5) - how many dominant colors to pull. Five is a sensible palette; bump it up for a busy image with lots of distinct tones, down for a simple two- or three-color scheme.
  • image - a built-in file picker (it defaults to example.png), so you can analyze an image sitting in your input folder without wiring anything.
  • image_input (optional, IMAGE) - the alternative: feed an image in from upstream instead of picking a file. Use this when the image you want to analyze is being produced earlier in the graph.
  • color_sample_width / color_sample_height (default 512) - the size of the swatch images the node renders. Cosmetic; leave them unless you want bigger or smaller swatches.

Outputs are generous: color_images (the palette as swatches you can preview), color_names and color_theme (the prompt-ready text), detailed_info (a fuller readout), and hex_values (the raw codes for use elsewhere).

How it works

It clusters the image's pixels down to a handful of representative colors - the dominant tones - then maps each to a readable name and assembles a theme description from the set. The naming layer is what separates it from a plain color-picker: it's translating pixel values into words a diffusion prompt can use.

How to install it

ComfyUI Manager: search ComfyUI-Desert-Pixel-Nodes, install, restart. Or:

cd ComfyUI/custom_nodes
git clone https://github.com/DesertPixelAi/ComfyUI-Desert-Pixel-Nodes

then restart. No model download. Under the "DP" image category.

Common issues & troubleshooting

The palette is muddy or all one color. Usually the image itself - a low-contrast or heavily-tinted source doesn't have distinct dominant colors to find. Raise num_colors to force it to separate more tones, or feed a cleaner reference.

It analyzed the wrong image. The node has two ways in - the image file picker and the image_input socket. If you wired something into image_input, that takes over; if you didn't, it uses the file the picker points at (defaulting to example.png). Make sure you're feeding the one you mean.

The color words aren't steering my generation much. Color terms are a nudge, not a lock - the model weighs them against everything else in the prompt. Move them earlier in the prompt, lean on color_theme for a cohesive description rather than a list of isolated names, and if you need hard color control, pair it with a low-weight reference or ControlNet rather than expecting words alone to nail an exact palette.

CategoryDP/Image

Inputs (5)

NameTypeDefaultDescription
imageCOMBO1 options: example.png
num_colorsINT53–16
color_sample_widthINT5128–4096
color_sample_heightINT5128–4096
image_inputoptIMAGE

Outputs (5)

NameTypeDescription
color_imagesIMAGE
color_namesSTRING
color_themeSTRING
detailed_infoSTRING
hex_valuesSTRING