Nodes/ComfyUI-PixydustQuantizer/Pixydust Quantizer
ComfyUI Node

Pixydust Quantizer

Turn AI renders into real 16-color pixel art — not the fake stuff

By sousakujikken·Created 2 years ago·Updated 2 months ago· 34
Pixydust Quantizer
  • reduced_image
  • palette_tensor
  • Optimized Image
  • Color Histogram
  • Fixed Palette
â—„fixed_colors16â–º
◄reduction_method▾►
â—„dither_pattern8x8 Bayerâ–º
â—„color_distance_threshold2.0â–º
â—„batch_modeAll Batchesâ–º
â—„batch_index0â–º
â—„max_batch_size4â–º

The one-liner

Your diffusion model can absolutely generate pixel art. It's just never real pixel art - off-grid, blurry at the edges, and carrying hundreds of colors where a genuine 1990s 16-color sprite has sixteen. Pixydust Quantizer is the post-process that fixes that. It squeezes an image down to a small optimized palette and dithered output that genuinely looks like the EGA/VGA era, and it does the whole job in one node.

The name isn't a lie or a brand cobble: "pixy" (pixel art) + "dust" (grainy look), with a nod to fairy-dust magic. Cute, and it beats the pack's actual official title ("simplified recreation of tile patterns") for clarity.

What it actually does

Where most pipelines need a color-reduction node followed by a separate palette optimizer with dithering, this node merges the two steps. It builds the palette in LAB color space - the perceptually uniform one - so "closest color" means closest to the human eye, not closest in raw RGB. You pick K-Means or median-cut for that step, and because both cluster the actual pixel distribution, big flat regions like a character's face naturally claim more of your limited palette. That's the README's "prioritizes colors used in large areas" claim, and it's real - it's just standard clustering doing its job.

Then every pixel is matched against the palette and gets its two nearest palette colors. Here's the clever part, and the thing you can't get from ComfyUI's built-in ImageQuantize: the color_distance_threshold. If a pixel is already close enough to a palette color, it stays flat - no dithering. Only pixels that genuinely don't fit the palette get dithered, and the dither decides between those two neighbors by comparing pixel luminance against a Bayer-matrix threshold. That's the pack's selling point: you control which parts of the image tile-pattern and which stay clean.

The inputs that matter

  • fixed_colors - size of the final palette. 16 is the classic 16-color default; the dropdown runs 2 through 256.
  • reduction_method - K-Means or MedianCut. Median-cut is faster and usually fine; K-Means tends to give slightly cleaner palettes on noisy AI renders. Try both, they're cheap.
  • dither_pattern - None, or 2x2 / 4x4 / 8x8 Bayer. 8x8 is the default and the sweet spot for the retro look.
  • color_distance_threshold - the flat-vs-dithered knob, 0 to 10. Low = everything dithered, high = mostly flat colors. Start at 2.0.

One real gotcha: the image socket is literally named reduced_image, a leftover from when the README imagined this as two separate nodes. Feed it any image - it doesn't have to be pre-reduced. If your render is huge, downscale first anyway, because dithering is per-pixel math and it gets slow.

Outputs

  • Optimized Image - the dithered result; wire it to Preview or Save.
  • Color Histogram - a 256px-wide visual of the palette distribution. Mostly a debugging aid.
  • Fixed Palette - a PALETTE tensor. Feed this into another Quantizer's palette_tensor input to lock the same palette across images. That's the whole trick for video: run one Quantizer in "Single Batch" mode on frame 0, pipe its Fixed Palette into a second one set to "All Batches", and every frame uses identical colors - no flicker. max_batch_size just chunks the work so long sequences don't blow your VRAM.

Install

No models, no API keys - it's pure math on pixels. Install the pack once via ComfyUI Manager (search "ComfyUI-PixydustQuantizer"), or:

cd ComfyUI/custom_nodes
git clone https://github.com/sousakujikken/ComfyUI-PixydustQuantizer.git
pip install -r ComfyUI-PixydustQuantizer/requirements.txt

then restart ComfyUI.

Troubleshooting

  • ModuleNotFoundError: sklearn / skimage - the two deps ComfyUI's stock venv usually lacks. pip install -r requirements.txt fixes it.
  • Slow on big images - it auto-falls back to a CPU path when the GPU path trips up. Dropping max_batch_size and reducing input size helps more.
  • MPS (Apple Silicon) - 2.1.0 added MPS support to this quantizer path, so it does run on the Metal backend. Note that the pack's other two nodes don't get that treatment - see the CRT article.
  • "Batch index out of range" - you set batch_mode to Single Batch with a batch_index past the end of the batch. Bump the index or switch back to All Batches.

The one honest caveat: this is a niche pack (the main node barely registers in search traffic), so you're on your own for perfect settings - but the defaults are well-chosen, and for a 16-color look this beats chaining generic quantize nodes.

Categoryimage/Pixydust Quantizer🧚✨

Inputs (9)

NameTypeDefaultDescription
reduced_imageIMAGE—
fixed_colorsCOMBO1613 options: 2, 4, 6, 8, 12, 16, +7
reduction_methodCOMBO2 options: K-Means, MedianCut
dither_patternCOMBO8x8 Bayer4 options: None, 2x2 Bayer, 4x4 Bayer, 8x8 Bayer
color_distance_thresholdFLOAT2.00–10—
batch_modeCOMBOAll Batches2 options: All Batches, Single Batch
batch_indexINT00–9999—
max_batch_sizeCOMBO49 options: 1, 2, 4, 8, 16, 24, +3
palette_tensoroptPALETTE—

Outputs (3)

NameTypeDescription
Optimized ImageIMAGE—
Color HistogramIMAGE—
Fixed PalettePALETTE—