ComfyUI Node

PixelIt 🎨

Turn any image into crisp pixel art (or undo someone else's attempt)

By ARZUMATAΒ·Created 2 years agoΒ·Updated 11 months agoΒ· 1
PixelIt 🎨
  • image
  • IMAGE
β—„downscale_ratio8β–Ί
β—„target_block_size_resizefalseβ–Ί
β—„target_block_size8β–Ί
β—„auto_collapse_blocksfalseβ–Ί
β—„compensate_collapsefalseβ–Ί
β—„block_detection_tolerance15.0β–Ί
β—„detect_jpgtrueβ–Ί
β—„gridfalseβ–Ί
β—„grid_alpha255β–Ί
β—„reduce_colorsfalseβ–Ί
β—„colors32β–Ί
β—„convert_grayscalefalseβ–Ί
β—„convert_palettefalseβ–Ί
β—„palette_presetnoneβ–Ί

PixelIt is the ComfyUI port of giventofly's pixelit, the little browser tool pixel-art fans have been feeding photos into for years. You drop in an image, and it comes out the other end as blocky, color-limited, grid-friendly pixel art. The node lives in one pack - ComfyUI-ARZUMATA-PixelIt - and the author added a bunch of extras "for my needs," which is your clue to how the input list looks: more switches than a cockpit, most of which you'll never touch.

Why reach for it? It's a niche stylization node, not a workflow staple. It earns its keep in two places. First, classic stylization - feed it a render or photo and make it look like a game sprite. Second, and more interesting, it reconstructs pixel art: generate pixel art, upscale it, watch it go blurry, then let PixelIt detect the original grid and rebuild the clean low-res image. That second trick is why you'd pick this over the half-dozen pixel-art filters that just downscale and call it a day.

How it works

The pipeline order matters, because it explains the input weirdness. For each image in the batch:

  1. Collapse - if enabled, it detects the block size (scanning candidates like 8, 16, 32, 4, … across a 5Γ—5 grid and scoring how many blocks are uniform), crops to a divisible size, then downsamples each block to its top-left pixel using GPU-accelerated torch ops. This is the "undo an upscale" step.
  2. Shrink - nearest-neighbor downscale by downscale_ratio (default 8 β†’ 1/8 size).
  3. Color pass - optional grayscale, median-cut color reduction, or remapping to a fixed palette.
  4. Re-block - each pixel becomes an NΓ—N block (target_block_size, default 8) via tensor repeat-interleave, so it's fast and crisp.
  5. Grid - optional overlay lines at block boundaries.

Note the balance: it shrinks by downscale_ratio in step 2 and re-expands by target_block_size in step 4. Defaults (8 and 8) cancel out, so output size β‰ˆ input size. If your result comes out tiny or enormous, one of those two is off - that's the single most common "why is this broken" moment.

The inputs that matter

Most of the 15 inputs are boolean toggles with safe defaults, so really you set three things:

  • downscale_ratio (1–256, default 8) - the big pixel size. Higher = chunkier, fewer blocks across the frame.
  • reduce_colors + colors (1–256, default 32) - quantization for that flat game-palette look. Floyd-Steinberg dithering keeps it visually smooth.
  • convert_palette + palette_preset - 38 curated palettes that map every pixel to its nearest palette color via Euclidean distance. This is the "instantly looks like a retro game" button; none skips it.

For the recovery workflow, flip target_block_size_resize on with detect_jpg left at its default true - the node then checks for JPEG 8Γ—8 blocking artifacts and auto-raises the collapse tolerance and applies a light median denoise, which is exactly what you want after a compressed upscale. block_detection_tolerance (0–50, default 15) tunes how strict "uniform block" is; if collapse is mangling a clean image, drop it.

One quirk worth knowing, from the source: auto_collapse_blocks is effectively decorative in the shipped code - collapse actually runs whenever target_block_size_resize is on, regardless of the toggle. So don't panic when enabling the resize switch starts de-pixelating things; that's intended behavior, badly labeled. It's a hobby pack, not a polished SDK.

Output: a single IMAGE tensor - wire it to a Save Image node, or back into img2img / an upscaler for a stylized pass. It handles batches fine (loops over each image), so a Batch of frames pixelates together.

Installing it

ComfyUI Manager: search "ComfyUI-ARZUMATA-PixelIt" and hit install. Or the manual way:

cd ComfyUI/custom_nodes
git clone https://github.com/ARZUMATA/ComfyUI-ARZUMATA-PixelIt

Restart ComfyUI. That's the whole install - there's no requirements.txt to fight with, no model download, no API key. It only needs torch, PIL, and numpy, which ComfyUI already ships. That "clone https://github.com/your-repo-url.git" line in the README is a placeholder; use the real URL above.

Troubleshooting

  • Output blurry instead of blocky - nearest-neighbor downscale is the whole trick; for crisp blocks, drop downscale_ratio and let target_block_size set the size.
  • Collapse wrecking a normal photo - turn target_block_size_resize off. Block detection is tuned for pixel art; a photograph just gets cropped and mangled.
  • JPG-heavy source looks dirty - that's what detect_jpg is for; keep it on.
  • It looks… bad - the presets are opinionated ("Vivid Neon," "Byzantine Rose" aren't everyone's palette), so if the default aesthetic misses, use reduce_colors with your own colors count instead.

Be aware this pack is tiny - near-zero community footprint, effectively one author scratching their own itch. The core is solid and dependency-free, but don't expect frequent updates. Still, for a two-line clone it's the most complete pixel-art utility in the graph, and the block-recovery feature genuinely isn't available anywhere else as a single node.

Categorypixelit

Inputs (15)

NameTypeDefaultDescription
imageIMAGEβ€”
downscale_ratioINT81–256β€”
target_block_size_resizeBOOLEANfalseβ€”
target_block_sizeINT81–256β€”
auto_collapse_blocksBOOLEANfalseβ€”
compensate_collapseBOOLEANfalseβ€”
block_detection_toleranceFLOAT15.00–50β€”
detect_jpgBOOLEANtrueβ€”
gridBOOLEANfalseβ€”
grid_alphaINT2550–255β€”
reduce_colorsBOOLEANfalseβ€”
colorsINT321–256β€”
convert_grayscaleBOOLEANfalseβ€”
convert_paletteBOOLEANfalseβ€”
palette_presetCOMBOnone38 options: none, Muted Twilight, Earthy Tones, Coastal Dawn, Vivid Neon, Desert Sunset, +32

Outputs (1)

NameTypeDescription
IMAGEIMAGEβ€”