!日本語の説明は下部にあります!
This model detects NSFW areas (segments) in anime images. One model supports multiple types of detection.
Detectable Regions: nipples, pussy, anus, penis, testicles, x-ray, cross-section
Recommended Threshold: 0.5 ~ 0.8
Base Model: yolov11s-seg.pt
🗂️Install Location
Stable Diffusion WebUI/reForge -> models/adetailer
ComfyUI -> models/ultralytics/segm
❓FAQ
How to Deal with the Issue of Detected Areas Being Replaced by Another Object
If the detailer prompt is empty, enter the target prompt.
For example, if a nipples is being replaced with pussy, enter "nipples" in the prompt.
Lower the denoise value.
Expand the inpainting region.
WebUI (ADetailer): Increase "Mask erosion (-) / dilation (+)"
If "Inpaint only masked" is enabled, increase "Inpaint only masked padding, pixels"
ComfyUI (SEGS): Increase "crop_factor"
Troubleshooting “UltralyticsDetectorProvider Weights only load failed…” in ComfyUI
⚠️This workaround is required for v4 and earlier
Install the latest ComfyUI-Impact-Subpack and restart ComfyUI.
Open the file
<COMFYUI_INSTALL_PATH>\user\default\ComfyUI-Impact-Subpack\model-whitelist.txtin a text editor (e.g. Notepad).Add the following line to the end of the file, then save:
ntd11_anime_nsfw_segm_v4_all.pt
ntd11_anime_nsfw_segm_v4_anus.pt
ntd11_anime_nsfw_segm_v4_cross-section.pt
ntd11_anime_nsfw_segm_v4_nipples.pt
ntd11_anime_nsfw_segm_v4_penis.pt
ntd11_anime_nsfw_segm_v4_pussy.pt
ntd11_anime_nsfw_segm_v4_testicles.pt
ntd11_anime_nsfw_segm_v4_x-ray.ptRestart ComfyUI.
References
ComfyUI-Impact-Subpack README, Pull request
📄Note
ComfyUI allows you to filter detection class while using the "All" model.
Trained on images generated by Illustrious/noob derived models such as WAI-NSFW-illustrious-SDXL, Hassaku XL (Illustrious), Raehoshi illust XL, paruparu
Cannot be detected in monochrome images or comics
Cannot be detected in realistic images
⚙Training Settings (v5)
task="segment"
epochs=200
lr0=0.02
lrf=0.05
seed=0
imgsz=1024
batch=-1
close_mosaic=0
mosaic=0.0
erasing=0.0
scale=0.0For description of each setting, see: https://docs.ultralytics.com/modes/train/#train-settings
📢Past Announcements
Announcement for Stable Diffusion WebUI / reForge Users (2025/06/27)
I have an announcement for those using Stable Diffusion WebUI or reForge.
If you’re interested, please check out the details below—and I’d really appreciate any feedback or bug reports you may have!
When using my detection model with Stable Diffusion WebUI or reForge, the typical approach is to use it with the ADetailer extension.
While ADetailer offers many features, a few key functions were missing for making full use of my model.
To address that, I forked the original ADetailer and added the following features:
Class name filter: You can now filter detection results by specific class names
Class-specific prompts support: You can assign different prompts for each detected class using the
[CLASS=name]syntaxBounding box mask option: You can choose to use the bounding box as the mask for segmentation models, instead of the segmentation mask itself
You can find the repository here: https://github.com/newtextdoc1111/adetailer
Please see the README for installation instructions and more details on the new features.
My hope is that with class filtering, there will be no need to use anything other than the “ALL” model, and that the [CLASS=name] syntax will help reduce cases where unintended objects are drawn during inpainting.
Honestly, not having to train individual models for each release in the future would be a huge relief—this is one of the main reasons I implemented these changes 😂
If you’re someone who would still prefer to have individual models in future releases, feel free to share your specific use case. I may be able to offer an alternative solution (ComfyUI users are welcome too!).
アニメ画像のNSFW領域(セグメント)を検出するモデルです。一つのモデルで複数種類の検出に対応しています。
検出可能な領域: nipples, pussy, anus, penis, testicles, x-ray, cross-section
推奨閾値: 0.5 ~ 0.8
ベースモデル: yolov11s-seg.pt
🗂️インストール場所
Stable Diffusion WebUI/reForge -> models/adetailer
ComfyUI -> models/ultralytics/segm
❓FAQ
検出された領域が別のオブジェクトに描き換えられてしまう問題の対処法について
Detailer用プロンプトが空の場合、対象のプロンプトを入力する
nipplesがpussyに描き変わる場合、プロンプトに"nipples"と入力する
Denoseを下げる
インペイント領域を拡張する
WebUI (ADetailer): "Mask erosion (-) / dilation (+)" を増やす
ComfyUI (SEGS): "crop_factor" を増やす
ComfyUIで生成実行時に「UltralyticsDetectorProvider Weights only load failed. ...」と表示される問題の対処法について
⚠️v4以前のモデルで必要な対処法です
最新の ComfyUI-Impact-Subpack をインストールし、ComfyUIを再起動
<COMFYUIインストールパス>\user\default\ComfyUI-Impact-Subpack\model-whitelist.txtが作成されているので、メモ帳などで開く以下のテキストを追記して保存する
ntd11_anime_nsfw_segm_v4_all.pt
ntd11_anime_nsfw_segm_v4_anus.pt
ntd11_anime_nsfw_segm_v4_cross-section.pt
ntd11_anime_nsfw_segm_v4_nipples.pt
ntd11_anime_nsfw_segm_v4_penis.pt
ntd11_anime_nsfw_segm_v4_pussy.pt
ntd11_anime_nsfw_segm_v4_testicles.pt
ntd11_anime_nsfw_segm_v4_x-ray.ptComfyUIを再起動する
参考資料
📄メモ
ComfyUIの場合、"All" モデルを使いつつ検出したい種類をフィルタリング可能です
WAI-NSFW-illustrious-SDXL, Hassaku XL (Illustrious), Raehoshi illust XL, paruparu等のIllustrious/noob派生モデルで生成した画像で学習しています
モノクロ画像やコミックでは検出できません
リアル調の画像では検出できません
⚙学習設定 (v5)
task="segment"
epochs=200
lr0=0.02
lrf=0.05
seed=0
imgsz=1024
batch=-1
close_mosaic=0
mosaic=0.0
erasing=0.0
scale=0.0各設定の説明についてはこちら: https://docs.ultralytics.com/modes/train/#train-settings
📢過去のお知らせ
Stable Diffusion WebUI / reForge をお使いの方へのお知らせ(2025/06/27)
Stable Diffusion WebUI / reForge をお使いの方にお知らせがあります。
気になった方は以下の内容を確認し、感想や不具合の報告を頂けると嬉しいです!
Stable Diffusion WebUI / reForge (以下WebUIに統一)で私の検出モデルを利用する場合、ADetailerの拡張機能を使う方法が一般的です。
ADetailerは多くの機能がありますが、私の検出モデルを便利に活用するための機能がいくつか不足していました。
そこで、元のADetailerをフォークし以下の機能を追加しました。
クラスフィルター:検出したい対象をクラス名でフィルタリングする機能
クラス毎のプロンプト指定:
[CLASS=name]の構文で検出したクラス毎に個別のプロンプトを指定する機能バウンディングマスクオプション:セグメント検出モデルでもバウディングボックス形状でマスクを生成するためのオプション
リポジトリは https://github.com/newtextdoc1111/adetailer にあります。追加機能の詳細とインストール方法はREADMEを確認してください。
私の想定では、クラスフィルターがあれば「ALL」モデル以外不要になり、 [CLASS=name] 構文で適切なプロンプトを与えればインペイント後に別のオブジェクトが描画される事故も減るはずです。
特に、今後のリリースで複数のモデルファイルを学習しなくて済むと本当に助かります。このために実装したと言っても過言ではありません😂
今後のリリースでも個別モデルを残してもらいたい、と考えている方は具体的なユースケースを教えてもらえれば別の解決策を提案できるかもしれません。(ComfyUIユーザーの方からでも大丈夫です)。
Description
Improved spread pussy detection rate (100 additional images were added for training)
Added individual penis detection model
Note:
The detection rate for regions other than spread pussy is almost the same as v1.0
---
Spread pussyの検出率向上(100枚の画像を追加して学習)
penisの個別検出モデルを追加
メモ:
Spread pussy以外の検出率はv1.0とほぼ変わりません。
FAQ
Comments (23)
Does someone have any tut they can show on how to use something like this in comfy ui?
Install ComfyUI-Impact-Pack and ComfyUI-Impact-Subpack and place a Face Detailer node or a SEGS Detailer node in your workflow.
There is a tutorial at https://www.runcomfy.com/tutorials/face-detailer-comfyui-workflow-and-tutorial (bit old).
v2 can detect spread pussy usually around 0.4-0.6 range detection. Thanks for the update.
its marked as unsafe by python...maybnee you can fix that
Could you provide the detailed error message?
Also, does this issue occur with other detection models (.pt) available on Civitai?
Technically speaking, the model I published was trained using Ultralytics. Due to the specifications of Ultralytics, Python code is always embedded in the trained model file, which might be the cause of the issue.
@newtextdoc11996 The error message is
UltralyticsDetectorProvider
Weights only load failed. This file can still be loaded, to do so you have two options, [1mdo those steps only if you trust the source of the checkpoint[0m. (1) In PyTorch 2.6, we changed the default value of the weights_only argument in torch.load from False to True. Re-running torch.load with weights_only set to False will likely succeed, but it can result in arbitrary code execution. Do it only if you got the file from a trusted source. (2) Alternatively, to load with weights_only=True please check the recommended steps in the following error message. WeightsUnpickler error: Unsupported global: GLOBAL getattr was not an allowed global by default. Please use torch.serialization.add_safe_globals([getattr]) or the torch.serialization.safe_globals([getattr]) context manager to allowlist this global if you trust this class/function. Check the documentation of torch.load to learn more about types accepted by default with weights_only https://pytorch.org/docs/stable/generated/torch.load.html.
@virtualonno Thank you for reporting the error message!
After investigating, it seems that the issue is caused by the containing of Python code in the model file (.pt), which PyTorch >= 2.6 considers unsafe. If the model does not work correctly, here are some possible solutions. If you choose to apply the first or second solution, please make sure to only use model files from trusted sources.
- Install the custom node from https://github.com/ltdrdata/comfyui-unsafe-torch
- Manually set weights_only to False (around lines 141-144 in <COMFYUI_ROOT>\custom_nodes\ComfyUI-Impact-Subpack\modules\subcore.py)
- Find an alternative model 💔😭
In conclusion, I do not currently plan to make any changes to the published model.
However, if you still encounter errors after trying the above solutions, please let me know.
References:
- https://github.com/ltdrdata/ComfyUI-Impact-Pack/issues/931
- https://github.com/ltdrdata/ComfyUI-Impact-Subpack/issues/36
- https://github.com/ultralytics/ultralytics/issues/19824
とても便利で助かります。
もし可能であれば、ペニスについて、睾丸も検出できるモデルがあれば嬉しいです!
意見ありがとうございます。
睾丸の検出について、時間をかければ対応できそうです。将来のバージョンのアップデート候補として検討します。
リリースのタイミングは確約できませんのでご了承ください。
補足ですが、検出される項目はdanbooruのタグと一致させたいのでpenisに含めるのではなくtesticlesを追加する予定です(既存の項目もこのルールに沿っています)。
もし質問、意見ありましたらコメントをお願いします。
@dokiyuki 睾丸を検出出来るようにしたv3.0 betaをリリースしましたのでお知らせします📢
バージョン詳細にも経緯を記載しましたが前戯中の検出率が低い事が判明したため、今後データセットを増やして正式なv3をリリース予定です。
@newtextdoc11996
バージョンアップありがとうございます!睾丸が検出できるようになり助かります。
ただご記載の通り前戯中(特にフェラ中の男性器)や断面図の男性器の検出が弱いようですので、今後のver3にて検出精度が高まることを期待します!
また可能であれば自分でも検出モデルを向上できるようカスタマイズしてみたいのですが、どのように制作されているのかをお教えいただくことは可能でしょうか?
素人質問すみません。
@dokiyuki 改善されたようで良かったです!
正式なv3.0については近日中に公開予定です。ただ、今回は主に前戯中の画像データをメインに追加したので断面図の検出率向上は今後のバージョンで予定しています。
検出モデルの制作方法ですが、主に以下の2つのツールを使って制作しています。ただしこれらはGit, Linux, Docker, Pythonの基礎知識が必要です。
- CVAT: 画像に注釈を入れるツール
- Ultralytics: 画像と注釈データからモデルのトレーニングを行うツール
※注釈とは、検出対象を矩形やポリゴン等で囲んでラベル付けした領域の事です。
CVATを選択した理由は無料、手元のWindowsマシンで動作可能、GUIが使いやすい、自動アノテーションを行えるという点です。
特に、このモデルで扱うデータセットの都合からインターネット不要で手元で動作させられるという条件は必須でした。
競合ツールにLabelMe、LabelStudioがありますがこちらは触っていないので詳しくありません。
Ultralyticsはトレーニング用ツールとして人気があり競合も見つからなかったので、こちらを使用しています。
各ツールのインストールガイドは以下になります
CVAT: https://docs.cvat.ai/docs/administration/basics/installation/
Ultralytics: https://docs.ultralytics.com/quickstart/
他にご質問がありましたらできる範囲でお答えします。
@newtextdoc11996
ありがとうございます、早速v3を試したところ検知率が向上しました!助かります。
今後も引き続き検知率向上や断面図等も検知の予定とのことで、バージョンアップを期待します。
また手法もお教えいただき感謝します。お教えいただいた件について知見がほぼない素人ですが、自分でも調べながら、できる範囲で試してみたいと思います。
I've been getting some pretty hit-or-miss results with detection so far, have had a several cases where it can't detect a pussy or penis even when they are plainly visible no matter how low I drop the detection threshold. for example I dropped the pussy detection to almost 0 and it still couldn't see the pussy, maybe because it was a bit to the side and not spread?
same with the penis detection, dropped it really low and it sometimes doesn't see it. had a case where it wouldn't detect the penis that was in the middle of the pic until I dropped the detection to .2, and then it saw one in a piece of fabric at .4
> for example I dropped the pussy detection to almost 0 and it still couldn't see the pussy, maybe because it was a bit to the side and not spread
If it's similar to the "cleft of venus" Danbooru tag, the detection accuracy is low because that wasn't included much in the training data.
I couldn't identify the specific cause of the other random detection accuracy issues from your comments.
If you could tell me which model (Checkpoint) and prompt you're using, I might be able to offer more accurate advice.
@newtextdoc11996 yeah sure, for the checkpoint I'm using Hassaku XL (Illustrious) v1.3 Style A, and for the prompts I'll link a couple posts:
this is one of the ones that might fall under the "cleft of venus" tag like you mentioned, but I'm not sure https://civitai.com/images/69755185
this one it could find the pussy and anus, but not the penis for some reason https://civitai.com/images/69755186
and this is the one I mentioned that had a detection of around .2 for the penis https://civitai.com/images/69755183
@worgensnack Thanks for sharing the image, the cause is now clear.
The first image is close to what I think of as a "cleft of venus". As I said before, this was not included much in the training dataset, so the detection accuracy is low for any model or composition.
For the second and third images, "futanari" isn't being detected simply because it's not included in the dataset😓
I would like to be able to detect both in a future update. However, I currently don't have images for either type, so I need to start with data collection.
Because of that, I can't promise when the release will be, so I appreciate your understanding.
If you have any other questions, feel free to ask.
@newtextdoc11996 ok, thanks for the response, guess it makes sense that it's a dataset issue
This is strictly for flat color anime detection only, doesn't work at all for remotely realistic images.
for some reason it wont detect side nipples
May not be detected if the area is small relative to the overall image, or if the nipple is partially obscured.
Additionally, the detection rate may be lower for images in Cartoon or 3DCG styles.
@newtextdoc11996 no the nipple is not being coverd by anything or too small its just the side of a nipple next to the one gets detected
@mrsoulbucket507 I see. If the image is anime style rather than cartoon or 3DCG style, I don't know what the cause is at this point.
If you could provide the image URL, or the checkpoint, lora, and prompt you used, I might be able to give you more accurate answer.



