mirror of
https://github.com/Bing-su/adetailer.git
synced 2026-05-01 03:31:21 +00:00
Merge branch 'dev'
This commit is contained in:
@@ -8,7 +8,7 @@ repos:
|
|||||||
- id: mixed-line-ending
|
- id: mixed-line-ending
|
||||||
|
|
||||||
- repo: https://github.com/astral-sh/ruff-pre-commit
|
- repo: https://github.com/astral-sh/ruff-pre-commit
|
||||||
rev: v0.1.9
|
rev: v0.1.11
|
||||||
hooks:
|
hooks:
|
||||||
- id: ruff
|
- id: ruff
|
||||||
args: [--fix, --exit-non-zero-on-fix]
|
args: [--fix, --exit-non-zero-on-fix]
|
||||||
|
|||||||
@@ -1,5 +1,13 @@
|
|||||||
# Changelog
|
# Changelog
|
||||||
|
|
||||||
|
## 2024-01-10
|
||||||
|
|
||||||
|
- v24.1.1
|
||||||
|
- SDNext 호환 업데이트 (issue #466)
|
||||||
|
- 설정 값 state에 초기값 추가
|
||||||
|
- 위젯 값을 변경할 때마다 state도 변경되게 함 (기존에는 생성 버튼을 누를 때 적용되었음)
|
||||||
|
- `inpaint_depth_hand` 컨트롤넷 모델이 depth 모델로 인식되게 함 (issue #463)
|
||||||
|
|
||||||
## 2024-01-04
|
## 2024-01-04
|
||||||
|
|
||||||
- v24.1.0
|
- v24.1.0
|
||||||
|
|||||||
@@ -1 +1 @@
|
|||||||
__version__ = "24.1.0"
|
__version__ = "24.1.1"
|
||||||
|
|||||||
@@ -59,6 +59,9 @@ def suffix(n: int, c: str = " ") -> str:
|
|||||||
|
|
||||||
|
|
||||||
def on_widget_change(state: dict, value: Any, *, attr: str):
|
def on_widget_change(state: dict, value: Any, *, attr: str):
|
||||||
|
if "is_api" in state:
|
||||||
|
state = state.copy()
|
||||||
|
state.pop("is_api")
|
||||||
state[attr] = value
|
state[attr] = value
|
||||||
return state
|
return state
|
||||||
|
|
||||||
@@ -71,6 +74,7 @@ def on_generate_click(state: dict, *values: Any):
|
|||||||
|
|
||||||
|
|
||||||
def on_cn_model_update(cn_model_name: str):
|
def on_cn_model_update(cn_model_name: str):
|
||||||
|
cn_model_name = cn_model_name.replace("inpaint_depth", "depth")
|
||||||
for t in cn_module_choices:
|
for t in cn_module_choices:
|
||||||
if t in cn_model_name:
|
if t in cn_model_name:
|
||||||
choices = cn_module_choices[t]
|
choices = cn_module_choices[t]
|
||||||
@@ -84,6 +88,10 @@ def elem_id(item_id: str, n: int, is_img2img: bool) -> str:
|
|||||||
return f"script_{tap}_adetailer_{item_id}{suf}"
|
return f"script_{tap}_adetailer_{item_id}{suf}"
|
||||||
|
|
||||||
|
|
||||||
|
def state_init(w: Widgets) -> dict[str, Any]:
|
||||||
|
return {attr: getattr(w, attr).value for attr in ALL_ARGS.attrs}
|
||||||
|
|
||||||
|
|
||||||
def adui(
|
def adui(
|
||||||
num_models: int,
|
num_models: int,
|
||||||
is_img2img: bool,
|
is_img2img: bool,
|
||||||
@@ -139,7 +147,6 @@ def adui(
|
|||||||
|
|
||||||
def one_ui_group(n: int, is_img2img: bool, webui_info: WebuiInfo):
|
def one_ui_group(n: int, is_img2img: bool, webui_info: WebuiInfo):
|
||||||
w = Widgets()
|
w = Widgets()
|
||||||
state = gr.State({})
|
|
||||||
eid = partial(elem_id, n=n, is_img2img=is_img2img)
|
eid = partial(elem_id, n=n, is_img2img=is_img2img)
|
||||||
|
|
||||||
with gr.Row():
|
with gr.Row():
|
||||||
@@ -202,6 +209,13 @@ def one_ui_group(n: int, is_img2img: bool, webui_info: WebuiInfo):
|
|||||||
with gr.Group():
|
with gr.Group():
|
||||||
controlnet(w, n, is_img2img)
|
controlnet(w, n, is_img2img)
|
||||||
|
|
||||||
|
state = gr.State(lambda: state_init(w))
|
||||||
|
|
||||||
|
for attr in ALL_ARGS.attrs:
|
||||||
|
widget = getattr(w, attr)
|
||||||
|
on_change = partial(on_widget_change, attr=attr)
|
||||||
|
widget.change(fn=on_change, inputs=[state, widget], outputs=state, queue=False)
|
||||||
|
|
||||||
all_inputs = [state, *w.tolist()]
|
all_inputs = [state, *w.tolist()]
|
||||||
target_button = webui_info.i2i_button if is_img2img else webui_info.t2i_button
|
target_button = webui_info.i2i_button if is_img2img else webui_info.t2i_button
|
||||||
target_button.click(
|
target_button.click(
|
||||||
|
|||||||
@@ -44,7 +44,7 @@ def run_pip(*args):
|
|||||||
def install():
|
def install():
|
||||||
deps = [
|
deps = [
|
||||||
# requirements
|
# requirements
|
||||||
("ultralytics", "8.0.229", None),
|
("ultralytics", "8.1.0", None),
|
||||||
("mediapipe", "0.10.9", None),
|
("mediapipe", "0.10.9", None),
|
||||||
("rich", "13.0.0", None),
|
("rich", "13.0.0", None),
|
||||||
# mediapipe
|
# mediapipe
|
||||||
|
|||||||
Reference in New Issue
Block a user