Mosaic Blur
Pixelate any part of an image, from a face to a whole frame
- image
- mask
- image
Mosaic Blur is the node that turns part of your image into chunky pixels - the classic privacy mosaic you see on faces and license plates in the news. One image in, one slider, one optional mask, one image out. No models, no downloads, no GPU requirements. If you've ever generated something and thought "I can't post this, there's a recognizable face I don't have permission to show," this is a two-second fix.
It sits in the deterministic post-processing layer - the same family of cheap pixel operations that gamma curves, grain, and sharpening live in. Nothing here runs a model. It's a downscale-upscale, millisecond-cheap, and it works on any IMAGE tensor you hand it.
How it works
The mechanism is the classic mosaic recipe, two moves under the hood. The node shrinks your image with area averaging, so each block is the mean of the pixels it covers rather than one lucky pixel, then stretches it back to full size with nearest-neighbor interpolation. Chunky squares, no smoothing. That's the whole trick, and it's why results stay clean even at aggressive settings.
The mosaic_scale slider (0–100, default 10) sets how big the blocks get. Here's the part that trips people: the scale is relative to your image, not pixels. At 100, a block is a quarter of your image's longest edge - abstract art. The default of 10 is a subtle, useable pixelation; most people land somewhere between 5 and 30. Set it to 0 and the node is a no-op, passing the image straight through unchanged.
The optional mask input is where this node earns its keep. White areas of the mask get mosaiced, black areas keep the original, blended cleanly at the edges. That's the difference between "mosaic everything" and "mosaic the plate, leave the car alone." Mask convention gotcha: here white = pixelated. If you're used to masks meaning "protect this area," it's backwards - the mask marks the region you're hiding, not the region you're keeping.
The output is a single IMAGE. Wire it into a Save Image node, a preview, or feed it forward into an img2img pass if you want the mosaic baked in and then cleaned up.
Installing it
There's nothing to it. Open ComfyUI Manager, search "comfyui-mosaic-blur", and install. Or the manual route:
cd ComfyUI/custom_nodes
git clone https://github.com/vjumpkung/comfyui-mosaic-blur
Then restart ComfyUI. The pack ships zero dependencies beyond torch, which ComfyUI already has - no model files to download, no requirements.txt to break, no CUDA headaches. It runs fine on CPU too, not that you'll notice either way; the whole operation takes milliseconds.
Where people get burned
- White mask = mosaiced. If you paint a mask expecting it to protect a face and the wrong thing gets pixelated, this is why.
- Scale is relative, not pixels. Crank it to 50 on a 1024px image and you get giant blocks, not a medium mosaic. Dial it slowly.
- It's bare-bones. No feather control beyond the mask's own edge softness, no animated option - for video you'd apply it per-frame yourself.
- If your mask's batch size doesn't match the image's, you'll get a tensor shape error; the node only auto-expands a single mask.
Beyond that it's hard to break. It's a tiny single-purpose tool from a one-node pack, and for the one job it does - pixelate something before it leaves your machine - it just works.
Inputs (3)
| Name | Type | Default | Description |
|---|---|---|---|
| image | IMAGE | — | |
| mosaic_scale | INT | 100–100 | — |
| maskopt | MASK | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| image | IMAGE | — |