Filter NSFW
Blur it, mosaic it, or black it out — the all-purpose censor
- image
- image
- NSFW
- score
FilterNsfw is the censor workhorse of this pack. It's IsNsfw's detection plus an actual reaction: when the detector says an image is NSFW, the node applies one of eight treatments to it instead of just flagging it. Feed it a batch and it goes frame by frame - clean images pass through untouched, flagged ones get processed. That's the behavior you want when a workflow has to output something presentable no matter what.
How it works
Detection is the same as the rest of the pack: model_name (default compvis) plus a threshold (default 0.5, lower = more trigger-happy). Then comes mode, where the real decisions happen:
blur- soft Gaussian-ish downscale-blurmosaic- the classic pixel block lookblack/white- just fill it inchecker- black-and-white checkerboardmean- fill with the image's average colornoise- random staticnsfw-chan- replace the image with the pack's own mascot (yes, really)
resolution (default 8) controls the coarseness of the effect. For mosaic it's the block size - 8 gives chunky pixels, crank it to 32 and it's unreadable. For blur it's the blur intensity. Lower values are subtler, which is usually not what a censor wants.
Outputs
image(IMAGE) - the processed result, whether censored or untouchedNSFW(BOOLEAN) - pass-through verdict, handy for branching downstreamscore(FLOAT) - the raw detector score behind it
So it both fixes the frame and tells you it fixed it. If you want to log or count how often things got censored, those two extra outputs are right there.
Install
Same pack, same drill - ComfyUI Manager (search "nsfw-shorier") or:
cd ComfyUI/custom_nodes
git clone https://github.com/phyblas/nsfw-shorier_comfyui
Restart, and expect a slow first run while the detector downloads.
Gotchas
- Threshold tuning matters twice here: too low and you blur a bunch of innocent frames; too high and the thing you were trying to hide sails through.
- The mode applies to whole images only. If you want to censor just the flagged regions and leave the rest of the art alone, that's CensorNsfwPart - same pack, same modes, but it localizes with NudeNet first.
- If you're censoring anime, the photo-trained detectors will both miss things and over-flag; budget for manual review.
Inputs (5)
| Name | Type | Default | Description |
|---|---|---|---|
| image | IMAGE | — | |
| model_name | COMBO | 8 options: compvis, falconsai, adamcodd, umairrkhn, marqo, gantman, +2 | |
| threshold | FLOAT | 0.500–1 | — |
| mode | COMBO | 8 options: blur, mosaic, black, white, checker, mean, +2 | |
| resolution | INT | 82–256 | — |
Outputs (3)
| Name | Type | Description |
|---|---|---|
| image | IMAGE | — |
| NSFW | BOOLEAN | — |
| score | FLOAT | — |