Nodes/image_control/abyz22_censoring
ComfyUI Node

abyz22_censoring

When you need a mosaic, not a regeneration

By abyz22·Created 3 years ago·Updated 2 years ago· 17
abyz22_censoring
  • image
  • mask1
  • mask2
  • image
sigma20

Some regions you don't want regenerated - you want them visibly, deliberately not there. That's the old mosaic-censor look, and abyz22_censoring produces it from two masks and a blur setting. Feed it an image plus a couple of mask regions, and the covered areas come back as chunky pixelated blocks while everything else stays untouched. It's pixel math, not diffusion: no model runs, no prompt involved, and it's instant.

It ships in abyz22/image_control, the Impact-Pack fork that does body editing. In that context the honest use case is the flip side of the pack's uncensored tooling - you generated something and want the mosaic treatment on parts of it for sharing. Fine. The node doesn't care why, it just blurs the pixels.

Inputs

  • image - the frame to process (IMAGE).
  • mask1, mask2 - two MASK-typed regions. They're summed, so you can cover two areas without pre-merging them. Both are required, but an empty mask works - if the combined mask is all black the node returns the image unchanged.
  • sigma (0–100, default 20) - the Gaussian blur applied to the mask edges before binarizing. Higher sigma = softer, more organic boundary between censored and clean; lower = a harder mosaic edge.

Output is one image.

How the mosaic is made

The mechanism is honest and a little crude, in a good way. The two masks are added, run through scipy's Gaussian filter to smooth the boundary, then thresholded to a hard mask. Inside that mask the code downsamples the image to roughly 20×13 pixels and upscales it back to full size - which is exactly how a mosaic works, except most people do it in Photoshop. The smoothed mask means the blocky region feathers into the untouched pixels instead of a razor edge, which is the difference between "censored" and "glued-on rectangle". Note the output isn't a real blur filter - it's pixelation, which is the classic mosaic look rather than a smooth Gaussian smear.

Install

Same path as every node in this pack:

cd ComfyUI/custom_nodes
git clone https://github.com/abyz22/image_control

or ComfyUI Manager → "image_control", then restart. The pack's requirements pull in openpyxl, pytorch-lightning, and kornia; the first startup after install is slow because of pytorch-lightning.

Where it bites

Two things trip people up. First, the mask orientation: the node transposes a mask if its height doesn't match the image, and that's a guess about how your mask was built - if the censored block lands sideways or in the wrong corner, that's what happened; rebuild the mask rather than fighting it. Second, sigma interacts with mask size: on a tiny region a sigma of 20 can swallow the whole thing into a blurred blob, so start small (5–10) and raise it only on large areas. And remember the limitation baked into the approach - this never restores or regenerates detail, it hides it. If you actually want the pixels filled in with plausible content, that's a LaMa inpaint (abyz22_lamaInpaint in this same pack) instead.

Categoryabyz22

Inputs (4)

NameTypeDefaultDescription
imageIMAGE
mask1MASK
mask2MASK
sigmaINT200–100

Outputs (1)

NameTypeDescription
imageIMAGE