mirror of
https://github.com/Bing-su/adetailer.git
synced 2026-04-29 02:31:29 +00:00
fix: json serialization issue
This commit is contained in:
@@ -1 +1 @@
|
||||
__version__ = "23.7.2"
|
||||
__version__ = "23.7.3.dev0"
|
||||
|
||||
@@ -76,8 +76,9 @@ class ADetailerArgs(BaseModel, extra=Extra.forbid):
|
||||
return values
|
||||
|
||||
@validator("is_api", pre=True)
|
||||
def is_api_validator(cls, v): # noqa: N805
|
||||
return type(v) is not object
|
||||
def is_api_validator(cls, v: Any): # noqa: N805
|
||||
"tuple is json serializable but cannot be made with json deserialize."
|
||||
return type(v) is not tuple
|
||||
|
||||
@staticmethod
|
||||
def ppop(
|
||||
|
||||
@@ -74,13 +74,14 @@ def ad_args(*args: Any) -> dict[str, Any]:
|
||||
return {}
|
||||
|
||||
arg0 = ad_args[0]
|
||||
is_api = arg0.get("is_api", True)
|
||||
return {
|
||||
"version": __version__,
|
||||
"ad_model": arg0["ad_model"],
|
||||
"ad_prompt": arg0.get("ad_prompt", ""),
|
||||
"ad_negative_prompt": arg0.get("ad_negative_prompt", ""),
|
||||
"ad_controlnet_model": arg0.get("ad_controlnet_model", "None"),
|
||||
"is_api": "is_api" not in arg0 or type(arg0["is_api"]) is not object,
|
||||
"is_api": type(is_api) is not tuple,
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -43,7 +43,7 @@ def on_widget_change(state: dict, value: Any, *, attr: str):
|
||||
def on_generate_click(state: dict, *values: Any):
|
||||
for attr, value in zip(ALL_ARGS.attrs, values):
|
||||
state[attr] = value
|
||||
state["is_api"] = object()
|
||||
state["is_api"] = ()
|
||||
return state
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user