Stamp Censor
Mosaic is the boring option — scatter hearts over a mask instead
- image
- mask
- stamp
- image
Stamp Censor is the whole reason the pack exists. Where a mosaic or blur node pixelates a region into a gray smear, this one scatters a stamp shape over the mask until it's covered - hearts, scribble bars, stars, crosses, or your own PNG. Same mask pipeline, completely different result. It's the censorship you run when you want the result to look deliberate rather than degraded.
It fits into your workflow exactly where a blur/mosaic node would. You already have a detection chain producing a white-on-black mask (YOLO via Impact Pack, SAM3, or a Grow Mask node) - you just feed that mask here instead of into a blur. The pack is emphatic about this: it does not detect anything and it does not grow masks. Wire those nodes yourself. What you get is the prettiest possible way to cover what they found.
How it works
Under the hood it treats each connected white region of the mask as a separate job. For each region it computes the region's long-axis heading, then places stamps at random sizes, rotating them to follow that heading (that's auto_rotate) and packing them with oriented-box collision until target_coverage of the region's mask is covered. Tiny islands - the SAM speckles that would get one lonely stamp - are skipped automatically. Stamps are allowed to overflow the mask edges, which is what makes the coverage look natural instead of like a crop. If the connected stamp is a Stamp Load, the node preview on the canvas updates live, so you're not queueing to see if the layout works.
The inputs that matter
image, mask, and stamp are the three wires: the source image, the white-on-black mask, and the STAMP output from Stamp Load or Stamp Custom Load. The rest are the knobs, and only a few are worth touching on a first pass:
size_ratio(default 0.28) - stamp size as a fraction of the region's shorter side. 0.28 is a good "clearly a stamp, not a smear" size; push toward 0.5–1.0 and the region gets a few big stamps instead of many small ones.target_coverage(default 0.8) - stop placing stamps when this fraction of the mask is covered. Lower it and you get sparse, obviously-intentional stamping; higher and it approaches a solid block.spacing_factor(default 0.3) - how much stamps are allowed to overlap. 0 is full overlap, 1.0 is "oriented boxes just touch."size_jitter(default 0.15) andangle_jitter(default 0) - randomness so the layout doesn't look like a spreadsheet.auto_rotate(on by default) - align each region's stamps to its long axis, then add the load angle.uniform_pack(off) - the "Even Pack" mode: instead of random samples, slender regions get a regular scan along the long axis and squat regions a brick-staggered layout. Turn this on when the random scatter reads as messy and you want the neat version.seed(optional) - leave empty and the layout randomizes every queue; connect one to keep a layout reproducible.
Output is a single image (IMAGE), ready for a Preview Image or Save node.
Install
Search 4A Stamp Censor in ComfyUI-Manager, or:
cd ComfyUI/custom_nodes
git clone https://github.com/tsukino4a/ComfyUI-4A-StampCensor.git ComfyUI-4A-StampCensor
Restart ComfyUI after. The pleasant surprise: no extra pip packages, no model downloads. Pillow and NumPy come from ComfyUI, and the stamps are plain PNGs. This is about the lightest install in the ComfyUI ecosystem.
Common gotchas
The #1 beginner stumble is mask polarity - white areas are stamped, black is left alone, and if you feed it a mask from a node that outputs black-on-white, you get... nothing, or the whole frame. Check the mask output before blaming this node. Second: if nothing appears, the stamp input isn't connected (or is connected to something that isn't a STAMP). Third: it does not detect NSFW or grow masks, so if your mask is a tight bounding box you'll get a rectangle of stamps - that's on the detection chain, not here. Sample workflows ship in example_workflows/ (SAM3 and Impact Pack YOLO versions) if you want a working reference.
If you're making something to share or sell, this is the censor node you'll reach for - it's deterministic, cheap, and makes the covered region look chosen rather than censored.
Inputs (14)
| Name | Type | Default | Description |
|---|---|---|---|
| image | IMAGE | Source image to stamp over. | |
| mask | MASK | White areas are stamped. Each connected region is handled separately. | |
| stamp | STAMP | Connect Stamp Load or Stamp Custom Load. | |
| auto_rotate | BOOLEAN | true | On: align to each mask region's long axis, then add the Stamp Load angle. Off: use the Stamp Load angle only. |
| min_size | INT | 244–1024 | Smallest stamp size in pixels. |
| max_size | INT | 5128–2048 | Largest stamp size in pixels. Size Ratio usually hits first. |
| size_ratio | FLOAT | 0.280–2 | Stamp size as a fraction of the region's shorter side (1.0 = fill that width), before min/max clamp. Even pack: fraction of local scan width or the region's short axis; 1.0 = fill that span. |
| target_coverage | FLOAT | 0.800.05–1 | Stop placing stamps in a region when this fraction of its mask is covered. Even pack: if a region got only one stamp and landed within 0.20 above this target, one extra stamp is placed. |
| spacing_factor | FLOAT | 0.300–2 | Collision size of each stamp. 0 = allow full overlap. 1.0 = oriented boxes just touch. Even pack: overlap gate only; sites stay on the size-based skeleton. Below 1 overlaps, 1.0 = just touch. |
| size_jitter | FLOAT | 0.150–0.9 | Random size variation around the base size. |
| angle_jitter | FLOAT | 0.00–180 | Extra random rotation in degrees, added after auto-rotate or the load angle. |
| uniform_pack | BOOLEAN | false | On: slender regions scan the long axis; squat regions size to the short axis and brick-stagger. Coverage / min / max / spacing / size ratio / jitter still apply. Off: random samples. |
| stamp_angle | FLOAT | 0-180–180 | Copied from Stamp Load. Added on top of auto-rotate when it is on. |
| seedopt | INT | -1-1–4294967295 | Optional. Connected: use this seed. Empty: randomize each queue. |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| image | IMAGE | — |