π¨ AI Pixel Art Enhancer
The AI Pixel Art Enhancer node
- image
- input_palette
- enhanced_image
- comparison_grid
- palette
The name oversells it. There's no API call, no key, no model download hidden inside - the "AI" is a preprocessing pipeline of bilateral filters, Canny edges, and color quantization. What you actually get is the fastest route from "a diffusion model drew me something vaguely pixel-arty" to "crisp, blocky, actually-good pixel art." Diffusion models are famously bad at producing clean pixels - they smear the grid into mush. This node snaps that mush to a real grid with hard edges, and does it deterministically, which is exactly why you want it in the workflow rather than another img2img pass.
What it does
Feed it any image and it downsamples to a coarse grid, picks a representative color for every cell, then scales back up to the input resolution with nearest-neighbor. That last bit is the trick: your output resolution always matches your input, so nothing downstream (VAE, video, compositing) breaks. The author's own demo workflow pairs it with the Pixel Art Style Illustrious LoRA by Skormino - generate in the right style first, then let this node do the crispening. That combo is the intended path, and it works.
How it works
The grain size sets the grid: grid = (width // pixel_size, height // pixel_size). For each cell, one of six conversion_methods decides the representative color - most_frequent (mode), average (mean), neighbor_aware, brightness-weighted light/dark, or edge_preserving. With enable_ai_enhancement on (default), the node first runs OpenCV's bilateral filter for noise, Canny edge detection to preserve structure, and contrast/saturation tweaks. After conversion it quantizes colors - default palette_extraction is median_cut, with fast_octree, k_means, and a few k-means variants available - applies Floyd-Steinberg dithering_strength, and optionally maps every pixel to a fixed palette in rgb, lab, or oklab space. Oklab is the one you'll actually care about: it's perceptually smooth and avoids the hue shifts you get mapping in raw RGB.
The inputs that matter
pixel_size(1β128, default 8) - the grain. 4β8 for a modern indie look, 8β16 for retro, 32+ for abstract blocks.conversion_method- tryedge_preservingfirst on busy images; it keeps structure whereaveragewashes it out.color_quantization(default 16) - lower for more retro. This is the dial that changes the vibe the most.dithering_strength- off by default; 0.2β0.4 fixes banding on gradients.input_palette- feed it any image and the node strictly maps every pixel to that image's exact colors, overridingcolor_quantization. Great for locking to a game's palette.batch_processing(default on) - leave it on for image batches or video frames; each frame gets the same treatment.
Three outputs: enhanced_image (the result), comparison_grid (original vs. pixel art vs. final, handy for debugging), and palette - a swatch grid of every color used, sorted by hue, which you can steal for other work.
Installing it
Easiest: ComfyUI Manager β search "AI Pixel Art Enhancer" β install, restart. Or manually:
cd ComfyUI/custom_nodes
git clone https://github.com/HSDHCdev/ComfyUI-AI-Pixel-Art-Enhancer
Then restart ComfyUI. Two gotchas here. First, the README's manual-install section literally contains a placeholder URL (yourusername/ai-pixel-art-enhancer) - don't copy it, use the real repo above. Second, the one dependency ComfyUI doesn't already bundle is opencv-python - the node does a top-level import cv2, so if it's missing the node won't even load. Install it into the same Python ComfyUI uses:
# Windows portable: ComfyUI_windows_portable\python_embeded\python.exe -m pip install opencv-python
pip install opencv-python
scikit-learn and scipy are optional - the code falls back to uniform binning / numpy broadcasting when they're absent, but you lose the better k-means quantization. Worth adding both.
Where people get burned
- Overflow RuntimeWarnings - the
most_frequentclustering does some suspicious integer math, and users on the author's release thread sawoverflow encountered in scalar addwarnings spew to console. Annoying but non-fatal; output still renders. The author asked for workflow exports to fix it, so it's known. - Washed-out colors - raise
contrast_boostandsaturation_boost. Classic post-quantization flattening. - Memory on big images - the palette matching works in chunks but still peaks on large tensors. Stick to 512β1024px input, or disable
enable_ai_enhancement. - Blurry "pixel" edges - keep
anti_aliasingoff. It's a real toggle if you want it, but it defeats the point.
One caveat on support: this is a hobbyist pack (one author, one released node out of ~20 he says he's built), so expect occasional rough edges. But for "AI image in β crisp pixel art out" with zero model downloads, it's hard to beat.
Inputs (17)
| Name | Type | Default | Description |
|---|---|---|---|
| image | IMAGE | Input image to convert into pixel art. | |
| pixel_size | INT | 81β128 | Size of each 'grain' in pixels. Output resolution will match input exactly. |
| conversion_method | COMBO | Algorithm used for conversion. 'most_frequent' (mode), 'average' (mean), 'neighbor_aware' (contextual), 'brightness_weighted_light' (favors brights), 'brightness_weighted_dark' (favors darks), 'edge_preserving' (keeps structural detail). | |
| color_similarity_threshold | FLOAT | 305β100 | Threshold for color clustering. Higher values group more colors together. |
| enable_ai_enhancementopt | BOOLEAN | true | Enable AI preprocessing and post-processing for better results. |
| noise_reductionopt | FLOAT | 0.30β1 | Strength of noise reduction filter. |
| edge_enhancementopt | FLOAT | 0.50β2 | Intensity of edge enhancement to preserve structural details. |
| color_quantizationopt | INT | 162β256 | Number of colors in the final output. Lower values give a more retro look. |
| dithering_strengthopt | FLOAT | 0.00β1 | Floyd-Steinberg dithering intensity to smoothly blend colors. |
| palette_extractionopt | COMBO | median_cut | Method to extract colors. 'median_cut' (fast and balanced), 'fast_octree' (fast for transparency), 'k_means' (accurate 3D spatial), 'k_means_outlier_preserved' (boosts rare high-contrast pixels), 'k_means_vibrant_preserved' (boosts highly saturated/pure colors), 'uniform_binning' (basic grid). |
| color_matching_spaceopt | COMBO | rgb | Color space to use when mapping pixels to the allowed palette. 'rgb' (standard linear math), 'lab' (CIELAB human perception), 'oklab' (newer smooth perception, prevents hue shifts). |
| contrast_boostopt | FLOAT | 1.00.5β2 | Contrast adjustment multiplier. |
| saturation_boostopt | FLOAT | 1.00β2 | Color saturation multiplier. |
| preserve_detailsopt | BOOLEAN | true | Enable detail preservation during processing. |
| anti_aliasingopt | BOOLEAN | false | Apply subtle anti-aliasing to final output to blend jagged edges. |
| batch_processingopt | BOOLEAN | true | Process entire batches of images (e.g., video frames). Disable for single images. |
| input_paletteopt | IMAGE | Provide an image to strictly map the result to its exact colors. Overrides 'color_quantization' maximum colors. |
Outputs (3)
| Name | Type | Description |
|---|---|---|
| enhanced_image | IMAGE | β |
| comparison_grid | IMAGE | β |
| palette | IMAGE | β |