Nodes/ComfyUI-Nudenet/Apply Nudenet
ComfyUI Node

Apply Nudenet

Apply Nudenet — ComfyUI Node Guide

By phuvinh010701·Created 2 years ago·Updated 11 months ago· 63
Apply Nudenet
  • nudenet_model
  • image
  • filtered_labels
  • overlay_image
  • alpha_mask
  • IMAGE
censor_method
min_score0.20
blocks3
block_count_scaling
overlay_strength1.0

What it is

This is the node that actually does the work in the NudeNet pack - detect, decide, censor, all in one step. Feed it an image and a loaded model, and it finds exposed body regions, checks each one against a confidence threshold, and covers whatever passes with pixelation, blur, or an image of your choosing. Everything else in the pack (NudenetModelLoader, FilterdLabel) exists purely to feed this node its two upstream inputs.

Worth understanding why this is one node instead of something you'd assemble yourself, because it explains both what it's good for and where it falls over. The manual version - what people build with Impact Pack when NudeNet can't do the job - is: run a bbox detector, convert boxes to a mask, crop with something like Inpaint CropAndStitch, blur or pixelate the crop, stitch it back. Five or six nodes, real setup. ApplyNudenet collapses all of it into one, at the cost of being a fixed pipeline instead of a flexible one. For auto content-moderation on realistic photo output where the defaults are close enough, that trade is a clear win.

The inputs that matter

Required, beyond the obvious nudenet_model (from NudenetModelLoader) and image:

  • censor_method - one of pixelate, blur, gaussian_blur, or image. The first three are self-explanatory; image composites a picture over the flagged region instead of degrading it, which is the option to reach for if you want a logo, a sticker, or a solid patch rather than an obviously-blurred rectangle.
  • filtered_labels - plugs in from the FilterdLabel node. This is what actually decides which of the detector's body-part classes count as "censor this."
  • min_score (0.0–1.0, default 0.2) - the detection confidence floor. Anything the model flags below this score gets ignored. 0.2 is a fairly low, permissive default - it'll catch more, including some things that shouldn't have been flagged. Raise it if you're getting false-positive censoring on things that clearly aren't nudity; lower it only if you suspect it's missing things it shouldn't.
  • blocks (1–100, default 3) and block_count_scaling (fixed / fewer_when_small / fewer_when_large) - both only matter for the pixelate method. blocks sets how coarse the mosaic looks: low numbers give you the classic chunky censor blocks, pushed higher it approaches the original detail (and stops actually hiding anything). block_count_scaling, per the node's own tooltip, scales that block count by how large the flagged area is, so a huge region and a tiny one don't end up with wildly different-looking mosaics at the same blocks setting.

Optional, and only relevant if you picked censor_method: image:

  • overlay_image - the image composited over each flagged region.
  • overlay_strength (0.0–10.0, default 1.0) - how strongly it's blended in.
  • alpha_mask - an optional mask for controlling that composite further.

Output is a single IMAGE - the same image you fed in, with censoring applied wherever detections cleared the threshold. Send it straight to a Save/Preview node, or further down a pipeline if you're doing more processing after.

How to install it

Search "ComfyUI-Nudenet" in ComfyUI Manager, or install by hand:

cd ComfyUI/custom_nodes/
git clone https://github.com/phuvinh010701/ComfyUI-Nudenet
pip install -r requirements.txt

Then create models/Nudenet/ in your ComfyUI root and download the .onnx model file the README links (a CloudFront URL, or a HuggingFace mirror under Perfectfox256/hotscreen-detection-models) - this node is useless without a model loaded upstream via NudenetModelLoader, and the model file doesn't come with the git clone. Restart ComfyUI after.

Common issues

It works great on photos, and does almost nothing useful on anime or illustrated art. This is the single most-reported limitation of the pack, and it's not something you can threshold your way out of - people running it against stylized images consistently report it either misses obvious content or flags random, unrelated body parts instead. The underlying model was trained on real photographic data, and that gap doesn't close by turning min_score down. If your use case is anime-style output, look for an anime-specific NSFW detector (community YOLO models on CivitAI exist for exactly this) instead of fighting NudeNet's thresholds.

Nothing gets censored at all. Work backward: is filtered_labels actually wired to a FilterdLabel node with at least one label on? Is min_score so low a genuinely borderline image has nothing above threshold? And is nudenet_model really loaded - a missing .onnx file fails upstream at NudenetModelLoader, not here, but it's the first thing to rule out.

Pixelate looks wrong. Too fine to actually obscure anything - lower blocks. Inconsistent across differently-sized regions - try block_count_scaling away from fixed.

Dependency install fails. Same as everywhere in this ecosystem - requirements.txt installs into a shared Python environment alongside every other custom node you've got, and with roughly a hundred packs commonly stacked together, version collisions are a known structural annoyance, not something unique to this pack. Read the actual pip error before assuming NudeNet itself is broken.

CategoryNudenet

Inputs (10)

NameTypeDefaultDescription
nudenet_modelNUDENET_MODEL
imageIMAGE
censor_methodCOMBO4 options: pixelate, blur, gaussian_blur, image
filtered_labelsFILTERED_LABELS
min_scoreFLOAT0.200–1
blocksINT31–100
block_count_scalingCOMBOScale block count by censor area. Only affects pixelate censor.
overlay_imageoptIMAGE
overlay_strengthoptFLOAT1.00–10
alpha_maskoptMASK

Outputs (1)

NameTypeDescription
IMAGEIMAGE