Safety Checker
The CLIP Safety Checker That Blackens Your Outputs
- images
- IMAGE
- nsfw
This is the 2022 Stable Diffusion 1.x safety filter, stuffed into a single ComfyUI node. You know the one - the black-image nanny that the community spent all of 2022 building tutorials to remove from the official pipeline. 42lux turned it back into an opt-in node, which is a genuinely useful trick if you're in the crowd that wants it: auto-generating on a rented box, building a pipeline for someone else, or just keeping a guardrail between your batch jobs and your wallpaper folder.
The name oversells it slightly. This node does not moderate prompts, call any API, or need a key. It looks at finished images - wire it straight off a VAE Decode - and decides each one is either fine or NSFW. Fine images pass through untouched. Flagged ones come out as a solid black placeholder. That's the whole deal.
How it works
The pack loads CompVis/stable-diffusion-safety-checker, the original CLIP-based safety checker from the SD 1.4/1.5 pipeline. It runs your image through the CLIP vision tower, then computes the cosine similarity between the image embedding and a fixed list of 17 "bad" concept embeddings plus 3 special-care categories (the "young girl / child" style ones). If a concept score clears the threshold, the image is flagged and replaced with zeros - literally a black tensor of the same size.
The sensitivity slider is just an offset added to those scores before the pass/fail check. At 0 it pushes the threshold so high that nothing trips (filtering off). 0.5 is the explicit-nudity threshold the author calls the standard value. At 1.0 it catches images it thinks are just lingerie/underwear - which is also where false positives get loud, so don't run 1.0 over a batch of fashion renders and then complain.
The inputs that matter
- images (IMAGE) - a single image or a batch. Comes from a
VAE Decode,Load Image, or pretty much anything upstream that outputs IMAGE. - sensitivity (FLOAT, 0–1, default 0.5) - the only dial, described above.
Two outputs come back: IMAGE (your image, or the black placeholder if flagged) and nsfw (BOOLEAN, true when flagged). The boolean is the part people sleep on: feed it into a switch node and you can route flagged outputs somewhere else - a queue-skipper, a regeneration branch, an alert - instead of letting the black image destroy your batch. If you only use the IMAGE output, the black-out is destructive; it's already replaced, the original is gone.
Installing it
Via ComfyUI Manager: search for ComfyUI-safety-checker and install, then restart. Or manually:
cd ComfyUI/custom_nodes
git clone https://github.com/42lux/ComfyUI-safety-checker
Then restart ComfyUI. It leans on transformers and torch, which ComfyUI already ships, so there's usually no extra pip install. The real cost is the model: the first time the node loads it downloads CompVis/stable-diffusion-safety-checker from HuggingFace - a CLIP ViT-L/14 checkpoint, roughly 1.7 GB. First run is slow and needs a live internet connection.
The fine print
The original repo was pulled. The author removed it from GitHub - a September 2025 r/comfyui thread asking for a replacement confirms people hit the dead link. If git clone or Manager 404s on you, that's why. The pack lives on at comfy.icu, and there are maintained forks, notably shabri-arrahim/ComfyUI-Safety-Checker and cfl-chenfangliang/ComfyUI-safety-checker-opt (the "opt" one is a near-verbatim copy of this README). Cloning a fork is the reliable path today.
Otherwise: it's a 2022 model, and it shows. It misfires on stylized/anime content, quietly misses plenty of modern stuff, and its 17-concept vocabulary is frozen in time. Treat it as a coarse tripwire, not a content-policy enforcer. And if all you need is a yes/no without destroying anything, wire the nsfw boolean - that output is the reason to run this node at all.
The author is legit, by the way. 42lux is an active ComfyUI developer - also behind the CaptainCaption image captioner and the well-received hildegard tiled upscaler for FLUX.2 Klein. This safety checker is his old, minimal tool, and it shows its age. But it's simple, free, offline after first load, and it does exactly one thing: turns NSFW output black. If that's your requirement, this is the least drama way to get it.
Inputs (2)
| Name | Type | Default | Description |
|---|---|---|---|
| images | IMAGE | — | |
| sensitivity | FLOAT | 0.50–1 | — |
Outputs (2)
| Name | Type | Description |
|---|---|---|
| IMAGE | IMAGE | — |
| nsfw | BOOLEAN | — |