ComfyUI Node

Pixelate

Pixelate, the honest mosaic node (also good at hiding things)

By isekai-sh·Created 9 months ago·Updated 8 months ago· 3
Pixelate
  • image
  • image
pixel_size10
sampling

IsekaiPixelate does exactly one thing and does it exactly how you'd guess: it turns your image into chunky mosaic blocks. That's the pixel-art / "it's a retro screenshot now" look, and it's also the fastest way to scrub identifying detail out of a face or a license plate without reaching for a real blur. Two use cases, one node.

How it works. The mechanism is a downsample-upsample trick, and it's the same one every mosaic filter in existence uses: shrink the image so each block of pixels collapses into a single sample, then stretch it back to the original size. This node downsamples to width / pixel_size on each axis using nearest-neighbor (always - that's what keeps the blocks crisp), then upsamples back. The sampling dropdown only controls that second resize: Nearest gives you the hard-edged retro blocks, Bilinear smears them slightly so the mosaic reads as a soft privacy blur instead of pixel art. If pixel_size is 1, nothing happens - the image passes through untouched.

All of this runs in pure PIL on the CPU. No model, no VRAM, no weights to download. It's fast enough that you can throw it in a loop without thinking about it.

Inputs that matter. Two of them:

  • pixel_size - the block size, 1–100, default 10. Higher is chunkier. At 10 on a 1024px image each block is ~102px across, which is aggressively abstract. Start at 5 for a "mildly retro" look.
  • sampling - Nearest (default, hard blocks) or Bilinear (soft).

Output is a single image (IMAGE tensor) you can wire straight into a preview, a save node, or anything else that eats an image. For a pixel-art aesthetic you'd chain it after VAE decode and before a save - that's the whole workflow. For the privacy use case, keep pixel_size around 8–15, use Bilinear, and accept that no amount of blur fixes a face you didn't want identifiable in the first place.

Install. Standard for the pack: ComfyUI Manager → search "isekai" → install → restart. Or:

cd ComfyUI/custom_nodes
git clone https://github.com/isekai-sh/isekai-comfy-node
cd isekai-comfy-node
pip install -r requirements.txt

Restart, and it's under the Isekai → Image/Effects menu. No model files, no extra dependencies beyond Pillow - requirements.txt is about as light as custom nodes get.

Common issues. The gotcha worth knowing applies to every image node in this pack: it processes the first image of a batch and returns a single image. Feed it a batch of four and only the first comes out pixelated. If you're pixelating a batch, either loop one image at a time or do it outside the graph. Second gotcha, and it's the pack's house style: if anything throws, the node catches the exception, logs a [Isekai] Pixelate Error line to the console, and returns your original image unchanged. So a pixelate step that "does nothing" isn't a bug in your eyes - it's the node quietly failing. Check the console first. And if you're using this on faces, remember a mosaic is reversible-ish for a determined person with a good source image; it hides detail from casual viewers, not from forensics.

CategoryIsekai/Image/Effects

Inputs (3)

NameTypeDefaultDescription
imageIMAGE
pixel_sizeINT101–100
samplingoptCOMBO2 options: Nearest, Bilinear

Outputs (1)

NameTypeDescription
imageIMAGE