Nodes/ComfyUI-Desert-Pixel-Nodes/DP Image To Pixelgrid
ComfyUI Node

DP Image To Pixelgrid

Turn any image into blocky pixel art

By DesertPixelAi·Created 2 years ago·Updated about a year ago· 25
DP Image To Pixelgrid
  • image
  • IMAGE
grid_size64
quantize_colorstrue
color_count32
grid_linesfalse
grid_line_color0.00
grid_line_width1

This is a post-processing filter, not a model - it takes a normal image and mosaics it down into big, chunky blocks, optionally with a limited color palette, to get that retro pixel-art look. It's the "downsample and quantize" trick photo editors have used forever, packaged as one ComfyUI node with the two knobs that actually matter exposed directly: block size and color count.

How it works

Two things happen, and you control both independently. First, the image gets divided into blocks of grid_size pixels and each block is flattened to a single representative color - that's what creates the blocky mosaic look, and it's the part that does the heavy lifting for "does this look like pixel art." Second, if quantize_colors is on, the whole image's color palette gets reduced to color_count distinct colors - this is the part that actually matters for authenticity. A big block size alone gives you a mosaic filter; big blocks plus a tight, quantized palette is what gets you something that reads as genuine 8-bit or 16-bit pixel art instead of just "blurry and blocky."

There's also an optional grid overlay: turn on grid_lines and the node draws a line around each block at grid_line_width, tinted by grid_line_color - which despite the name is a brightness value (0 = black, 1 = white) rather than a color picker, so you're choosing a grayscale line, not a hue.

Inputs and outputs

Required, all six exposed directly:

  • image - the source.
  • grid_size - 8 to 256, default 64. This is the pixel-block size - bigger numbers mean chunkier, more obviously "pixelated" results. Think of it as the inverse of resolution: a small grid_size stays close to the original detail, a large one collapses big regions into single flat blocks.
  • quantize_colors - boolean, default true. This is the difference between a mosaic filter and actual pixel art - leave it on if you want the classic retro look.
  • color_count - 2 to 256, default 32. Lower numbers (8-16) push harder toward a genuine limited-palette pixel-art aesthetic; higher numbers keep more of the original image's color richness while still blocking out the shapes.
  • grid_lines - boolean, default false. Draws visible borders between blocks.
  • grid_line_color - 0 to 1, default 0 (black), the grayscale brightness of the border line.
  • grid_line_width - 1 to 5, default 1, the border thickness in pixels.

One output: IMAGE - the pixelated result.

How to install it

Search ComfyUI-Desert-Pixel-Nodes in ComfyUI Manager, or:

cd ComfyUI/custom_nodes
git clone https://github.com/DesertPixelAi/ComfyUI-Desert-Pixel-Nodes

Restart. This one's registered under an image/processing category rather than DP, so if you can't find it under the pack's usual DP grouping, check there - it's a small inconsistency in how the pack organizes its nodes. No models needed, no dependencies beyond a standard ComfyUI environment.

Common issues & troubleshooting

Result looks blocky but not like "pixel art." This is almost always quantize_colors being off, or color_count set too high. Block size alone gives you a mosaic; you need a tight palette (try 8-16 colors) on top of a large grid_size to get the actual retro-game look people usually mean by "pixel art."

Fine detail (faces, text) turns into mush. A large grid_size destroys detail below the block size by definition - that's the whole mechanism. If you need the subject recognizable, either lower grid_size (which trades away the "obviously pixelated" look) or accept that fine detail is the cost of a heavy pixelation pass; there's no setting here that preserves detail and pixelates simultaneously.

Grid lines aren't visible, or look wrong. Remember grid_line_color is a brightness slider, not a hue - 0 gives black lines, 1 gives white, and there's no in-between color like "red" available. If your default (black) lines are invisible against a dark image, push the value toward 1 for white lines instead.

Colors look banded or posterized in an unpleasant way. That's the nature of hard color quantization at low color_count values - it's not a bug, it's what "reduce to 8 colors" looks like on a photo with smooth gradients (skies, skin tones). If it's too harsh, raise color_count until the banding settles into something that reads as stylized rather than broken.

Categoryimage/processing

Inputs (7)

NameTypeDefaultDescription
imageIMAGE
grid_sizeINT648–256
quantize_colorsBOOLEANtrue
color_countINT322–256
grid_linesBOOLEANfalse
grid_line_colorFLOAT0.000–1
grid_line_widthINT11–5

Outputs (1)

NameTypeDescription
IMAGEIMAGE