SFW API vs NudeNet
Last updated 2026-11-17
NudeNet is an open-source Python library that runs on your own servers: it detects exposed and covered body parts and returns a box for each. The SFW API is a hosted endpoint that grades the whole image: a level from 0 to 3, three scores, art and adult-object flags and a policy verdict. Facts below are from NudeNet's GitHub repository and PyPI page in November 2026 (version 3.4.2).
| SFW API | NudeNet | |
|---|---|---|
| Runs | hosted API (Germany) | your servers, ONNX Runtime on CPU or GPU |
| Price | 500 free credits/month, then $10 for 10,000 ($1.00/1k), down to $0.50/1k | free software; you pay for the servers |
| Output | level 0–3, three scores, art and sex_object flags, policy verdict | a list of detections: one of 18 labels, a score and a box |
| Whole-image decision | built in, with a policy you configure | your own rules on top of the detections |
| Models | one versioned model, metrics on Accuracy | 320n (bundled, about 12 MB) or 640m (about 104 MB), both on YOLOv8 |
| GIF/video | frame by frame on the same endpoint (video on paid accounts) | single images; GIF support is an open pull request |
| Drawings and objects | art flag, sex_object flag | no equivalent labels |
| Licence | commercial API | repository licence is AGPL-3.0 (PyPI lists MIT) |
| Maintenance | maintained with the API | last code change July 2024; the README asks for new maintainers |
NudeNet is enough if images must not leave your infrastructure, you are fine with AGPL obligations, and you want boxes, for example to blur exposed areas with its censor() method. Choose the SFW API if you want a decision per image without writing rules, need GIFs and videos, want drawings and adult objects told apart, or do not want to run and update a model yourself.
Mapping NudeNet labels to levels
| NudeNet detections | SFW API |
|---|---|
FEMALE_GENITALIA_EXPOSED, MALE_GENITALIA_EXPOSED, FEMALE_BREAST_EXPOSED, ANUS_EXPOSED | level 3 Explicit |
BUTTOCKS_EXPOSED | level 2 or 3 depending on what else is shown |
*_COVERED labels only | level 0, 1 or 2: the labels fire for clothing, swimwear and covered nudity alike |
BELLY_EXPOSED, ARMPITS_EXPOSED, FEET_EXPOSED | level 0 or 1 |
| no equivalent | art flag (drawings, anime, statues), sex_object flag (adult toys) |
The hard cases for a body-part detector are the ones between the rows: an unclothed person with intimate areas out of view (level 2) has no exposed label, and a bikini and covered nudity both produce *_COVERED. The SFW API scores those directly.
The same check in both
# NudeNet
from nudenet import NudeDetector
detector = NudeDetector()
EXPLICIT = {"FEMALE_GENITALIA_EXPOSED", "MALE_GENITALIA_EXPOSED", "FEMALE_BREAST_EXPOSED", "ANUS_EXPOSED"}
blocked = any(d["class"] in EXPLICIT and d["score"] > 0.5 for d in detector.detect("photo.jpg"))
# SFW API (pip install sfwapi)
from sfwapi import SfwApi
api = SfwApi(api_key=os.environ["SFWAPI_API_KEY"])
r = api.analyze_file("photo.jpg", policy={"block_level": 2})
blocked = r["policy"]["blocked"]Related
- Image moderation in Python with FastAPI
- Python SDK
- vs NSFW.js
- Pricing
- Accuracy and methodology
- Quickstart
Next steps
Read the quickstart for a first request, see pricing for the free tier and prepaid packs, or get a free API key and start with your own images.