This is yet another detection detailer named μ-Detection Detailer (shortly μ-DDetailer) forked from DDetailer as a postprocess extension for Stable Diffusion web UI.
- bbox/segment object detection using MMDetection, MMYOLO, mediapipe and ultralytics
- Inpainting helper added to support dynamically generated masks/segments viewer using js canvas to select detections easily.
- Support importing ADetailer/DDetailer infotext settings
- both mmdet 2.x / mmdet 3.x are supported
- Support Load/Save presets
015.mp4
It uses the MMDetection library to detect objects, mask them especially human faces, and then partially redraw them to bring out the details. Optionally It uses MMYOLO, mediapipe and ultralytics libraries to detect objects.
Original | Masked Preview | Inpaint |
---|---|---|
Default models enable person and face instance segmentation.
With full-resolution inpainting, the extension is handy for improving faces without the hassle of manual masking.
- Use
git clone https://github.com/wkpark/uddetailer.git
from your SD web UI/extensions
folder. Alternatively, install from the extensions tab with urlhttps://github.com/wkpark/uddetailer
- Press the
Apply and restart
button or restart SD web UI.
The models and dependencies should download automatically. To install them manually, follow the official instructions for installing mmdet. The models can be downloaded here and should be placed in /models/mmdet/bbox
for bounding box (anime-face_yolov3
) or /models/mmdet/segm
for instance segmentation models (dd-person_mask2former
). See the MMDetection docs for guidance on training your own models. For using official MMDetection pretrained models see here, these are trained for photorealism. See Troubleshooting if you encounter issues during installation.
It also supports additional ultralytics detection models and you can install YoloV8 models manually. ultralytics's models should be placed in the models/yolo
dir.
To use μ Detection Detailer in SD web UI, enable
μ Detection Detailer first, and select optional parameters, then click 'Generate'. Here are some tips:
anime-face_yolov3
can detect the bounding box of faces as the primary model whiledd-person_mask2former
isolates the head's silhouette as the secondary model by using the bitwise AND option. Refer to this example.- The dilation factor expands the mask, while the x & y offsets move the mask around.
- You can change the default prompt, negative prompt, and even checkpoint model.
- The extension is available in the img2img tab as well and can improve the quality of your 10 pulls with moderate settings (low denoise).
If you get the message ERROR: 'Failed building wheel for pycocotools' follow these steps.
For any other issues installing, open an issue.
Model | Target |
---|---|
anime-face_yolov3.pt | 2D / anime face |
dd-person_mask2former.pt 1 | coco class segmentation |
yolov5_ins_n.pth 2 | coco class instance segmentaion |
yolov5_ins_s.pth | coco class instance segmentaion |
face_yolov8n.pt 3 | 2D / realistic face |
face_yolov8s.pt 3 | 2D / realistic face |
hand_yolov8n.pt 3 | 2D / realistic hand |
hand_yolov8s.pt 3 | 2D / realistic hand |
mediapipe_face_full 4 | realistic face |
mediapipe_face_short | realistic face |
mediapipe_face_mesh | realistic face |
Optional models could be downloaded using Model Download Helper
Model | License | Target |
---|---|---|
nsfwrecog_v1.onnx | License: APL | NSFW detection |
person_yolov8n-seg.pt | License: AGPL | 2D / realistic person |
person_yolov8s-seg.pt | License: AGPL | 2D / realistic person |
dustysys/DDetailer - Author of the original Detection Detailer.
bingsu/ADetailer - Author of the ADetailer and creator of face_yolov8*pt, hand_yolov8*.pt and more.
hysts/anime-face-detector - Creator of anime-face_yolov3
, which has impressive performance on a variety of art styles.
skytnt/anime-segmentation - Synthetic dataset used to train dd-person_mask2former
.
jerryli27/AniSeg - Annotated dataset used to train dd-person_mask2former
.
open-mmlab/MMDetection - Object detection toolset. dd-person_mask2former
was trained via transfer learning using their R-50 Mask2Former instance segmentation model as a base.
open-mmlab/MMYOLO - MMYOLO is an open-source toolbox for YOLO series algorithms based on PyTorch and MMDetection.
google/mediapipe - Mediapipe is an open-source framework for building real-time perceptual computing applications.
ultralytics/ultralytics - Ultralytics is an open-source framework to support object detection and tracking, instance seg, classification and pose estimation framework.
AUTOMATIC1111/stable-diffusion-webui - Web UI for Stable Diffusion, base application for this extension.
padmalcom/nsfwrecog - NSFW Recog used for NSFW Consor helper
Footnotes
-
from MMDetection Instance Segmentation model ↩
-
from MMYolo Instance Segmentation model Yolov5 ↩
-
converted from ADetailer yolov8 models. See also https://huggingface.co/Bingsu/adetailer ↩ ↩2 ↩3 ↩4
-
Mediapipe models ↩