ComfyUI Node

Color Harmony

Does this image's palette actually get along? The node that checks

By APZmedia·Created 11 months ago·Updated 5 months ago· 7
Color Harmony
  • image
  • harmony_analysis
  • color_relationships
input_modetensor
harmony_typeComplementary
image_path

ColorHarmony takes a color-theory question - "are the dominant colors in this image complementary, triadic, analogous, or split-complementary?" - and answers it as data. It extracts the image's dominant hues, then scores how well they fit whichever harmony scheme you've selected. Two JSON strings out, no image out. It's a palette-audit node for when you're designing, matching a reference, or just curious whether that generated image accidentally nailed the color wheel.

How it works

The mechanism is admirably simple: convert to HSV, histogram the hue channel into 36 bins, grab the three most common hues, and evaluate them against the harmony type. Complementary checks whether the dominant hues sit ~180° apart; triadic looks for the ~120° triangle; analogous looks for hues clustered close together; split-complementary checks for a color plus its two neighbors-opposite. The result is a JSON object with the harmony analysis plus a color_relationships JSON carrying the dominant hues and the full hue distribution.

The inputs that matter

  • harmony_type - the four choices: Complementary (default), Triadic, Analogous, Split-Complementary. Pick the scheme you're testing for, not the one you hope is true.
  • input_mode - tensor (default) or file with image_path, same as the pack's other analysis nodes.

How to read the results

Outputs are harmony_analysis and color_relationships, both strings. Wire them into a Show Text node and you get the score for the chosen scheme plus the dominant hues. The most useful number is in the analysis: how strongly the image's actual palette matches the scheme. An image with two dominant hues 180° apart scores high on Complementary; a scene full of near-identical warm tones scores high on Analogous and low on everything else.

Honest framing: this is a statistical hue check, not a design critic. It tells you whether the three most common hues fit a geometric relationship on the color wheel. It can't tell you that a palette is ugly - color harmony rules are heuristics, and a picture can be great while failing all four, or technically harmonious and lifeless. Use it as a fast descriptor of what a palette is doing, not as an arbiter of taste. Where it genuinely shines is batch work: run the same harmony check across 50 generations and you can rank outputs by palette coherence instead of eyeballing each one.

Install

Part of the pack:

cd ComfyUI/custom_nodes
git clone https://github.com/APZmedia/ComfyUI-color-tools

Or ComfyUI Manager → search "ComfyUI Color Profile Reader" → Install → restart. Note the README's clone URL is a placeholder - use APZmedia/ComfyUI-color-tools. Needs OpenCV for the HSV conversion (an optional dep install.py handles at startup). If the analysis group isn't in your node list, an optional install failed; check the startup log. It's a light node overall - no models, no downloads, no API - just numpy histogram math over your image.

CategoryColor Tools/Analysis

Inputs (4)

NameTypeDefaultDescription
input_modeCOMBOtensor2 options: file, tensor
harmony_typeCOMBOComplementary4 options: Complementary, Triadic, Analogous, Split-Complementary
imageoptIMAGE
image_pathoptSTRING

Outputs (2)

NameTypeDescription
harmony_analysisSTRING
color_relationshipsSTRING