Nodes/Pixel Grid Helpers/Pixel Grid: Analyze Palette
ComfyUI Node

Pixel Grid: Analyze Palette

See every color your image actually contains

By molbal·Created 9 months ago·Updated 9 months ago· 3
Pixel Grid: Analyze Palette
  • image
  • hex_palette

Analyze is the debugger of the Pixel Grid Helpers pack, and the least glamorous node here. That's fine - its whole job is to feed the other nodes.

Most people figure out pixel-art palettes the hard way: they eyeball the image, guess at hex codes, and then discover the model quietly used thirty shades of green they never saw until they zoomed in. PixelGrid_Analyze cuts through that. Wire in an image, and it finds every unique color in it, then hands you back a single STRING - hex_palette - of comma-separated hex codes, one per distinct color.

Mechanically it's as simple as a node gets: flatten the image to a list of RGB pixels, run torch.unique to dedupe, and format each entry as #rrggbb. No models, no tuning. One input (image), one output, deterministic and instant.

Where it fits is at the front of the pack's pipeline. Run it on an image you like and paste the string into Pixel Grid: Enforce Palette to lock that style in, or into Palette to Image to render the swatches and actually look at what you're working with. It's also the honest way to answer "how many colors is this really?" when you're deciding whether a piece is genuinely low-color or just pretending to be.

Two warnings, both straight from the source. First, the output is every unique color with no frequency info and no sensible ordering - torch.unique sorts by channel value, so you get a sorted list, not a "most-used first" ranking. If you want importance, that's the K-Means quantizer's palette. Second, and this is the one that gets people: on a photographic or gradient-heavy image, this string can run to tens of thousands of colors. The node is built for pixel art and other low-color inputs, where you get a nice manageable list. Feed it a photo and you'll get a wall of text that's technically correct and completely useless. Quantize first, then analyze - that's the intended flow.

Install is the same pack-level story as everything in Pixel Grid Helpers: ComfyUI Manager → search "Pixel Grid Helpers" → install, then restart and refresh the browser. Or git clone https://github.com/molbal/ComfyUI-PixelGridHelpers.git into custom_nodes. No models to download, no extra dependencies - pure torch.

CategoryPixel Grid Helpers

Inputs (1)

NameTypeDefaultDescription
imageIMAGE

Outputs (1)

NameTypeDescription
hex_paletteSTRING