Nodes/AAA Metadata System/Eric's Color Palette Analyzer_v3
ComfyUI Node

Eric's Color Palette Analyzer_v3

Read an image's colors, then ask what they mean

By EricRollei·Created 10 months ago·Updated 8 months ago· 13
Eric's Color Palette Analyzer_v3
  • image
  • image
  • color_swatch
  • dominant_colors
  • harmony_info
  • characteristics
  • emotional_quality
  • age_appeal
  • cultural_significance
  • cultural_meanings
  • color_data
  • color_histogram
num_colors5
input_filepath
extraction_methodkmeans
color_spaceRGB
palette_analysistrue
harmony_analysistrue
write_to_xmptrue
embed_metadatatrue
write_text_filefalse
write_to_databasefalse
debug_loggingfalse
save_color_swatchfalse
save_color_spectrumfalse

Take an image, and this node tells you its dominant colors, names them, judges the harmony, and then goes further: it offers an emotional reading, an age appeal, a cultural significance, even a "characteristics" summary. Eric's Color Palette Analyzer_v3 is the most ambitious color node in the AAA Metadata System pack - part color-science tool, part vibe interpreter, part metadata writer.

Split it into two halves and it's easier to trust. The first half - extracting dominant colors, naming them, building a swatch, computing harmony - is grounded, real image processing. The second half - emotional quality, cultural significance, age appeal - is generated from the pack's hard-coded cultural meaning tables. Useful as creative input, but remember it's a lookup against curated data, not an AI essayist. Treat the vibe outputs as a jumping-off point for style prompts, not as analysis you'd quote in a design review.

How it works

It converts your image to PIL, then extracts num_colors dominant colors using one of three methods: colorthief (the ColorThief library's median-cut), histogram, or kmeans (cluster the pixel space with scikit-learn's KMeans). Default is kmeans, which tends to give the most sensible palette for photos. Colors are then named against a color dictionary, and the palette is analyzed for characteristics and harmony (complementary/analogous relationships). The cultural and emotional fields come from the same cultural tables the palette generator uses, keyed to the detected hues.

It can also write the whole analysis into the image's metadata - XMP sidecar, embedded metadata, text file, or the pack's database - via the write toggles, which makes it a nice addition to a cataloguing pipeline: analyze, tag, file.

Inputs and outputs that matter

  • image - the image to analyze.
  • num_colors - how many dominant colors to extract (default 5).
  • extraction_method - colorthief, histogram, or kmeans.
  • input_filepath - needed if you want the analysis written to disk via the metadata toggles.
  • write_to_xmp / embed_metadata / write_text_file / write_to_database - where the analysis record goes.

Outputs: image (pass-through), color_swatch (IMAGE - the palette laid out), dominant_colors (STRING), harmony_info, characteristics, emotional_quality, age_appeal, cultural_significance, cultural_meanings (all STRINGs), color_data (DICT, structured colors), and color_histogram (IMAGE).

Installing it

Part of AAA Metadata System by Eric Hiss (GitHub: EricRollei). Via ComfyUI Manager (search "AAA Metadata System") or:

cd ComfyUI/custom_nodes
git clone https://github.com/EricRollei/AAA_Metadata_System.git
cd AAA_Metadata_System
pip install -r requirements.txt

One extra step for this node specifically: it imports sklearn at the top level, but scikit-learn is listed as optional in the pack's requirements, so it may not be installed. If the node fails to load, run pip install scikit-learn and restart ComfyUI. colorthief is in the core requirements.

Common issues

The sklearn thing is the big one - if the node doesn't appear or errors on load, that's almost certainly it. If it loads but kmeans extraction throws, the same fix applies. The vibe outputs are only as deep as the cultural tables: pick an unusual image and cultural_significance may read as generic or flat, which is expected behavior, not a bug. And if you're feeding it downscaled or heavily compressed images, expect the palette to skew - garbage colors in, garbage palette out. For the numbers you can trust (dominant colors, harmony), it's genuinely solid; for the poetry, take it with salt.

CategoryEric's Nodes/Analysis

Inputs (14)

NameTypeDefaultDescription
imageIMAGE
num_colorsINT53–10
input_filepathSTRING
extraction_methodCOMBOkmeans3 options: colorthief, histogram, kmeans
color_spaceoptCOMBORGB3 options: RGB, HSV, LAB
palette_analysisoptBOOLEANtrue
harmony_analysisoptBOOLEANtrue
write_to_xmpoptBOOLEANtrue
embed_metadataoptBOOLEANtrue
write_text_fileoptBOOLEANfalse
write_to_databaseoptBOOLEANfalse
debug_loggingoptBOOLEANfalse
save_color_swatchoptBOOLEANfalse
save_color_spectrumoptBOOLEANfalse

Outputs (11)

NameTypeDescription
imageIMAGE
color_swatchIMAGE
dominant_colorsSTRING
harmony_infoSTRING
characteristicsSTRING
emotional_qualitySTRING
age_appealSTRING
cultural_significanceSTRING
cultural_meaningsSTRING
color_dataDICT
color_histogramIMAGE