mirror of
https://github.com/Bing-su/adetailer.git
synced 2026-03-13 01:10:01 +00:00
Merge branch 'dev' into main
This commit is contained in:
@@ -8,12 +8,12 @@ repos:
|
||||
- id: mixed-line-ending
|
||||
|
||||
- repo: https://github.com/astral-sh/ruff-pre-commit
|
||||
rev: "v0.1.3"
|
||||
rev: v0.1.5
|
||||
hooks:
|
||||
- id: ruff
|
||||
args: [--fix, --exit-non-zero-on-fix]
|
||||
|
||||
- repo: https://github.com/psf/black-pre-commit-mirror
|
||||
rev: 23.10.1
|
||||
rev: 23.11.0
|
||||
hooks:
|
||||
- id: black
|
||||
|
||||
@@ -1,5 +1,14 @@
|
||||
# Changelog
|
||||
|
||||
## 2023-11-19
|
||||
|
||||
- v23.11.1
|
||||
- 기본 스크립트 목록에 negpip 추가
|
||||
- 기존에 설치한 사람에게 소급적용되지는 않음
|
||||
- skip img2img 옵션이 2스텝 이상일 때, 제대로 적용되지 않는 문제 수정
|
||||
- SD.Next에서 이미지가 np.ndarray로 입력되는 경우 수정
|
||||
- 컨트롤넷 경로를 sys.path에 추가하여 --data-dir등을 지정한 경우에도 임포트 에러가 일어나지 않게 함.
|
||||
|
||||
## 2023-10-30
|
||||
|
||||
- v23.11.0
|
||||
|
||||
@@ -1 +1 @@
|
||||
__version__ = "23.11.0"
|
||||
__version__ = "23.11.1"
|
||||
|
||||
@@ -2,6 +2,7 @@ from __future__ import annotations
|
||||
|
||||
import importlib
|
||||
import re
|
||||
import sys
|
||||
from functools import lru_cache
|
||||
from pathlib import Path
|
||||
from textwrap import dedent
|
||||
@@ -34,6 +35,13 @@ for extension in extensions.active():
|
||||
cn_base_path = ".".join(controlnet_path.parts[-2:])
|
||||
break
|
||||
|
||||
if controlnet_path is not None:
|
||||
sd_webui_controlnet_path = controlnet_path.resolve().parent
|
||||
if sd_webui_controlnet_path.stem in ("extensions", "extensions-builtin"):
|
||||
target_path = str(sd_webui_controlnet_path.parent)
|
||||
if target_path not in sys.path:
|
||||
sys.path.append(target_path)
|
||||
|
||||
cn_model_module = {
|
||||
"inpaint": "inpaint_global_harmonious",
|
||||
"scribble": "t2ia_sketch_pidi",
|
||||
|
||||
@@ -44,8 +44,8 @@ def run_pip(*args):
|
||||
def install():
|
||||
deps = [
|
||||
# requirements
|
||||
("ultralytics", "8.0.198", None),
|
||||
("mediapipe", "0.10.7", None),
|
||||
("ultralytics", "8.0.209", None),
|
||||
("mediapipe", "0.10.8", None),
|
||||
("rich", "13.0.0", None),
|
||||
# mediapipe
|
||||
("protobuf", "3.20", "3.9999"),
|
||||
|
||||
@@ -14,7 +14,9 @@ from typing import Any, NamedTuple
|
||||
|
||||
import gradio as gr
|
||||
import torch
|
||||
from PIL import Image
|
||||
from rich import print
|
||||
from torchvision.transforms.functional import to_pil_image
|
||||
|
||||
import modules
|
||||
from adetailer import (
|
||||
@@ -58,7 +60,7 @@ model_mapping = get_models(
|
||||
adetailer_dir, extra_dir=extra_models_dir, huggingface=not no_huggingface
|
||||
)
|
||||
txt2img_submit_button = img2img_submit_button = None
|
||||
SCRIPT_DEFAULT = "dynamic_prompting,dynamic_thresholding,wildcard_recursive,wildcards,lora_block_weight"
|
||||
SCRIPT_DEFAULT = "dynamic_prompting,dynamic_thresholding,wildcard_recursive,wildcards,lora_block_weight,negpip"
|
||||
|
||||
if (
|
||||
not adetailer_dir.exists()
|
||||
@@ -571,7 +573,9 @@ class AfterDetailerScript(scripts.Script):
|
||||
|
||||
@staticmethod
|
||||
def ensure_rgb_image(image: Any):
|
||||
if hasattr(image, "mode") and image.mode != "RGB":
|
||||
if not isinstance(image, Image.Image):
|
||||
image = to_pil_image(image)
|
||||
if image.mode != "RGB":
|
||||
image = image.convert("RGB")
|
||||
return image
|
||||
|
||||
@@ -651,7 +655,6 @@ class AfterDetailerScript(scripts.Script):
|
||||
|
||||
i = self.get_i(p)
|
||||
|
||||
pp.image = self.get_i2i_init_image(p, pp)
|
||||
i2i = self.get_i2i_p(p, args, pp.image)
|
||||
seed, subseed = self.get_seed(p)
|
||||
ad_prompts, ad_negatives = self.get_prompt(p, args)
|
||||
@@ -729,6 +732,8 @@ class AfterDetailerScript(scripts.Script):
|
||||
if getattr(p, "_ad_disabled", False) or not self.is_ad_enabled(*args_):
|
||||
return
|
||||
|
||||
pp.image = self.get_i2i_init_image(p, pp)
|
||||
pp.image = self.ensure_rgb_image(pp.image)
|
||||
init_image = copy(pp.image)
|
||||
arg_list = self.get_args(p, *args_)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user