From e90856adf9db302932b9223bf89442eef9cebeac Mon Sep 17 00:00:00 2001 From: Dowon Date: Fri, 29 Mar 2024 21:15:35 +0900 Subject: [PATCH 1/7] ci: fix pypi action - python version --- .github/workflows/pypi.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/pypi.yml b/.github/workflows/pypi.yml index 9136cc7..bc8b6bf 100644 --- a/.github/workflows/pypi.yml +++ b/.github/workflows/pypi.yml @@ -10,7 +10,9 @@ jobs: runs-on: macos-14 strategy: matrix: - python-version: ["3.9", "3.10", "3.11", "3.12"] + python-version: + - "3.10" + - "3.11" steps: - uses: actions/checkout@v4 From fa4aa19d7cb241fb0a07a913c920ae4ec78be156 Mon Sep 17 00:00:00 2001 From: Dowon Date: Fri, 29 Mar 2024 21:23:59 +0900 Subject: [PATCH 2/7] docs: update readme --- README.md | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/README.md b/README.md index 1eb67ff..a18a42d 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # 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 @@ -18,8 +18,6 @@ You can now install it directly from the Extensions tab. ![image](https://i.imgur.com/g6GdRBT.png) -You **DON'T** need to download any base model from huggingface. - ## Options | Model, Prompts | | | @@ -59,17 +57,17 @@ If you select `Passthrough`, the controlnet settings you set outside of ADetaile ## 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]` tokens: [wiki/Advanced](https://github.com/Bing-su/adetailer/wiki/Advanced) +`[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 | @@ -91,7 +89,7 @@ YOLO World model: https://docs.ultralytics.com/models/yolo-world/ ### 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. @@ -105,7 +103,7 @@ ADetailer works in three simple steps. ## 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 From 3e10049e846c67b9dc23b1c0e2f64416ee75af1e Mon Sep 17 00:00:00 2001 From: Dowon Date: Fri, 29 Mar 2024 21:27:32 +0900 Subject: [PATCH 3/7] fix: txt2img inpainting mask?? error --- scripts/!adetailer.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/scripts/!adetailer.py b/scripts/!adetailer.py index afe887b..09c52b8 100644 --- a/scripts/!adetailer.py +++ b/scripts/!adetailer.py @@ -667,12 +667,16 @@ class AfterDetailerScript(scripts.Script): @staticmethod def get_image_mask(p) -> Image.Image: mask = p.image_mask - if p.inpainting_mask_invert: + if getattr(p, "inpainting_mask_invert", False): mask = ImageChops.invert(mask) mask = create_binary_mask(mask) 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: width, height = p.width, p.height return images.resize_image(p.resize_mode, mask, width, height) From 5b15c9fa40da1b34dabde30ef3d0c8ed2623cacb Mon Sep 17 00:00:00 2001 From: Dowon Date: Fri, 29 Mar 2024 21:35:09 +0900 Subject: [PATCH 4/7] fix: reduce validation error message --- scripts/!adetailer.py | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/scripts/!adetailer.py b/scripts/!adetailer.py index 09c52b8..c8cdb66 100644 --- a/scripts/!adetailer.py +++ b/scripts/!adetailer.py @@ -267,15 +267,12 @@ class AfterDetailerScript(scripts.Script): try: inp = ADetailerArgs(**arg_dict) except ValueError as e: - msgs = [ - f"[-] ADetailer: ValidationError when validating {ordinal(n)} arguments: {e}\n" - ] - for attr in ALL_ARGS.attrs: - arg = arg_dict.get(attr) - dtype = type(arg) - arg = "DEFAULT" if arg is None else repr(arg) - msgs.append(f" {attr}: {arg} ({dtype})") - raise ValueError("\n".join(msgs)) from e + msg = f"[-] ADetailer: ValidationError when validating {ordinal(n)} arguments" + if hasattr(e, "add_note"): + e.add_note(msg) + else: + print(msg, file=sys.stderr) + raise all_inputs.append(inp) From a0e6836b4ecb1bd77b178f0208461ba7184036c0 Mon Sep 17 00:00:00 2001 From: Dowon Date: Fri, 29 Mar 2024 21:37:19 +0900 Subject: [PATCH 5/7] fix: /adetailer/v1/schema pydantic v2 --- scripts/!adetailer.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/scripts/!adetailer.py b/scripts/!adetailer.py index c8cdb66..4d4e426 100644 --- a/scripts/!adetailer.py +++ b/scripts/!adetailer.py @@ -1047,6 +1047,8 @@ def add_api_endpoints(_: gr.Blocks, app: FastAPI): @app.get("/adetailer/v1/schema") async def schema(): + if hasattr(ADetailerArgs, "model_json_schema"): + return ADetailerArgs.model_json_schema() return ADetailerArgs.schema() @app.get("/adetailer/v1/ad_model") From 8dc300b796d8d77b80f79872bbbbc673ea2e4b01 Mon Sep 17 00:00:00 2001 From: Dowon Date: Fri, 29 Mar 2024 21:42:44 +0900 Subject: [PATCH 6/7] chore: update issue template --- .github/ISSUE_TEMPLATE/bug_report.yaml | 10 ++++++++++ .github/ISSUE_TEMPLATE/feature_request.yaml | 2 ++ 2 files changed, 12 insertions(+) diff --git a/.github/ISSUE_TEMPLATE/bug_report.yaml b/.github/ISSUE_TEMPLATE/bug_report.yaml index 90a5772..8093934 100644 --- a/.github/ISSUE_TEMPLATE/bug_report.yaml +++ b/.github/ISSUE_TEMPLATE/bug_report.yaml @@ -18,6 +18,16 @@ body: Alle Sprachen werden akzeptiert 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 attributes: diff --git a/.github/ISSUE_TEMPLATE/feature_request.yaml b/.github/ISSUE_TEMPLATE/feature_request.yaml index c496137..0151198 100644 --- a/.github/ISSUE_TEMPLATE/feature_request.yaml +++ b/.github/ISSUE_TEMPLATE/feature_request.yaml @@ -1,6 +1,8 @@ name: Feature request description: Suggest an idea for this project title: "[Feature Request]: " +labels: + - enhancement body: - type: textarea From 8c53bdb32364247e27b325c0b6feb942cf5b85d6 Mon Sep 17 00:00:00 2001 From: Dowon Date: Fri, 29 Mar 2024 22:13:47 +0900 Subject: [PATCH 7/7] chore: v24.3.5 --- CHANGELOG.md | 5 +++++ adetailer/__version__.py | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 8c6ad70..b61d98d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,10 @@ # Changelog +## 2024-03-29 + +- v24.3.5 +- 알 수 없는 이유로 인페인팅을 확인하는 과정에서 Txt2Img 인스턴스가 들어오는 문제에 대한 임시 해결 + ## 2024-03-28 - v24.3.4 diff --git a/adetailer/__version__.py b/adetailer/__version__.py index 929b691..f8c6b65 100644 --- a/adetailer/__version__.py +++ b/adetailer/__version__.py @@ -1 +1 @@ -__version__ = "24.3.4" +__version__ = "24.3.5"