Merge branch 'dev'

pull/564/head v24.3.5
Dowon 2024-03-29 22:13:54 +09:00
commit 06adf33a89
7 changed files with 42 additions and 22 deletions

View File

@ -18,6 +18,16 @@ body:
Alle Sprachen werden akzeptiert Alle Sprachen werden akzeptiert
Toutes les langues sont acceptées Toutes les langues sont acceptées
Принимаются все языки Принимаются все языки
validations:
required: true
- type: textarea
attributes:
label: Steps to reproduce
description: |
Description of how we can reproduce this issue.
validations:
required: true
- type: textarea - type: textarea
attributes: attributes:

View File

@ -1,6 +1,8 @@
name: Feature request name: Feature request
description: Suggest an idea for this project description: Suggest an idea for this project
title: "[Feature Request]: " title: "[Feature Request]: "
labels:
- enhancement
body: body:
- type: textarea - type: textarea

View File

@ -10,7 +10,9 @@ jobs:
runs-on: macos-14 runs-on: macos-14
strategy: strategy:
matrix: matrix:
python-version: ["3.9", "3.10", "3.11", "3.12"] python-version:
- "3.10"
- "3.11"
steps: steps:
- uses: actions/checkout@v4 - uses: actions/checkout@v4

View File

@ -1,5 +1,10 @@
# Changelog # Changelog
## 2024-03-29
- v24.3.5
- 알 수 없는 이유로 인페인팅을 확인하는 과정에서 Txt2Img 인스턴스가 들어오는 문제에 대한 임시 해결
## 2024-03-28 ## 2024-03-28
- v24.3.4 - v24.3.4

View File

@ -1,6 +1,6 @@
# ADetailer # ADetailer
ADetailer is a extension for stable diffusion webui, similar to Detection Detailer, except it uses ultralytics instead of the mmdet. ADetailer is an extension for the stable diffusion webui that does automatic masking and inpainting. It is similar to the Detection Detailer.
## Install ## Install
@ -18,8 +18,6 @@ You can now install it directly from the Extensions tab.
![image](https://i.imgur.com/g6GdRBT.png) ![image](https://i.imgur.com/g6GdRBT.png)
You **DON'T** need to download any base model from huggingface.
## Options ## Options
| Model, Prompts | | | | Model, Prompts | | |
@ -59,17 +57,17 @@ If you select `Passthrough`, the controlnet settings you set outside of ADetaile
## Advanced Options ## Advanced Options
API request example: [wiki/API](https://github.com/Bing-su/adetailer/wiki/API) API request example: [wiki/REST-API](https://github.com/Bing-su/adetailer/wiki/REST-API)
`ui-config.json` entries: [wiki/ui-config.json](https://github.com/Bing-su/adetailer/wiki/ui-config.json) `[SEP], [SKIP], [PROMPT]` tokens: [wiki/Advanced](https://github.com/Bing-su/adetailer/wiki/Advanced)
`[SEP], [SKIP]` tokens: [wiki/Advanced](https://github.com/Bing-su/adetailer/wiki/Advanced)
## Media ## Media
- 🎥 [どこよりも詳しいAfter Detailer (adetailer)の使い方① 【Stable Diffusion】](https://youtu.be/sF3POwPUWCE) - 🎥 [どこよりも詳しいAfter Detailer (adetailer)の使い方① 【Stable Diffusion】](https://youtu.be/sF3POwPUWCE)
- 🎥 [どこよりも詳しいAfter Detailer (adetailer)の使い方② 【Stable Diffusion】](https://youtu.be/urNISRdbIEg) - 🎥 [どこよりも詳しいAfter Detailer (adetailer)の使い方② 【Stable Diffusion】](https://youtu.be/urNISRdbIEg)
- 📜 [ADetailer Installation and 5 Usage Methods](https://kindanai.com/en/manual-adetailer/)
## Model ## Model
| Model | Target | mAP 50 | mAP 50-95 | | Model | Target | mAP 50 | mAP 50-95 |
@ -91,7 +89,7 @@ YOLO World model: https://docs.ultralytics.com/models/yolo-world/
### Additional Model ### Additional Model
Put your [ultralytics](https://github.com/ultralytics/ultralytics) yolo model in `webui/models/adetailer`. The model name should end with `.pt`. 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. It must be a bbox detection or segment model and use all label.
@ -105,7 +103,7 @@ ADetailer works in three simple steps.
## Development ## Development
ADetailer is developed and tested using the stable-diffusion 1.5 model, for the [AUTOMATIC1111/stable-diffusion-webui](https://github.com/AUTOMATIC1111/stable-diffusion-webui) repository only. 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 ## License

View File

@ -1 +1 @@
__version__ = "24.3.4" __version__ = "24.3.5"

View File

@ -267,15 +267,12 @@ class AfterDetailerScript(scripts.Script):
try: try:
inp = ADetailerArgs(**arg_dict) inp = ADetailerArgs(**arg_dict)
except ValueError as e: except ValueError as e:
msgs = [ msg = f"[-] ADetailer: ValidationError when validating {ordinal(n)} arguments"
f"[-] ADetailer: ValidationError when validating {ordinal(n)} arguments: {e}\n" if hasattr(e, "add_note"):
] e.add_note(msg)
for attr in ALL_ARGS.attrs: else:
arg = arg_dict.get(attr) print(msg, file=sys.stderr)
dtype = type(arg) raise
arg = "DEFAULT" if arg is None else repr(arg)
msgs.append(f" {attr}: {arg} ({dtype})")
raise ValueError("\n".join(msgs)) from e
all_inputs.append(inp) all_inputs.append(inp)
@ -667,12 +664,16 @@ class AfterDetailerScript(scripts.Script):
@staticmethod @staticmethod
def get_image_mask(p) -> Image.Image: def get_image_mask(p) -> Image.Image:
mask = p.image_mask mask = p.image_mask
if p.inpainting_mask_invert: if getattr(p, "inpainting_mask_invert", False):
mask = ImageChops.invert(mask) mask = ImageChops.invert(mask)
mask = create_binary_mask(mask) mask = create_binary_mask(mask)
if getattr(p, "_ad_skip_img2img", False): if getattr(p, "_ad_skip_img2img", False):
width, height = p.init_images[0].size if hasattr(p, "init_images") and p.init_images:
width, height = p.init_images[0].size
else:
msg = "[-] ADetailer: no init_images."
raise RuntimeError(msg)
else: else:
width, height = p.width, p.height width, height = p.width, p.height
return images.resize_image(p.resize_mode, mask, width, height) return images.resize_image(p.resize_mode, mask, width, height)
@ -1046,6 +1047,8 @@ def add_api_endpoints(_: gr.Blocks, app: FastAPI):
@app.get("/adetailer/v1/schema") @app.get("/adetailer/v1/schema")
async def schema(): async def schema():
if hasattr(ADetailerArgs, "model_json_schema"):
return ADetailerArgs.model_json_schema()
return ADetailerArgs.schema() return ADetailerArgs.schema()
@app.get("/adetailer/v1/ad_model") @app.get("/adetailer/v1/ad_model")