Nodes/ComfyUI-Purz/Pixelate Effect (Purz)
ComfyUI Node

Pixelate Effect (Purz)

The pixelate node that's secretly a retro game pipeline

By purzbeats·Created about a year ago·Updated 3 months ago· 24
Pixelate Effect (Purz)
  • image
  • mask
  • image
pixel_size8
pixel_size_y0
downsamplearea
palette_modenone
num_colors8
ditheringnone
dither_strength1.00
grid_lines0.00
grid_colorblack
output_modeupscaled

Most "pixelate" nodes shrink your image into chunky squares and call it a day. PurzPixelate isn't one of them. Since the v2.0 rewrite it's a real retro-graphics pipeline: it downsamples, snaps colors to a Game Boy or NES palette, dithers away the banding, and redraws the grid lines - then hands you a normal IMAGE you can feed straight back into img2img, use as a texture, or drop into a video frame batch. You reach for it when you want pixel-art vibes, not just blocks.

It comes from purzbeats' ComfyUI-Purz pack, a personal utility drawer that also ships patterns and video tools. It's pure Python and NumPy under the hood - no model files, no API, nothing to download beyond the node itself.

How it works

Think of it as a four-stage mini-pipeline. First it downsamples your image into a low-res grid, one "pixel" per block. Then it quantizes colors, either to num_colors evenly-spaced posterize levels or to a named retro palette. Then, optionally, it dithers - ordered Bayer thresholds or full Floyd-Steinberg error diffusion - so those few colors don't band. Finally it nearest-neighbor-upscales back to your original resolution and, if you ask, draws the grid lines over the seams.

The palettes are the fun part and they're real, hardcoded color sets: Game Boy, NES, C64, PICO-8, CGA, and Endesga 32. Pick pico8 and a photo suddenly reads as a tiny game sprite.

The inputs that matter

  • image - the IMAGE you're pixelating. Works on a batch.
  • pixel_size - block size in pixels, 2–128, default 8. The main dial.
  • pixel_size_y - set this to 0 (default) for square pixels, or a different value for that stretched non-square retro look.
  • palette_mode - none, posterize, or one of the six retro palettes.
  • num_colors - only used when palette_mode is posterize. Palette modes ignore it.
  • dithering - ordered_2x2/4x4/8x8 (fast, pattern-y) or floyd_steinberg (smoother, slower). dither_strength 0–2 tunes it.
  • grid_lines - 0 to 0.5; the width of the seam lines as a fraction of pixel size. grid_color picks black, dark gray, or white.
  • output_mode - upscaled (back to full size) or low_res (keep the tiny grid, useful if you're resampling yourself).
  • mask (optional) - blend pixelation in only where the mask is white.

Output is a single image (IMAGE), ready for a VAE encode, a Save Image node, or a video combiner.

Install

Same story as the rest of the pack: ComfyUI Manager (search "ComfyUI-Purz"), or

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

then restart ComfyUI. The only real dependencies are OpenCV, Pillow, NumPy, and torch - all things you almost certainly already have.

Where people get burned

  • Mask only blends in upscaled mode. If you set output_mode to low_res with a mask attached, the mask is silently ignored - the code only composites it on the upscaled path.
  • Floyd-Steinberg is slow on big images. It's a per-pixel error-diffusion loop; a 1080p photo takes a noticeable beat. Reach for ordered_4x4 first, or downscale before you pixelate.
  • num_colors does nothing in palette mode. If you set a palette and wonder why the color count slider isn't doing anything - that's why. It only drives posterize.
  • Posterize with too few levels looks flat fast. Default 8 is a decent start; 16 reads less crunchy.

If it's a one-off, the default area downsample + pico8 + ordered_4x4 dither is a great first look. After that, poke the palettes - that's where the node earns its keep.

CategoryPurz/Image/Effects

Inputs (12)

NameTypeDefaultDescription
imageIMAGE
pixel_sizeINT82–128
pixel_size_yINT00–128
downsampleCOMBOarea3 options: area, nearest, median
palette_modeCOMBOnone8 options: none, posterize, game_boy, nes, c64, pico8, +2
num_colorsINT82–256
ditheringCOMBOnone5 options: none, ordered_2x2, ordered_4x4, ordered_8x8, floyd_steinberg
dither_strengthFLOAT1.000–2
grid_linesFLOAT0.000–0.5
grid_colorCOMBOblack3 options: black, dark_gray, white
output_modeCOMBOupscaled2 options: upscaled, low_res
maskoptMASK

Outputs (1)

NameTypeDescription
imageIMAGE