PixelArtConverter
Make Real Pixel Art, Not Just Downscaled JPEGs
- image
- IMAGE
- FLOAT
If you've ever run an AI image through a basic downscale and called it "pixel art," this node is here to call you out. Shrinking an image with bilinear resampling just blurs it; shrinking with nearest neighbor just throws detail away. Real pixel art is a separate discipline: a detected pixel grid, a limited palette, and no soft anti-aliased edges between blocks. PixelArtConverter is one of the few nodes in ComfyUI that actually attempts the whole job in one pass - it figures out how big your "pixels" should be, quantizes the colors, and hands you back something that looks deliberate rather than accidental.
It's part of the AnotherUtils pack (marcoc2/ComfyUI-AnotherUtils), a grab-bag of image, video, audio and inference utilities by marcoags. Like most of the pack it's pure math - NumPy, OpenCV, scikit-learn under the hood - so there are no model downloads and no exotic dependencies. That's the pack's whole thing: heavy lifting without dependency hell.
How it works
The node doesn't just apply a fixed block size. It estimates one. Internally it runs Canny edge detection, then measures the spacing between edges using autocorrelation plus Hough line analysis to find the dominant repeating distance - that's your candidate pixel size. A frequency-domain estimate runs in parallel, and the two get weighted together into a final block size, clamped between min_size and max_size.
Then it averages (or median-averages) each block into a single color and runs the result through KMeans color clustering, followed by classic Floyd–Steinberg error diffusion - that's the subtle dithering that stops flat color bands from looking like posterized garbage.
The inputs that matter
palette_type- how many colors to allow. The options are Portuguese (the author's native tongue, a charming quirk):muito_limitada(very limited),limitada,muitas(many), orsem(none - skip quantization entirely). Start withlimitadaand go up if it looks too harsh.min_size/max_size- the range the detector is allowed to pick its block size from, 2–32 by default. If your source is a large illustration, nudgemax_sizeup so bigger blocks are in play.image- the only non-negotiable. It'll process a whole batch too, since it's tensor-based.
What comes out
IMAGE- the pixelated result, at reduced resolution (width/block × height/block).FLOAT- the detected block size. This is the quietly useful one: pipe it into aNearest Neighbor Upscale(the pack has one) with that scale factor and you get a crisp 1:1-pixel blowup instead of a tiny thumbnail.
Installing it
Same drill as every node in this pack:
cd ComfyUI/custom_nodes
git clone https://github.com/marcoc2/ComfyUI-AnotherUtils.git
Then restart ComfyUI. Or skip the terminal and search "AnotherUtils" in ComfyUI Manager. No models to hunt down, no requirements to fight with - this node just needs NumPy, OpenCV and scikit-learn, which virtually every ComfyUI install already has.
Where people get burned
The two classic mistakes: expecting a fixed block size (the detector can pick something you didn't want - that's what the min/max range is for), and feeding in a photo. PixelArtConverter assumes there is a pixel grid to find; for smooth photographic input the edge-spacing detector gets confused and you get muddy blocks. Run a posterization or edge-enhancement pass first if your source is a photo. Also note this is the single-image version - if you're processing hundreds of sprites, the pack's PixelArtConverter Parallel variant exists exactly for that, and Pixel Art Normalizer is the more aggressive "true 1:1 pixel art" sibling.
Inputs (4)
| Name | Type | Default | Description |
|---|---|---|---|
| image | IMAGE | — | |
| palette_type | COMBO | 4 options: muito_limitada, limitada, muitas, sem | |
| min_size | INT | 21–32 | — |
| max_size | INT | 322–64 | — |
Outputs (2)
| Name | Type | Description |
|---|---|---|
| IMAGE | IMAGE | — |
| FLOAT | FLOAT | — |