Filter NSFW with text
The same censor, but it stamps 'NSFW' across the image
- image
- image
- NSFW
- score
FilterNsfwWithText is FilterNsfw with a label on top. Same detection, same eight processing modes, same threshold - but any frame the detector flags also gets text stamped across it, centered, by default the word "NSFW" in white with a red outline. If you're building a pipeline where censored output needs to be obviously censored - a content-moderation dump, a preview feed, a "blocked content" placeholder - this saves you from a second node doing the labeling.
How it works
The detection and mode/resolution inputs behave exactly like FilterNsfw. The new stuff is the text layer:
text(multiline, default "NSFW") - what gets stampedfont_size(default 120)fill_color(default#FFFFFF) andstroke_color(default#FF0000) - the classic white-on-red-outline warning lookstroke_width(0–1, default 0.2) - how bold the outline isfont(default "Arial") - the font file name
The text is centered and drawn with stroke, so it stays legible over a blur. The feature is adapted from the ComfyUI-TextOverlay pack, and so is the font handling.
The font gotcha
This is where people actually get stuck. Pillow needs a real font file, and "Arial" isn't guaranteed to exist on your OS - Linux boxes in particular often don't have it. The node looks in two places first: this pack's font/ folder (it ships with a Chinese font, 字魂手刻宋.ttf) and the fonts/ folder of ComfyUI-TextOverlay if you've installed that pack. The fix is easy: drop any .ttf or .ttc into ComfyUI/custom_nodes/nsfw-shorier_comfyui/font/ and type its filename into the font field. Use a bold font and a thick stroke or the text vanishes into a busy image.
Outputs
Same triple as FilterNsfw: image (censored + stamped), NSFW (BOOLEAN), and score (FLOAT). The verdict and score pass through so you can still branch or log after the fact.
Install
ComfyUI Manager (search "nsfw-shorier") or:
cd ComfyUI/custom_nodes
git clone https://github.com/phyblas/nsfw-shorier_comfyui
Restart, first run downloads the detector. If the text doesn't render, it's almost always the font - check the font field before anything else.
Inputs (11)
| 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 | — |
| text | STRING | NSFW | — |
| font_size | INT | 1201–9999 | — |
| fill_color | STRING | #FFFFFF | — |
| stroke_color | STRING | #FF0000 | — |
| stroke_width | FLOAT | 0.200–1 | — |
| font | STRING | Arial | — |
Outputs (3)
| Name | Type | Description |
|---|---|---|
| image | IMAGE | — |
| NSFW | BOOLEAN | — |
| score | FLOAT | — |