From fdfa92e07cd3bc16e4437bbb610016bb908cd767 Mon Sep 17 00:00:00 2001 From: Bingsu Date: Sat, 7 Oct 2023 14:48:12 +0900 Subject: [PATCH] fix: remove AD_ENABLE arg --- adetailer/__init__.py | 3 +-- adetailer/args.py | 6 ++---- adetailer/ui.py | 7 ++++--- 3 files changed, 7 insertions(+), 9 deletions(-) diff --git a/adetailer/__init__.py b/adetailer/__init__.py index 0ee909c..ce38959 100644 --- a/adetailer/__init__.py +++ b/adetailer/__init__.py @@ -1,5 +1,5 @@ from .__version__ import __version__ -from .args import AD_ENABLE, ALL_ARGS, ADetailerArgs +from .args import ALL_ARGS, ADetailerArgs from .common import PredictOutput, get_models from .mediapipe import mediapipe_predict from .ultralytics import ultralytics_predict @@ -8,7 +8,6 @@ AFTER_DETAILER = "ADetailer" __all__ = [ "__version__", - "AD_ENABLE", "ADetailerArgs", "AFTER_DETAILER", "ALL_ARGS", diff --git a/adetailer/args.py b/adetailer/args.py index 9aaa4cf..503eebb 100644 --- a/adetailer/args.py +++ b/adetailer/args.py @@ -2,7 +2,7 @@ from __future__ import annotations from collections import UserList from functools import cached_property, partial -from typing import Any, Literal, NamedTuple, Optional, Union +from typing import Any, Literal, NamedTuple, Optional import pydantic from pydantic import ( @@ -186,7 +186,6 @@ class ADetailerArgs(BaseModel, extra=Extra.forbid): _all_args = [ - ("ad_enable", "ADetailer enable"), ("ad_model", "ADetailer model"), ("ad_prompt", "ADetailer prompt"), ("ad_negative_prompt", "ADetailer negative prompt"), @@ -227,8 +226,7 @@ _all_args = [ ("ad_controlnet_guidance_end", "ADetailer ControlNet guidance end"), ] -AD_ENABLE = Arg(*_all_args[0]) -_args = [Arg(*args) for args in _all_args[1:]] +_args = [Arg(*args) for args in _all_args] ALL_ARGS = ArgsList(_args) BBOX_SORTBY = [ diff --git a/adetailer/ui.py b/adetailer/ui.py index 89e20f7..81815c1 100644 --- a/adetailer/ui.py +++ b/adetailer/ui.py @@ -3,12 +3,12 @@ from __future__ import annotations from dataclasses import dataclass from functools import partial from types import SimpleNamespace -from typing import Any, Callable +from typing import Any import gradio as gr from adetailer import AFTER_DETAILER, __version__ -from adetailer.args import AD_ENABLE, ALL_ARGS, MASK_MERGE_INVERT +from adetailer.args import ALL_ARGS, MASK_MERGE_INVERT from controlnet_ext import controlnet_exists, get_cn_models cn_module_choices = [ @@ -105,7 +105,8 @@ def adui( elem_id=eid("ad_version"), ) - infotext_fields.append((ad_enable, AD_ENABLE.name)) + infotext_fields.append(("ad_enable", "ADetailer enable")) + infotext_fields.append(("ad_skip_img2img", "ADetailer skip img2img")) with gr.Group(), gr.Tabs(): for n in range(num_models):