adetailer


Nameadetailer JSON
Version 24.5.0 PyPI version JSON
download
home_pageNone
SummaryAn object detection and auto-mask extension for stable diffusion webui.
upload_time2024-05-19 12:04:38
maintainerNone
docs_urlNone
authorNone
requires_python>=3.8
licenseAGPL-3.0
keywords adetailer stable-diffusion stable-diffusion-webui ultralytics
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # ADetailer

ADetailer is an extension for the stable diffusion webui that does automatic masking and inpainting. It is similar to the Detection Detailer.

## Install

You can install it directly from the Extensions tab.

![image](https://i.imgur.com/qaXtoI6.png)

Or

(from Mikubill/sd-webui-controlnet)

1. Open "Extensions" tab.
2. Open "Install from URL" tab in the tab.
3. Enter `https://github.com/Bing-su/adetailer.git` to "URL for extension's git repository".
4. Press "Install" button.
5. Wait 5 seconds, and you will see the message "Installed into stable-diffusion-webui\extensions\adetailer. Use Installed tab to restart".
6. 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.)
7. 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.)

## Options

| Model, Prompts                    |                                                                                    |                                                                                                                                                        |
| --------------------------------- | ---------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------ |
| ADetailer model                   | Determine what to detect.                                                          | `None` = disable                                                                                                                                       |
| ADetailer model classes           | Comma separated class names to detect. only available when using YOLO World models | If blank, use default values.<br/>default = [COCO 80 classes](https://github.com/ultralytics/ultralytics/blob/main/ultralytics/cfg/datasets/coco.yaml) |
| ADetailer prompt, negative prompt | Prompts and negative prompts to apply                                              | If left blank, it will use the same as the input.                                                                                                      |
| Skip img2img                      | Skip img2img. In practice, this works by changing the step count of img2img to 1.  | img2img only                                                                                                                                           |

| Detection                            |                                                                                              |              |
| ------------------------------------ | -------------------------------------------------------------------------------------------- | ------------ |
| Detection model confidence threshold | Only objects with a detection model confidence above this threshold are used for inpainting. |              |
| Mask min/max ratio                   | Only use masks whose area is between those ratios for the area of the entire image.          |              |
| Mask only the top k largest          | Only use the k objects with the largest area of the bbox.                                    | 0 to disable |

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

| Mask Preprocessing              |                                                                                                                                     |                                                                                         |
| ------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------- |
| Mask x, y offset                | Moves the mask horizontally and vertically by                                                                                       |                                                                                         |
| Mask erosion (-) / dilation (+) | Enlarge or reduce the detected mask.                                                                                                | [opencv example](https://docs.opencv.org/4.7.0/db/df6/tutorial_erosion_dilatation.html) |
| Mask merge mode                 | `None`: Inpaint each mask<br/>`Merge`: Merge all masks and inpaint<br/>`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. Therefore, please refer to the inpaint tab for usage details on how to use each option.

## ControlNet Inpainting

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

Support `inpaint, scribble, lineart, openpose, tile, depth` controlnet models. Once you choose a model, the preprocessor is set automatically. It works separately from the model set by the Controlnet extension.

If you select `Passthrough`, the controlnet settings you set outside of ADetailer will be used.

## Advanced Options

API request example: [wiki/REST-API](https://github.com/Bing-su/adetailer/wiki/REST-API)

`[SEP], [SKIP], [PROMPT]` tokens: [wiki/Advanced](https://github.com/Bing-su/adetailer/wiki/Advanced)

## Media

- 🎥 [どこよりも詳しい After Detailer (adetailer)の使い方 ① 【Stable Diffusion】](https://youtu.be/sF3POwPUWCE)
- 🎥 [どこよりも詳しい After Detailer (adetailer)の使い方 ② 【Stable Diffusion】](https://youtu.be/urNISRdbIEg)

- 📜 [ADetailer Installation and 5 Usage Methods](https://kindanai.com/en/manual-adetailer/)

## Model

| Model                 | Target                | mAP 50                        | mAP 50-95                     |
| --------------------- | --------------------- | ----------------------------- | ----------------------------- |
| face_yolov8n.pt       | 2D / realistic face   | 0.660                         | 0.366                         |
| face_yolov8s.pt       | 2D / realistic face   | 0.713                         | 0.404                         |
| hand_yolov8n.pt       | 2D / realistic hand   | 0.767                         | 0.505                         |
| person_yolov8n-seg.pt | 2D / realistic person | 0.782 (bbox)<br/>0.761 (mask) | 0.555 (bbox)<br/>0.460 (mask) |
| person_yolov8s-seg.pt | 2D / realistic person | 0.824 (bbox)<br/>0.809 (mask) | 0.605 (bbox)<br/>0.508 (mask) |
| mediapipe_face_full   | realistic face        | -                             | -                             |
| mediapipe_face_short  | realistic face        | -                             | -                             |
| mediapipe_face_mesh   | realistic face        | -                             | -                             |

The YOLO models can be found on huggingface [Bingsu/adetailer](https://huggingface.co/Bingsu/adetailer).

For a detailed description of the YOLO8 model, see: https://docs.ultralytics.com/models/yolov8/#overview

YOLO World model: https://docs.ultralytics.com/models/yolo-world/

### Additional Model

Put your [ultralytics](https://github.com/ultralytics/ultralytics) yolo model in `models/adetailer`. The model name should end with `.pt`.

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

## How it works

ADetailer works in three simple steps.

1. Create an image.
2. Detect object with a detection model and create a mask image.
3. Inpaint using the image from 1 and the mask from 2.

## Development

ADetailer is developed and tested using the stable-diffusion 1.5 model, for the latest version of [AUTOMATIC1111/stable-diffusion-webui](https://github.com/AUTOMATIC1111/stable-diffusion-webui) repository only.

## License

ADetailer is a derivative work that uses two AGPL-licensed works (stable-diffusion-webui, ultralytics) and is therefore distributed under the AGPL license.

## See Also

- https://github.com/ototadana/sd-face-editor
- https://github.com/continue-revolution/sd-webui-segment-anything
- https://github.com/portu-sim/sd-webui-bmab

            

Raw data

            {
    "_id": null,
    "home_page": null,
    "name": "adetailer",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.8",
    "maintainer_email": null,
    "keywords": "adetailer, stable-diffusion, stable-diffusion-webui, ultralytics",
    "author": null,
    "author_email": "dowon <ks2515@naver.com>",
    "download_url": "https://files.pythonhosted.org/packages/a7/bd/1bb65392a6aea3bc3e4fc31426e9eab90b532a851383e61b5d01e067dbe3/adetailer-24.5.0.tar.gz",
    "platform": null,
    "description": "# ADetailer\n\nADetailer is an extension for the stable diffusion webui that does automatic masking and inpainting. It is similar to the Detection Detailer.\n\n## Install\n\nYou can install it directly from the Extensions tab.\n\n![image](https://i.imgur.com/qaXtoI6.png)\n\nOr\n\n(from Mikubill/sd-webui-controlnet)\n\n1. Open \"Extensions\" tab.\n2. Open \"Install from URL\" tab in the tab.\n3. Enter `https://github.com/Bing-su/adetailer.git` to \"URL for extension's git repository\".\n4. Press \"Install\" button.\n5. Wait 5 seconds, and you will see the message \"Installed into stable-diffusion-webui\\extensions\\adetailer. Use Installed tab to restart\".\n6. 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.)\n7. 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.)\n\n## Options\n\n| Model, Prompts                    |                                                                                    |                                                                                                                                                        |\n| --------------------------------- | ---------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------ |\n| ADetailer model                   | Determine what to detect.                                                          | `None`\u00a0= disable                                                                                                                                       |\n| ADetailer model classes           | Comma separated class names to detect. only available when using YOLO World models | If blank, use default values.<br/>default = [COCO 80 classes](https://github.com/ultralytics/ultralytics/blob/main/ultralytics/cfg/datasets/coco.yaml) |\n| ADetailer prompt,\u00a0negative prompt | Prompts and negative prompts to apply                                              | If left blank, it will use the same as the input.                                                                                                      |\n| Skip img2img                      | Skip img2img. In practice, this works by changing the step count of img2img to 1.  | img2img only                                                                                                                                           |\n\n| Detection                            |                                                                                              |              |\n| ------------------------------------ | -------------------------------------------------------------------------------------------- | ------------ |\n| Detection model confidence threshold | Only objects with a detection model confidence above this threshold are used for inpainting. |              |\n| Mask min/max ratio                   | Only use masks whose area is between those ratios for the area of the entire image.          |              |\n| Mask only the top k largest          | Only use the k objects with the largest area of the bbox.                                    | 0 to disable |\n\nIf you want to exclude objects in the background, try setting the min ratio to around `0.01`.\n\n| Mask Preprocessing              |                                                                                                                                     |                                                                                         |\n| ------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------- |\n| Mask x, y offset                | Moves the mask horizontally and vertically by                                                                                       |                                                                                         |\n| Mask erosion (-) / dilation (+) | Enlarge or reduce the detected mask.                                                                                                | [opencv example](https://docs.opencv.org/4.7.0/db/df6/tutorial_erosion_dilatation.html) |\n| Mask merge mode                 | `None`: Inpaint each mask<br/>`Merge`: Merge all masks and inpaint<br/>`Merge and Invert`: Merge all masks and Invert, then inpaint |                                                                                         |\n\nApplied in this order: x, y offset \u2192 erosion/dilation \u2192 merge/invert.\n\n#### Inpainting\n\nEach option corresponds to a corresponding option on the inpaint tab. Therefore, please refer to the inpaint tab for usage details on how to use each option.\n\n## ControlNet Inpainting\n\nYou can use the ControlNet extension if you have ControlNet installed and ControlNet models.\n\nSupport `inpaint, scribble, lineart, openpose, tile, depth` controlnet models. Once you choose a model, the preprocessor is set automatically. It works separately from the model set by the Controlnet extension.\n\nIf you select `Passthrough`, the controlnet settings you set outside of ADetailer will be used.\n\n## Advanced Options\n\nAPI request example: [wiki/REST-API](https://github.com/Bing-su/adetailer/wiki/REST-API)\n\n`[SEP], [SKIP], [PROMPT]` tokens: [wiki/Advanced](https://github.com/Bing-su/adetailer/wiki/Advanced)\n\n## Media\n\n- \ud83c\udfa5 [\u3069\u3053\u3088\u308a\u3082\u8a73\u3057\u3044 After Detailer (adetailer)\u306e\u4f7f\u3044\u65b9 \u2460 \u3010Stable Diffusion\u3011](https://youtu.be/sF3POwPUWCE)\n- \ud83c\udfa5 [\u3069\u3053\u3088\u308a\u3082\u8a73\u3057\u3044 After Detailer (adetailer)\u306e\u4f7f\u3044\u65b9 \u2461 \u3010Stable Diffusion\u3011](https://youtu.be/urNISRdbIEg)\n\n- \ud83d\udcdc [ADetailer Installation and 5 Usage Methods](https://kindanai.com/en/manual-adetailer/)\n\n## Model\n\n| Model                 | Target                | mAP 50                        | mAP 50-95                     |\n| --------------------- | --------------------- | ----------------------------- | ----------------------------- |\n| face_yolov8n.pt       | 2D / realistic face   | 0.660                         | 0.366                         |\n| face_yolov8s.pt       | 2D / realistic face   | 0.713                         | 0.404                         |\n| hand_yolov8n.pt       | 2D / realistic hand   | 0.767                         | 0.505                         |\n| person_yolov8n-seg.pt | 2D / realistic person | 0.782 (bbox)<br/>0.761 (mask) | 0.555 (bbox)<br/>0.460 (mask) |\n| person_yolov8s-seg.pt | 2D / realistic person | 0.824 (bbox)<br/>0.809 (mask) | 0.605 (bbox)<br/>0.508 (mask) |\n| mediapipe_face_full   | realistic face        | -                             | -                             |\n| mediapipe_face_short  | realistic face        | -                             | -                             |\n| mediapipe_face_mesh   | realistic face        | -                             | -                             |\n\nThe YOLO models can be found on huggingface [Bingsu/adetailer](https://huggingface.co/Bingsu/adetailer).\n\nFor a detailed description of the YOLO8 model, see: https://docs.ultralytics.com/models/yolov8/#overview\n\nYOLO World model: https://docs.ultralytics.com/models/yolo-world/\n\n### Additional Model\n\nPut your [ultralytics](https://github.com/ultralytics/ultralytics) yolo model in `models/adetailer`. The model name should end with `.pt`.\n\nIt must be a bbox detection or segment model and use all label.\n\n## How it works\n\nADetailer works in three simple steps.\n\n1. Create an image.\n2. Detect object with a detection model and create a mask image.\n3. Inpaint using the image from 1 and the mask from 2.\n\n## Development\n\nADetailer is developed and tested using the stable-diffusion 1.5 model, for the latest version of [AUTOMATIC1111/stable-diffusion-webui](https://github.com/AUTOMATIC1111/stable-diffusion-webui) repository only.\n\n## License\n\nADetailer is a derivative work that uses two AGPL-licensed works (stable-diffusion-webui, ultralytics) and is therefore distributed under the AGPL license.\n\n## See Also\n\n- https://github.com/ototadana/sd-face-editor\n- https://github.com/continue-revolution/sd-webui-segment-anything\n- https://github.com/portu-sim/sd-webui-bmab\n",
    "bugtrack_url": null,
    "license": "AGPL-3.0",
    "summary": "An object detection and auto-mask extension for stable diffusion webui.",
    "version": "24.5.0",
    "project_urls": {
        "repository": "https://github.com/Bing-su/adetailer"
    },
    "split_keywords": [
        "adetailer",
        " stable-diffusion",
        " stable-diffusion-webui",
        " ultralytics"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "796ccd9e7b977f1b0b72edbd715e5800f007410205db13f8a9efa3b51673d32e",
                "md5": "227186f6185b2083c5a755a439dda7c1",
                "sha256": "7037b3e041d0b48de2e357a6c673217970c70202efbc1b05296f8475075a1be9"
            },
            "downloads": -1,
            "filename": "adetailer-24.5.0-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "227186f6185b2083c5a755a439dda7c1",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.8",
            "size": 24833,
            "upload_time": "2024-05-19T12:04:36",
            "upload_time_iso_8601": "2024-05-19T12:04:36.992496Z",
            "url": "https://files.pythonhosted.org/packages/79/6c/cd9e7b977f1b0b72edbd715e5800f007410205db13f8a9efa3b51673d32e/adetailer-24.5.0-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "a7bd1bb65392a6aea3bc3e4fc31426e9eab90b532a851383e61b5d01e067dbe3",
                "md5": "9415e2894c0413f32f05eb2a88a35dc6",
                "sha256": "48d61ea78442bb7f28353f3855bd78178edca1cd4d5e3a051908008d590521cf"
            },
            "downloads": -1,
            "filename": "adetailer-24.5.0.tar.gz",
            "has_sig": false,
            "md5_digest": "9415e2894c0413f32f05eb2a88a35dc6",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.8",
            "size": 52010,
            "upload_time": "2024-05-19T12:04:38",
            "upload_time_iso_8601": "2024-05-19T12:04:38.689592Z",
            "url": "https://files.pythonhosted.org/packages/a7/bd/1bb65392a6aea3bc3e4fc31426e9eab90b532a851383e61b5d01e067dbe3/adetailer-24.5.0.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-05-19 12:04:38",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "Bing-su",
    "github_project": "adetailer",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "lcname": "adetailer"
}
        
Elapsed time: 0.26601s