2023-06-19

!After Detailer

!After Detailer is a extension for stable diffusion webui, similar to Detection Detailer, except it uses ultralytics instead of the mmdet.

Install

(from Mikubill/sd-webui-controlnet)

Open "Extensions" tab.

Open "Install from URL" tab in the tab.

Enter https://github.com/Bing-su/adetailer.git to "URL for extension's git repository".

Press "Install" button.

Wait 5 seconds, and you will see the message "Installed into stable-diffusion-webui\extensions\adetailer. Use Installed tab to restart".

Go to "Installed" tab, click "Check for updates", and then click "Apply and restart UI". (The next time you can also use this method to update extensions.)

Completely restart A1111 webui including your terminal. (If you do not know what is a "terminal", you can reboot your computer: turn your computer off and turn it on again.)

You can now install it directly from the Extensions tab.


You DON'T need to download any model from huggingface.

Options

Model, Prompts

ADetailer modelDetermine what to detect.None= disable

ADetailer prompt, negative promptPrompts and negative prompts to applyIf left blank, it will use the same as the input.

Detection

Detection model confidence thresholdOnly objects with a detection model confidence above this threshold are used for inpainting.

Mask min/max ratioOnly use masks whose area is between those ratios for the area of the entire image.

If you want to exclude objects in the background, try setting the min ratio to around 0.01.

Mask Preprocessing

Mask x, y offsetMoves the mask horizontally and vertically by

Mask erosion (-) / dilation (+)Enlarge or reduce the detected mask.opencv example

Mask merge modeNone: Inpaint each mask

Merge: Merge all masks and inpaint

Merge and Invert: Merge all masks and Invert, then inpaint

Applied in this order: x, y offset → erosion/dilation → merge/invert.

Inpainting


Each option corresponds to a corresponding option on the inpaint tab.

ControlNet Inpainting

You can use the ControlNet extension if you have ControlNet installed and ControlNet models.

Support inpaint, scribble, lineart, openpose, tile controlnet models. Once you choose a model, the preprocessor is set automatically.

Model

ModelTargetmAP 50mAP 50-95

face_yolov8n.pt2D / realistic face0.6600.366

face_yolov8s.pt2D / realistic face0.7130.404

hand_yolov8n.pt2D / realistic hand0.7670.505

person_yolov8n-seg.pt2D / realistic person0.782 (bbox)

0.761 (mask)

0.555 (bbox)

0.460 (mask)

person_yolov8s-seg.pt2D / realistic person0.824 (bbox)

0.809 (mask)

0.605 (bbox)

0.508 (mask)

mediapipe_face_fullrealistic face--

mediapipe_face_shortrealistic face--

mediapipe_face_meshrealistic face--

The yolo models can be found on huggingface Bingsu/adetailer.

User Model

Put your ultralytics model in webui/models/adetailer. The model name should end with .pt or .pth.

It must be a bbox detection or segment model and use all label.

Dataset

Datasets used for training the yolo models are:

Face

Anime Face CreateML

xml2txt

AN

wider face

Hand

AnHDet

hand-detection-fuao9

Person

coco2017 (only person)

AniSeg

skytnt/anime-segmentation

Example



 

©著作权归作者所有,转载或内容合作请联系作者
【社区内容提示】社区部分内容疑似由AI辅助生成,浏览时请结合常识与多方信息审慎甄别。
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

相关阅读更多精彩内容

友情链接更多精彩内容