Pixel Grid: Palette to Image
Stop squinting at hex codes and render the swatches
- swatch_image
The whole Pixel Grid Helpers pack talks in hex strings - comma-separated lists of #rrggbb that are great for machines and miserable for eyeballs. Palette to Image is the antidote: paste in a palette string, and it renders each color as a solid 24x24 swatch, stacked vertically, and hands you back an image you can actually look at, save, or wire into a preview.
It's the pack's display utility, and it earns its keep the moment you're juggling palettes by hand - whether that's the output of Quantize or Merge Similar, or a palette you're typing from memory for Enforce Palette. One node turns an opaque string into something you can judge at a glance, which is worth a lot when you're trying to pick between two candidate palettes.
Mechanically there's nothing to it: split the input on commas, convert each hex to RGB, build a 24x24 block of that color, and stack the blocks into a tall image. Input is just hex_palette (a multiline STRING, comma-separated); output is swatch_image, a plain IMAGE you can drop into Save Image or any preview node. Edge case from the source: an empty palette returns a 24x24 black image rather than erroring, so a blank result means your input parsed as empty - not that the node broke. And it shares the pack's strict hex parsing, so keep codes valid 6-digit hex or it throws.
Honestly, if you only use this pack one node at a time, this is the one you might skip. It shines in assembly: Analyze → tweak → Palette to Image to see what you've got, or KMeans → Palette to Image to evaluate a generated palette before you commit it anywhere. It's a swatch book, not a pipeline step, and that's exactly what it should be.
Install: ComfyUI Manager → search "Pixel Grid Helpers" → install, restart, refresh. Or git clone https://github.com/molbal/ComfyUI-PixelGridHelpers.git into custom_nodes. Same zero-dependency, no-models story as the rest of the pack - this one is just tensor fills, so there's genuinely nothing to download.
Inputs (1)
| Name | Type | Default | Description |
|---|---|---|---|
| hex_palette | STRING | #FF0000, #00FF00 | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| swatch_image | IMAGE | — |