Nodes/ComfyUI-Showrunner-Utils/GetMostCommonColors
ComfyUI Node

GetMostCommonColors

Pull a palette out of any image and hand it straight back to your workflow

By fablestudio·Created 2 years ago·Updated about a year ago· 0
GetMostCommonColors
  • input_image
  • rgb_colors
  • hex_colors
num_colors1
exclude_colors#000000,#FFFFFF

GetMostCommonColors is the color-palette node from Fable Studio's ComfyUI-Showrunner-Utils pack, and it answers a deceptively simple question: what colors are actually in this image? Feed it any image and it scans the pixels, counts how often each color appears, and hands you the most frequent ones back as text - ready to feed into prompts, filenames, or downstream automation. It's the sort of node that feels like a toy until you're trying to keep a character's wardrobe consistent with the background across a whole sequence, at which point it becomes a small time-saver you reach for constantly.

How it works

The mechanism is just what the name promises: a frequency count over the image's pixels. One input, input_image (an IMAGE), and two knobs. num_colors (INT, 1–128, default 1) is how many colors to detect - crank it to 5–8 for a real palette. exclude_colors (STRING, default #000000,#FFFFFF) is a comma-separated list of hex colors to skip, and the default makes sense: pure black and pure white dominate almost any render, and if you didn't exclude them you'd get "black, white, and a bunch of grays" from every image you own.

Outputs are two strings carrying the same data in different clothes: rgb_colors (comma-separated r,g,b tuples) and hex_colors (comma-separated #rrggbb). Pick whichever the node you're feeding prefers - hex is the friendlier one for prompt text, RGB tuples for anything doing actual color math.

What you'd use it for

Realistically: grabbing the dominant colors from a reference frame or a background plate and injecting them into your workflow. If you're doing character-consistency work, the palette of the scene is part of the consistency - feed hex_colors into a prompt or a filename and you've versioned your output by color scheme automatically. It also works nicely as an inspection tool: drop in a render you're not happy with and see in one string whether the image is all browns, or has that nasty blue cast you suspected. In the Showrunner context it's a palette-extraction utility for keeping episode frames on a coherent color grade.

Installing it

Nothing special - same routine as the rest of the pack, and equally light: no model downloads, no dependencies beyond the pack itself. ComfyUI Manager → search ComfyUI-Showrunner-Utils → Install, or:

cd ComfyUI/custom_nodes
git clone https://github.com/fablestudio/ComfyUI-Showrunner-Utils

then restart. And the same caveat applies as everywhere else in this pack: the public repo has been returning 404 recently, so if Manager can't locate the pack, it's likely private or unpublished rather than a problem with your install.

Where people get tripped up

The default num_colors of 1 is genuinely weird for a node like this - it makes the out-of-the-box result a single color, which is almost never what you want. Bump it to 4–8 first thing. Second, this is a histogram, not a perceptual palette: a photo with gradients will surface a pile of near-identical browns rather than "five distinct colors," so lean on exclude_colors to push out near-duplicates (add your own #000000-adjacent grays if the defaults aren't enough). And note both outputs are STRINGs - you can't wire a palette into an image pipeline directly. It's text for text consumers: prompts, filenames, log nodes, or other scripts. Expecting it to plug into a color-matching node will leave you with a dead wire and a confused afternoon.

Categoryimage

Inputs (3)

NameTypeDefaultDescription
input_imageIMAGE
num_colorsoptINT11–128Number of colors to detect
exclude_colorsoptSTRING#000000,#FFFFFFComma-separated list of colors to exclude from the output

Outputs (2)

NameTypeDescription
rgb_colorsSTRING
hex_colorsSTRING