mirror of
https://github.com/comfyanonymous/ComfyUI.git
synced 2026-07-21 23:41:28 +08:00
Improved API support
- Run comfyui workflows directly inside other python applications using EmbeddedComfyClient. - Optional telemetry in prompts and models using anonymity preserving Plausible self-hosted or hosted. - Better OpenAPI schema - Basic support for distributed ComfyUI backends. Limitations: no progress reporting, no easy way to start your own distributed backend, requires RabbitMQ as a message broker.
This commit is contained in:
@@ -0,0 +1,5 @@
|
||||
# we can not import model classes here because that would create a circular
|
||||
# reference which would not work in python2
|
||||
# do not import all models into this module because that uses a lot of memory and stack frames
|
||||
# if you need the ability to import all models from one package, import them with
|
||||
# from comfy.api.components.schemas import ModelA, ModelB
|
||||
@@ -0,0 +1,205 @@
|
||||
# coding: utf-8
|
||||
|
||||
"""
|
||||
comfyui
|
||||
No description provided (generated by Openapi JSON Schema Generator https://github.com/openapi-json-schema-tools/openapi-json-schema-generator) # noqa: E501
|
||||
The version of the OpenAPI document: 0.0.1
|
||||
Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator
|
||||
"""
|
||||
|
||||
from __future__ import annotations
|
||||
from comfy.api.shared_imports.schema_imports import * # pyright: ignore [reportWildcardImportFromLibrary]
|
||||
|
||||
|
||||
from comfy.api.components.schema import workflow
|
||||
Properties = typing.TypedDict(
|
||||
'Properties',
|
||||
{
|
||||
"workflow": typing.Type[workflow.Workflow],
|
||||
}
|
||||
)
|
||||
|
||||
|
||||
class ExtraPnginfoDict(schemas.immutabledict[str, schemas.OUTPUT_BASE_TYPES]):
|
||||
|
||||
__required_keys__: typing.FrozenSet[str] = frozenset({
|
||||
})
|
||||
__optional_keys__: typing.FrozenSet[str] = frozenset({
|
||||
"workflow",
|
||||
})
|
||||
|
||||
def __new__(
|
||||
cls,
|
||||
*,
|
||||
workflow: typing.Union[
|
||||
workflow.WorkflowDictInput,
|
||||
workflow.WorkflowDict,
|
||||
schemas.Unset
|
||||
] = schemas.unset,
|
||||
configuration_: typing.Optional[schema_configuration.SchemaConfiguration] = None,
|
||||
**kwargs: schemas.INPUT_TYPES_ALL,
|
||||
):
|
||||
arg_: typing.Dict[str, typing.Any] = {}
|
||||
for key_, val in (
|
||||
("workflow", workflow),
|
||||
):
|
||||
if isinstance(val, schemas.Unset):
|
||||
continue
|
||||
arg_[key_] = val
|
||||
arg_.update(kwargs)
|
||||
used_arg_ = typing.cast(ExtraPnginfoDictInput, arg_)
|
||||
return ExtraPnginfo.validate(used_arg_, configuration=configuration_)
|
||||
|
||||
@staticmethod
|
||||
def from_dict_(
|
||||
arg: typing.Union[
|
||||
ExtraPnginfoDictInput,
|
||||
ExtraPnginfoDict
|
||||
],
|
||||
configuration: typing.Optional[schema_configuration.SchemaConfiguration] = None
|
||||
) -> ExtraPnginfoDict:
|
||||
return ExtraPnginfo.validate(arg, configuration=configuration)
|
||||
|
||||
@property
|
||||
def workflow(self) -> typing.Union[workflow.WorkflowDict, schemas.Unset]:
|
||||
val = self.get("workflow", schemas.unset)
|
||||
if isinstance(val, schemas.Unset):
|
||||
return val
|
||||
return typing.cast(
|
||||
workflow.WorkflowDict,
|
||||
val
|
||||
)
|
||||
|
||||
def get_additional_property_(self, name: str) -> typing.Union[schemas.OUTPUT_BASE_TYPES, schemas.Unset]:
|
||||
schemas.raise_if_key_known(name, self.__required_keys__, self.__optional_keys__)
|
||||
return self.get(name, schemas.unset)
|
||||
ExtraPnginfoDictInput = typing.Mapping[str, schemas.INPUT_TYPES_ALL]
|
||||
|
||||
|
||||
@dataclasses.dataclass(frozen=True)
|
||||
class ExtraPnginfo(
|
||||
schemas.Schema[ExtraPnginfoDict, tuple]
|
||||
):
|
||||
types: typing.FrozenSet[typing.Type] = frozenset({schemas.immutabledict})
|
||||
properties: Properties = dataclasses.field(default_factory=lambda: schemas.typed_dict_to_instance(Properties)) # type: ignore
|
||||
type_to_output_cls: typing.Mapping[
|
||||
typing.Type,
|
||||
typing.Type
|
||||
] = dataclasses.field(
|
||||
default_factory=lambda: {
|
||||
schemas.immutabledict: ExtraPnginfoDict
|
||||
}
|
||||
)
|
||||
|
||||
@classmethod
|
||||
def validate(
|
||||
cls,
|
||||
arg: typing.Union[
|
||||
ExtraPnginfoDictInput,
|
||||
ExtraPnginfoDict,
|
||||
],
|
||||
configuration: typing.Optional[schema_configuration.SchemaConfiguration] = None
|
||||
) -> ExtraPnginfoDict:
|
||||
return super().validate_base(
|
||||
arg,
|
||||
configuration=configuration,
|
||||
)
|
||||
|
||||
Properties2 = typing.TypedDict(
|
||||
'Properties2',
|
||||
{
|
||||
"extra_pnginfo": typing.Type[ExtraPnginfo],
|
||||
}
|
||||
)
|
||||
|
||||
|
||||
class ExtraDataDict(schemas.immutabledict[str, schemas.OUTPUT_BASE_TYPES]):
|
||||
|
||||
__required_keys__: typing.FrozenSet[str] = frozenset({
|
||||
})
|
||||
__optional_keys__: typing.FrozenSet[str] = frozenset({
|
||||
"extra_pnginfo",
|
||||
})
|
||||
|
||||
def __new__(
|
||||
cls,
|
||||
*,
|
||||
extra_pnginfo: typing.Union[
|
||||
ExtraPnginfoDictInput,
|
||||
ExtraPnginfoDict,
|
||||
schemas.Unset
|
||||
] = schemas.unset,
|
||||
configuration_: typing.Optional[schema_configuration.SchemaConfiguration] = None,
|
||||
**kwargs: schemas.INPUT_TYPES_ALL,
|
||||
):
|
||||
arg_: typing.Dict[str, typing.Any] = {}
|
||||
for key_, val in (
|
||||
("extra_pnginfo", extra_pnginfo),
|
||||
):
|
||||
if isinstance(val, schemas.Unset):
|
||||
continue
|
||||
arg_[key_] = val
|
||||
arg_.update(kwargs)
|
||||
used_arg_ = typing.cast(ExtraDataDictInput, arg_)
|
||||
return ExtraData.validate(used_arg_, configuration=configuration_)
|
||||
|
||||
@staticmethod
|
||||
def from_dict_(
|
||||
arg: typing.Union[
|
||||
ExtraDataDictInput,
|
||||
ExtraDataDict
|
||||
],
|
||||
configuration: typing.Optional[schema_configuration.SchemaConfiguration] = None
|
||||
) -> ExtraDataDict:
|
||||
return ExtraData.validate(arg, configuration=configuration)
|
||||
|
||||
@property
|
||||
def extra_pnginfo(self) -> typing.Union[ExtraPnginfoDict, schemas.Unset]:
|
||||
val = self.get("extra_pnginfo", schemas.unset)
|
||||
if isinstance(val, schemas.Unset):
|
||||
return val
|
||||
return typing.cast(
|
||||
ExtraPnginfoDict,
|
||||
val
|
||||
)
|
||||
|
||||
def get_additional_property_(self, name: str) -> typing.Union[schemas.OUTPUT_BASE_TYPES, schemas.Unset]:
|
||||
schemas.raise_if_key_known(name, self.__required_keys__, self.__optional_keys__)
|
||||
return self.get(name, schemas.unset)
|
||||
ExtraDataDictInput = typing.Mapping[str, schemas.INPUT_TYPES_ALL]
|
||||
|
||||
|
||||
@dataclasses.dataclass(frozen=True)
|
||||
class ExtraData(
|
||||
schemas.Schema[ExtraDataDict, tuple]
|
||||
):
|
||||
"""NOTE: This class is auto generated by OpenAPI JSON Schema Generator.
|
||||
Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator
|
||||
|
||||
Do not edit the class manually.
|
||||
"""
|
||||
types: typing.FrozenSet[typing.Type] = frozenset({schemas.immutabledict})
|
||||
properties: Properties2 = dataclasses.field(default_factory=lambda: schemas.typed_dict_to_instance(Properties2)) # type: ignore
|
||||
type_to_output_cls: typing.Mapping[
|
||||
typing.Type,
|
||||
typing.Type
|
||||
] = dataclasses.field(
|
||||
default_factory=lambda: {
|
||||
schemas.immutabledict: ExtraDataDict
|
||||
}
|
||||
)
|
||||
|
||||
@classmethod
|
||||
def validate(
|
||||
cls,
|
||||
arg: typing.Union[
|
||||
ExtraDataDictInput,
|
||||
ExtraDataDict,
|
||||
],
|
||||
configuration: typing.Optional[schema_configuration.SchemaConfiguration] = None
|
||||
) -> ExtraDataDict:
|
||||
return super().validate_base(
|
||||
arg,
|
||||
configuration=configuration,
|
||||
)
|
||||
|
||||
@@ -0,0 +1,959 @@
|
||||
# coding: utf-8
|
||||
|
||||
"""
|
||||
comfyui
|
||||
No description provided (generated by Openapi JSON Schema Generator https://github.com/openapi-json-schema-tools/openapi-json-schema-generator) # noqa: E501
|
||||
The version of the OpenAPI document: 0.0.1
|
||||
Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator
|
||||
"""
|
||||
|
||||
from __future__ import annotations
|
||||
from comfy.api.shared_imports.schema_imports import * # pyright: ignore [reportWildcardImportFromLibrary]
|
||||
|
||||
_0: typing_extensions.TypeAlias = schemas.StrSchema
|
||||
_1: typing_extensions.TypeAlias = schemas.NumberSchema
|
||||
Default: typing_extensions.TypeAlias = schemas.StrSchema
|
||||
Min: typing_extensions.TypeAlias = schemas.NumberSchema
|
||||
Max: typing_extensions.TypeAlias = schemas.NumberSchema
|
||||
Step: typing_extensions.TypeAlias = schemas.NumberSchema
|
||||
Multiline: typing_extensions.TypeAlias = schemas.BoolSchema
|
||||
Properties = typing.TypedDict(
|
||||
'Properties',
|
||||
{
|
||||
"default": typing.Type[Default],
|
||||
"min": typing.Type[Min],
|
||||
"max": typing.Type[Max],
|
||||
"step": typing.Type[Step],
|
||||
"multiline": typing.Type[Multiline],
|
||||
}
|
||||
)
|
||||
|
||||
|
||||
class _2Dict(schemas.immutabledict[str, schemas.OUTPUT_BASE_TYPES]):
|
||||
|
||||
__required_keys__: typing.FrozenSet[str] = frozenset({
|
||||
})
|
||||
__optional_keys__: typing.FrozenSet[str] = frozenset({
|
||||
"default",
|
||||
"min",
|
||||
"max",
|
||||
"step",
|
||||
"multiline",
|
||||
})
|
||||
|
||||
def __new__(
|
||||
cls,
|
||||
*,
|
||||
default: typing.Union[
|
||||
str,
|
||||
schemas.Unset
|
||||
] = schemas.unset,
|
||||
min: typing.Union[
|
||||
int,
|
||||
float,
|
||||
schemas.Unset
|
||||
] = schemas.unset,
|
||||
max: typing.Union[
|
||||
int,
|
||||
float,
|
||||
schemas.Unset
|
||||
] = schemas.unset,
|
||||
step: typing.Union[
|
||||
int,
|
||||
float,
|
||||
schemas.Unset
|
||||
] = schemas.unset,
|
||||
multiline: typing.Union[
|
||||
bool,
|
||||
schemas.Unset
|
||||
] = schemas.unset,
|
||||
configuration_: typing.Optional[schema_configuration.SchemaConfiguration] = None,
|
||||
**kwargs: schemas.INPUT_TYPES_ALL,
|
||||
):
|
||||
arg_: typing.Dict[str, typing.Any] = {}
|
||||
for key_, val in (
|
||||
("default", default),
|
||||
("min", min),
|
||||
("max", max),
|
||||
("step", step),
|
||||
("multiline", multiline),
|
||||
):
|
||||
if isinstance(val, schemas.Unset):
|
||||
continue
|
||||
arg_[key_] = val
|
||||
arg_.update(kwargs)
|
||||
used_arg_ = typing.cast(_2DictInput, arg_)
|
||||
return _2.validate(used_arg_, configuration=configuration_)
|
||||
|
||||
@staticmethod
|
||||
def from_dict_(
|
||||
arg: typing.Union[
|
||||
_2DictInput,
|
||||
_2Dict
|
||||
],
|
||||
configuration: typing.Optional[schema_configuration.SchemaConfiguration] = None
|
||||
) -> _2Dict:
|
||||
return _2.validate(arg, configuration=configuration)
|
||||
|
||||
@property
|
||||
def default(self) -> typing.Union[str, schemas.Unset]:
|
||||
val = self.get("default", schemas.unset)
|
||||
if isinstance(val, schemas.Unset):
|
||||
return val
|
||||
return typing.cast(
|
||||
str,
|
||||
val
|
||||
)
|
||||
|
||||
@property
|
||||
def min(self) -> typing.Union[int, float, schemas.Unset]:
|
||||
val = self.get("min", schemas.unset)
|
||||
if isinstance(val, schemas.Unset):
|
||||
return val
|
||||
return typing.cast(
|
||||
typing.Union[int, float],
|
||||
val
|
||||
)
|
||||
|
||||
@property
|
||||
def max(self) -> typing.Union[int, float, schemas.Unset]:
|
||||
val = self.get("max", schemas.unset)
|
||||
if isinstance(val, schemas.Unset):
|
||||
return val
|
||||
return typing.cast(
|
||||
typing.Union[int, float],
|
||||
val
|
||||
)
|
||||
|
||||
@property
|
||||
def step(self) -> typing.Union[int, float, schemas.Unset]:
|
||||
val = self.get("step", schemas.unset)
|
||||
if isinstance(val, schemas.Unset):
|
||||
return val
|
||||
return typing.cast(
|
||||
typing.Union[int, float],
|
||||
val
|
||||
)
|
||||
|
||||
@property
|
||||
def multiline(self) -> typing.Union[bool, schemas.Unset]:
|
||||
val = self.get("multiline", schemas.unset)
|
||||
if isinstance(val, schemas.Unset):
|
||||
return val
|
||||
return typing.cast(
|
||||
bool,
|
||||
val
|
||||
)
|
||||
|
||||
def get_additional_property_(self, name: str) -> typing.Union[schemas.OUTPUT_BASE_TYPES, schemas.Unset]:
|
||||
schemas.raise_if_key_known(name, self.__required_keys__, self.__optional_keys__)
|
||||
return self.get(name, schemas.unset)
|
||||
_2DictInput = typing.Mapping[str, schemas.INPUT_TYPES_ALL]
|
||||
|
||||
|
||||
@dataclasses.dataclass(frozen=True)
|
||||
class _2(
|
||||
schemas.Schema[_2Dict, tuple]
|
||||
):
|
||||
types: typing.FrozenSet[typing.Type] = frozenset({schemas.immutabledict})
|
||||
properties: Properties = dataclasses.field(default_factory=lambda: schemas.typed_dict_to_instance(Properties)) # type: ignore
|
||||
type_to_output_cls: typing.Mapping[
|
||||
typing.Type,
|
||||
typing.Type
|
||||
] = dataclasses.field(
|
||||
default_factory=lambda: {
|
||||
schemas.immutabledict: _2Dict
|
||||
}
|
||||
)
|
||||
|
||||
@classmethod
|
||||
def validate(
|
||||
cls,
|
||||
arg: typing.Union[
|
||||
_2DictInput,
|
||||
_2Dict,
|
||||
],
|
||||
configuration: typing.Optional[schema_configuration.SchemaConfiguration] = None
|
||||
) -> _2Dict:
|
||||
return super().validate_base(
|
||||
arg,
|
||||
configuration=configuration,
|
||||
)
|
||||
|
||||
Items2: typing_extensions.TypeAlias = schemas.StrSchema
|
||||
|
||||
|
||||
class _3Tuple(
|
||||
typing.Tuple[
|
||||
str,
|
||||
...
|
||||
]
|
||||
):
|
||||
|
||||
def __new__(cls, arg: typing.Union[_3TupleInput, _3Tuple], configuration: typing.Optional[schema_configuration.SchemaConfiguration] = None):
|
||||
return _3.validate(arg, configuration=configuration)
|
||||
_3TupleInput = typing.Union[
|
||||
typing.List[
|
||||
str,
|
||||
],
|
||||
typing.Tuple[
|
||||
str,
|
||||
...
|
||||
]
|
||||
]
|
||||
|
||||
|
||||
@dataclasses.dataclass(frozen=True)
|
||||
class _3(
|
||||
schemas.Schema[schemas.immutabledict, _3Tuple]
|
||||
):
|
||||
types: typing.FrozenSet[typing.Type] = frozenset({tuple})
|
||||
items: typing.Type[Items2] = dataclasses.field(default_factory=lambda: Items2) # type: ignore
|
||||
type_to_output_cls: typing.Mapping[
|
||||
typing.Type,
|
||||
typing.Type
|
||||
] = dataclasses.field(
|
||||
default_factory=lambda: {
|
||||
tuple: _3Tuple
|
||||
}
|
||||
)
|
||||
|
||||
@classmethod
|
||||
def validate(
|
||||
cls,
|
||||
arg: typing.Union[
|
||||
_3TupleInput,
|
||||
_3Tuple,
|
||||
],
|
||||
configuration: typing.Optional[schema_configuration.SchemaConfiguration] = None
|
||||
) -> _3Tuple:
|
||||
return super().validate_base(
|
||||
arg,
|
||||
configuration=configuration,
|
||||
)
|
||||
OneOf = typing.Tuple[
|
||||
typing.Type[_0],
|
||||
typing.Type[_1],
|
||||
typing.Type[_2],
|
||||
typing.Type[_3],
|
||||
]
|
||||
|
||||
|
||||
@dataclasses.dataclass(frozen=True)
|
||||
class Items(
|
||||
schemas.AnyTypeSchema[schemas.immutabledict[str, schemas.OUTPUT_BASE_TYPES], typing.Tuple[schemas.OUTPUT_BASE_TYPES, ...]],
|
||||
):
|
||||
# any type
|
||||
max_items: int = 2
|
||||
min_items: int = 1
|
||||
one_of: OneOf = dataclasses.field(default_factory=lambda: schemas.tuple_to_instance(OneOf)) # type: ignore
|
||||
|
||||
|
||||
|
||||
class AdditionalPropertiesTuple(
|
||||
typing.Tuple[
|
||||
schemas.OUTPUT_BASE_TYPES,
|
||||
...
|
||||
]
|
||||
):
|
||||
|
||||
def __new__(cls, arg: typing.Union[AdditionalPropertiesTupleInput, AdditionalPropertiesTuple], configuration: typing.Optional[schema_configuration.SchemaConfiguration] = None):
|
||||
return AdditionalProperties.validate(arg, configuration=configuration)
|
||||
AdditionalPropertiesTupleInput = typing.Union[
|
||||
typing.List[
|
||||
typing.Union[
|
||||
schemas.INPUT_TYPES_ALL,
|
||||
schemas.OUTPUT_BASE_TYPES
|
||||
],
|
||||
],
|
||||
typing.Tuple[
|
||||
typing.Union[
|
||||
schemas.INPUT_TYPES_ALL,
|
||||
schemas.OUTPUT_BASE_TYPES
|
||||
],
|
||||
...
|
||||
]
|
||||
]
|
||||
|
||||
|
||||
@dataclasses.dataclass(frozen=True)
|
||||
class AdditionalProperties(
|
||||
schemas.Schema[schemas.immutabledict, AdditionalPropertiesTuple]
|
||||
):
|
||||
types: typing.FrozenSet[typing.Type] = frozenset({tuple})
|
||||
items: typing.Type[Items] = dataclasses.field(default_factory=lambda: Items) # type: ignore
|
||||
type_to_output_cls: typing.Mapping[
|
||||
typing.Type,
|
||||
typing.Type
|
||||
] = dataclasses.field(
|
||||
default_factory=lambda: {
|
||||
tuple: AdditionalPropertiesTuple
|
||||
}
|
||||
)
|
||||
|
||||
@classmethod
|
||||
def validate(
|
||||
cls,
|
||||
arg: typing.Union[
|
||||
AdditionalPropertiesTupleInput,
|
||||
AdditionalPropertiesTuple,
|
||||
],
|
||||
configuration: typing.Optional[schema_configuration.SchemaConfiguration] = None
|
||||
) -> AdditionalPropertiesTuple:
|
||||
return super().validate_base(
|
||||
arg,
|
||||
configuration=configuration,
|
||||
)
|
||||
|
||||
|
||||
class RequiredDict(schemas.immutabledict[str, AdditionalPropertiesTuple]):
|
||||
|
||||
__required_keys__: typing.FrozenSet[str] = frozenset({
|
||||
})
|
||||
__optional_keys__: typing.FrozenSet[str] = frozenset({
|
||||
})
|
||||
def __new__(
|
||||
cls,
|
||||
configuration_: typing.Optional[schema_configuration.SchemaConfiguration] = None,
|
||||
**kwargs: typing.Union[
|
||||
AdditionalPropertiesTupleInput,
|
||||
AdditionalPropertiesTuple
|
||||
],
|
||||
):
|
||||
used_kwargs = typing.cast(RequiredDictInput, kwargs)
|
||||
return Required.validate(used_kwargs, configuration=configuration_)
|
||||
|
||||
@staticmethod
|
||||
def from_dict_(
|
||||
arg: typing.Union[
|
||||
RequiredDictInput,
|
||||
RequiredDict
|
||||
],
|
||||
configuration: typing.Optional[schema_configuration.SchemaConfiguration] = None
|
||||
) -> RequiredDict:
|
||||
return Required.validate(arg, configuration=configuration)
|
||||
|
||||
def get_additional_property_(self, name: str) -> typing.Union[AdditionalPropertiesTuple, schemas.Unset]:
|
||||
schemas.raise_if_key_known(name, self.__required_keys__, self.__optional_keys__)
|
||||
val = self.get(name, schemas.unset)
|
||||
if isinstance(val, schemas.Unset):
|
||||
return val
|
||||
return typing.cast(
|
||||
AdditionalPropertiesTuple,
|
||||
val
|
||||
)
|
||||
RequiredDictInput = typing.Mapping[
|
||||
str,
|
||||
typing.Union[
|
||||
AdditionalPropertiesTupleInput,
|
||||
AdditionalPropertiesTuple
|
||||
],
|
||||
]
|
||||
|
||||
|
||||
@dataclasses.dataclass(frozen=True)
|
||||
class Required(
|
||||
schemas.Schema[RequiredDict, tuple]
|
||||
):
|
||||
types: typing.FrozenSet[typing.Type] = frozenset({schemas.immutabledict})
|
||||
additional_properties: typing.Type[AdditionalProperties] = dataclasses.field(default_factory=lambda: AdditionalProperties) # type: ignore
|
||||
type_to_output_cls: typing.Mapping[
|
||||
typing.Type,
|
||||
typing.Type
|
||||
] = dataclasses.field(
|
||||
default_factory=lambda: {
|
||||
schemas.immutabledict: RequiredDict
|
||||
}
|
||||
)
|
||||
|
||||
@classmethod
|
||||
def validate(
|
||||
cls,
|
||||
arg: typing.Union[
|
||||
RequiredDictInput,
|
||||
RequiredDict,
|
||||
],
|
||||
configuration: typing.Optional[schema_configuration.SchemaConfiguration] = None
|
||||
) -> RequiredDict:
|
||||
return super().validate_base(
|
||||
arg,
|
||||
configuration=configuration,
|
||||
)
|
||||
|
||||
AdditionalProperties2: typing_extensions.TypeAlias = schemas.StrSchema
|
||||
|
||||
|
||||
class HiddenDict(schemas.immutabledict[str, str]):
|
||||
|
||||
__required_keys__: typing.FrozenSet[str] = frozenset({
|
||||
})
|
||||
__optional_keys__: typing.FrozenSet[str] = frozenset({
|
||||
})
|
||||
def __new__(
|
||||
cls,
|
||||
configuration_: typing.Optional[schema_configuration.SchemaConfiguration] = None,
|
||||
**kwargs: str,
|
||||
):
|
||||
used_kwargs = typing.cast(HiddenDictInput, kwargs)
|
||||
return Hidden.validate(used_kwargs, configuration=configuration_)
|
||||
|
||||
@staticmethod
|
||||
def from_dict_(
|
||||
arg: typing.Union[
|
||||
HiddenDictInput,
|
||||
HiddenDict
|
||||
],
|
||||
configuration: typing.Optional[schema_configuration.SchemaConfiguration] = None
|
||||
) -> HiddenDict:
|
||||
return Hidden.validate(arg, configuration=configuration)
|
||||
|
||||
def get_additional_property_(self, name: str) -> typing.Union[str, schemas.Unset]:
|
||||
schemas.raise_if_key_known(name, self.__required_keys__, self.__optional_keys__)
|
||||
val = self.get(name, schemas.unset)
|
||||
if isinstance(val, schemas.Unset):
|
||||
return val
|
||||
return typing.cast(
|
||||
str,
|
||||
val
|
||||
)
|
||||
HiddenDictInput = typing.Mapping[
|
||||
str,
|
||||
str,
|
||||
]
|
||||
|
||||
|
||||
@dataclasses.dataclass(frozen=True)
|
||||
class Hidden(
|
||||
schemas.Schema[HiddenDict, tuple]
|
||||
):
|
||||
types: typing.FrozenSet[typing.Type] = frozenset({schemas.immutabledict})
|
||||
additional_properties: typing.Type[AdditionalProperties2] = dataclasses.field(default_factory=lambda: AdditionalProperties2) # type: ignore
|
||||
type_to_output_cls: typing.Mapping[
|
||||
typing.Type,
|
||||
typing.Type
|
||||
] = dataclasses.field(
|
||||
default_factory=lambda: {
|
||||
schemas.immutabledict: HiddenDict
|
||||
}
|
||||
)
|
||||
|
||||
@classmethod
|
||||
def validate(
|
||||
cls,
|
||||
arg: typing.Union[
|
||||
HiddenDictInput,
|
||||
HiddenDict,
|
||||
],
|
||||
configuration: typing.Optional[schema_configuration.SchemaConfiguration] = None
|
||||
) -> HiddenDict:
|
||||
return super().validate_base(
|
||||
arg,
|
||||
configuration=configuration,
|
||||
)
|
||||
|
||||
Properties2 = typing.TypedDict(
|
||||
'Properties2',
|
||||
{
|
||||
"required": typing.Type[Required],
|
||||
"hidden": typing.Type[Hidden],
|
||||
}
|
||||
)
|
||||
|
||||
|
||||
class InputDict(schemas.immutabledict[str, schemas.OUTPUT_BASE_TYPES]):
|
||||
|
||||
__required_keys__: typing.FrozenSet[str] = frozenset({
|
||||
"required",
|
||||
})
|
||||
__optional_keys__: typing.FrozenSet[str] = frozenset({
|
||||
"hidden",
|
||||
})
|
||||
|
||||
def __new__(
|
||||
cls,
|
||||
*,
|
||||
required: typing.Union[
|
||||
RequiredDictInput,
|
||||
RequiredDict,
|
||||
],
|
||||
hidden: typing.Union[
|
||||
HiddenDictInput,
|
||||
HiddenDict,
|
||||
schemas.Unset
|
||||
] = schemas.unset,
|
||||
configuration_: typing.Optional[schema_configuration.SchemaConfiguration] = None,
|
||||
**kwargs: schemas.INPUT_TYPES_ALL,
|
||||
):
|
||||
arg_: typing.Dict[str, typing.Any] = {
|
||||
"required": required,
|
||||
}
|
||||
for key_, val in (
|
||||
("hidden", hidden),
|
||||
):
|
||||
if isinstance(val, schemas.Unset):
|
||||
continue
|
||||
arg_[key_] = val
|
||||
arg_.update(kwargs)
|
||||
used_arg_ = typing.cast(InputDictInput, arg_)
|
||||
return Input.validate(used_arg_, configuration=configuration_)
|
||||
|
||||
@staticmethod
|
||||
def from_dict_(
|
||||
arg: typing.Union[
|
||||
InputDictInput,
|
||||
InputDict
|
||||
],
|
||||
configuration: typing.Optional[schema_configuration.SchemaConfiguration] = None
|
||||
) -> InputDict:
|
||||
return Input.validate(arg, configuration=configuration)
|
||||
|
||||
@property
|
||||
def required(self) -> RequiredDict:
|
||||
return typing.cast(
|
||||
RequiredDict,
|
||||
self.__getitem__("required")
|
||||
)
|
||||
|
||||
@property
|
||||
def hidden(self) -> typing.Union[HiddenDict, schemas.Unset]:
|
||||
val = self.get("hidden", schemas.unset)
|
||||
if isinstance(val, schemas.Unset):
|
||||
return val
|
||||
return typing.cast(
|
||||
HiddenDict,
|
||||
val
|
||||
)
|
||||
|
||||
def get_additional_property_(self, name: str) -> typing.Union[schemas.OUTPUT_BASE_TYPES, schemas.Unset]:
|
||||
schemas.raise_if_key_known(name, self.__required_keys__, self.__optional_keys__)
|
||||
return self.get(name, schemas.unset)
|
||||
InputDictInput = typing.Mapping[str, schemas.INPUT_TYPES_ALL]
|
||||
|
||||
|
||||
@dataclasses.dataclass(frozen=True)
|
||||
class Input(
|
||||
schemas.Schema[InputDict, tuple]
|
||||
):
|
||||
types: typing.FrozenSet[typing.Type] = frozenset({schemas.immutabledict})
|
||||
required: typing.FrozenSet[str] = frozenset({
|
||||
"required",
|
||||
})
|
||||
properties: Properties2 = dataclasses.field(default_factory=lambda: schemas.typed_dict_to_instance(Properties2)) # type: ignore
|
||||
type_to_output_cls: typing.Mapping[
|
||||
typing.Type,
|
||||
typing.Type
|
||||
] = dataclasses.field(
|
||||
default_factory=lambda: {
|
||||
schemas.immutabledict: InputDict
|
||||
}
|
||||
)
|
||||
|
||||
@classmethod
|
||||
def validate(
|
||||
cls,
|
||||
arg: typing.Union[
|
||||
InputDictInput,
|
||||
InputDict,
|
||||
],
|
||||
configuration: typing.Optional[schema_configuration.SchemaConfiguration] = None
|
||||
) -> InputDict:
|
||||
return super().validate_base(
|
||||
arg,
|
||||
configuration=configuration,
|
||||
)
|
||||
|
||||
Items3: typing_extensions.TypeAlias = schemas.StrSchema
|
||||
|
||||
|
||||
class OutputTuple(
|
||||
typing.Tuple[
|
||||
str,
|
||||
...
|
||||
]
|
||||
):
|
||||
|
||||
def __new__(cls, arg: typing.Union[OutputTupleInput, OutputTuple], configuration: typing.Optional[schema_configuration.SchemaConfiguration] = None):
|
||||
return Output.validate(arg, configuration=configuration)
|
||||
OutputTupleInput = typing.Union[
|
||||
typing.List[
|
||||
str,
|
||||
],
|
||||
typing.Tuple[
|
||||
str,
|
||||
...
|
||||
]
|
||||
]
|
||||
|
||||
|
||||
@dataclasses.dataclass(frozen=True)
|
||||
class Output(
|
||||
schemas.Schema[schemas.immutabledict, OutputTuple]
|
||||
):
|
||||
types: typing.FrozenSet[typing.Type] = frozenset({tuple})
|
||||
items: typing.Type[Items3] = dataclasses.field(default_factory=lambda: Items3) # type: ignore
|
||||
type_to_output_cls: typing.Mapping[
|
||||
typing.Type,
|
||||
typing.Type
|
||||
] = dataclasses.field(
|
||||
default_factory=lambda: {
|
||||
tuple: OutputTuple
|
||||
}
|
||||
)
|
||||
|
||||
@classmethod
|
||||
def validate(
|
||||
cls,
|
||||
arg: typing.Union[
|
||||
OutputTupleInput,
|
||||
OutputTuple,
|
||||
],
|
||||
configuration: typing.Optional[schema_configuration.SchemaConfiguration] = None
|
||||
) -> OutputTuple:
|
||||
return super().validate_base(
|
||||
arg,
|
||||
configuration=configuration,
|
||||
)
|
||||
Items4: typing_extensions.TypeAlias = schemas.BoolSchema
|
||||
|
||||
|
||||
class OutputIsListTuple(
|
||||
typing.Tuple[
|
||||
bool,
|
||||
...
|
||||
]
|
||||
):
|
||||
|
||||
def __new__(cls, arg: typing.Union[OutputIsListTupleInput, OutputIsListTuple], configuration: typing.Optional[schema_configuration.SchemaConfiguration] = None):
|
||||
return OutputIsList.validate(arg, configuration=configuration)
|
||||
OutputIsListTupleInput = typing.Union[
|
||||
typing.List[
|
||||
bool,
|
||||
],
|
||||
typing.Tuple[
|
||||
bool,
|
||||
...
|
||||
]
|
||||
]
|
||||
|
||||
|
||||
@dataclasses.dataclass(frozen=True)
|
||||
class OutputIsList(
|
||||
schemas.Schema[schemas.immutabledict, OutputIsListTuple]
|
||||
):
|
||||
types: typing.FrozenSet[typing.Type] = frozenset({tuple})
|
||||
items: typing.Type[Items4] = dataclasses.field(default_factory=lambda: Items4) # type: ignore
|
||||
type_to_output_cls: typing.Mapping[
|
||||
typing.Type,
|
||||
typing.Type
|
||||
] = dataclasses.field(
|
||||
default_factory=lambda: {
|
||||
tuple: OutputIsListTuple
|
||||
}
|
||||
)
|
||||
|
||||
@classmethod
|
||||
def validate(
|
||||
cls,
|
||||
arg: typing.Union[
|
||||
OutputIsListTupleInput,
|
||||
OutputIsListTuple,
|
||||
],
|
||||
configuration: typing.Optional[schema_configuration.SchemaConfiguration] = None
|
||||
) -> OutputIsListTuple:
|
||||
return super().validate_base(
|
||||
arg,
|
||||
configuration=configuration,
|
||||
)
|
||||
Items5: typing_extensions.TypeAlias = schemas.StrSchema
|
||||
|
||||
|
||||
class OutputNameTuple(
|
||||
typing.Tuple[
|
||||
str,
|
||||
...
|
||||
]
|
||||
):
|
||||
|
||||
def __new__(cls, arg: typing.Union[OutputNameTupleInput, OutputNameTuple], configuration: typing.Optional[schema_configuration.SchemaConfiguration] = None):
|
||||
return OutputName.validate(arg, configuration=configuration)
|
||||
OutputNameTupleInput = typing.Union[
|
||||
typing.List[
|
||||
str,
|
||||
],
|
||||
typing.Tuple[
|
||||
str,
|
||||
...
|
||||
]
|
||||
]
|
||||
|
||||
|
||||
@dataclasses.dataclass(frozen=True)
|
||||
class OutputName(
|
||||
schemas.Schema[schemas.immutabledict, OutputNameTuple]
|
||||
):
|
||||
types: typing.FrozenSet[typing.Type] = frozenset({tuple})
|
||||
items: typing.Type[Items5] = dataclasses.field(default_factory=lambda: Items5) # type: ignore
|
||||
type_to_output_cls: typing.Mapping[
|
||||
typing.Type,
|
||||
typing.Type
|
||||
] = dataclasses.field(
|
||||
default_factory=lambda: {
|
||||
tuple: OutputNameTuple
|
||||
}
|
||||
)
|
||||
|
||||
@classmethod
|
||||
def validate(
|
||||
cls,
|
||||
arg: typing.Union[
|
||||
OutputNameTupleInput,
|
||||
OutputNameTuple,
|
||||
],
|
||||
configuration: typing.Optional[schema_configuration.SchemaConfiguration] = None
|
||||
) -> OutputNameTuple:
|
||||
return super().validate_base(
|
||||
arg,
|
||||
configuration=configuration,
|
||||
)
|
||||
Name: typing_extensions.TypeAlias = schemas.StrSchema
|
||||
DisplayName: typing_extensions.TypeAlias = schemas.StrSchema
|
||||
Description: typing_extensions.TypeAlias = schemas.StrSchema
|
||||
Category: typing_extensions.TypeAlias = schemas.StrSchema
|
||||
OutputNode: typing_extensions.TypeAlias = schemas.BoolSchema
|
||||
Properties3 = typing.TypedDict(
|
||||
'Properties3',
|
||||
{
|
||||
"input": typing.Type[Input],
|
||||
"output": typing.Type[Output],
|
||||
"output_is_list": typing.Type[OutputIsList],
|
||||
"output_name": typing.Type[OutputName],
|
||||
"name": typing.Type[Name],
|
||||
"display_name": typing.Type[DisplayName],
|
||||
"description": typing.Type[Description],
|
||||
"category": typing.Type[Category],
|
||||
"output_node": typing.Type[OutputNode],
|
||||
}
|
||||
)
|
||||
|
||||
|
||||
class NodeDict(schemas.immutabledict[str, schemas.OUTPUT_BASE_TYPES]):
|
||||
|
||||
__required_keys__: typing.FrozenSet[str] = frozenset({
|
||||
})
|
||||
__optional_keys__: typing.FrozenSet[str] = frozenset({
|
||||
"input",
|
||||
"output",
|
||||
"output_is_list",
|
||||
"output_name",
|
||||
"name",
|
||||
"display_name",
|
||||
"description",
|
||||
"category",
|
||||
"output_node",
|
||||
})
|
||||
|
||||
def __new__(
|
||||
cls,
|
||||
*,
|
||||
input: typing.Union[
|
||||
InputDictInput,
|
||||
InputDict,
|
||||
schemas.Unset
|
||||
] = schemas.unset,
|
||||
output: typing.Union[
|
||||
OutputTupleInput,
|
||||
OutputTuple,
|
||||
schemas.Unset
|
||||
] = schemas.unset,
|
||||
output_is_list: typing.Union[
|
||||
OutputIsListTupleInput,
|
||||
OutputIsListTuple,
|
||||
schemas.Unset
|
||||
] = schemas.unset,
|
||||
output_name: typing.Union[
|
||||
OutputNameTupleInput,
|
||||
OutputNameTuple,
|
||||
schemas.Unset
|
||||
] = schemas.unset,
|
||||
name: typing.Union[
|
||||
str,
|
||||
schemas.Unset
|
||||
] = schemas.unset,
|
||||
display_name: typing.Union[
|
||||
str,
|
||||
schemas.Unset
|
||||
] = schemas.unset,
|
||||
description: typing.Union[
|
||||
str,
|
||||
schemas.Unset
|
||||
] = schemas.unset,
|
||||
category: typing.Union[
|
||||
str,
|
||||
schemas.Unset
|
||||
] = schemas.unset,
|
||||
output_node: typing.Union[
|
||||
bool,
|
||||
schemas.Unset
|
||||
] = schemas.unset,
|
||||
configuration_: typing.Optional[schema_configuration.SchemaConfiguration] = None,
|
||||
**kwargs: schemas.INPUT_TYPES_ALL,
|
||||
):
|
||||
arg_: typing.Dict[str, typing.Any] = {}
|
||||
for key_, val in (
|
||||
("input", input),
|
||||
("output", output),
|
||||
("output_is_list", output_is_list),
|
||||
("output_name", output_name),
|
||||
("name", name),
|
||||
("display_name", display_name),
|
||||
("description", description),
|
||||
("category", category),
|
||||
("output_node", output_node),
|
||||
):
|
||||
if isinstance(val, schemas.Unset):
|
||||
continue
|
||||
arg_[key_] = val
|
||||
arg_.update(kwargs)
|
||||
used_arg_ = typing.cast(NodeDictInput, arg_)
|
||||
return Node.validate(used_arg_, configuration=configuration_)
|
||||
|
||||
@staticmethod
|
||||
def from_dict_(
|
||||
arg: typing.Union[
|
||||
NodeDictInput,
|
||||
NodeDict
|
||||
],
|
||||
configuration: typing.Optional[schema_configuration.SchemaConfiguration] = None
|
||||
) -> NodeDict:
|
||||
return Node.validate(arg, configuration=configuration)
|
||||
|
||||
@property
|
||||
def input(self) -> typing.Union[InputDict, schemas.Unset]:
|
||||
val = self.get("input", schemas.unset)
|
||||
if isinstance(val, schemas.Unset):
|
||||
return val
|
||||
return typing.cast(
|
||||
InputDict,
|
||||
val
|
||||
)
|
||||
|
||||
@property
|
||||
def output(self) -> typing.Union[OutputTuple, schemas.Unset]:
|
||||
val = self.get("output", schemas.unset)
|
||||
if isinstance(val, schemas.Unset):
|
||||
return val
|
||||
return typing.cast(
|
||||
OutputTuple,
|
||||
val
|
||||
)
|
||||
|
||||
@property
|
||||
def output_is_list(self) -> typing.Union[OutputIsListTuple, schemas.Unset]:
|
||||
val = self.get("output_is_list", schemas.unset)
|
||||
if isinstance(val, schemas.Unset):
|
||||
return val
|
||||
return typing.cast(
|
||||
OutputIsListTuple,
|
||||
val
|
||||
)
|
||||
|
||||
@property
|
||||
def output_name(self) -> typing.Union[OutputNameTuple, schemas.Unset]:
|
||||
val = self.get("output_name", schemas.unset)
|
||||
if isinstance(val, schemas.Unset):
|
||||
return val
|
||||
return typing.cast(
|
||||
OutputNameTuple,
|
||||
val
|
||||
)
|
||||
|
||||
@property
|
||||
def name(self) -> typing.Union[str, schemas.Unset]:
|
||||
val = self.get("name", schemas.unset)
|
||||
if isinstance(val, schemas.Unset):
|
||||
return val
|
||||
return typing.cast(
|
||||
str,
|
||||
val
|
||||
)
|
||||
|
||||
@property
|
||||
def display_name(self) -> typing.Union[str, schemas.Unset]:
|
||||
val = self.get("display_name", schemas.unset)
|
||||
if isinstance(val, schemas.Unset):
|
||||
return val
|
||||
return typing.cast(
|
||||
str,
|
||||
val
|
||||
)
|
||||
|
||||
@property
|
||||
def description(self) -> typing.Union[str, schemas.Unset]:
|
||||
val = self.get("description", schemas.unset)
|
||||
if isinstance(val, schemas.Unset):
|
||||
return val
|
||||
return typing.cast(
|
||||
str,
|
||||
val
|
||||
)
|
||||
|
||||
@property
|
||||
def category(self) -> typing.Union[str, schemas.Unset]:
|
||||
val = self.get("category", schemas.unset)
|
||||
if isinstance(val, schemas.Unset):
|
||||
return val
|
||||
return typing.cast(
|
||||
str,
|
||||
val
|
||||
)
|
||||
|
||||
@property
|
||||
def output_node(self) -> typing.Union[bool, schemas.Unset]:
|
||||
val = self.get("output_node", schemas.unset)
|
||||
if isinstance(val, schemas.Unset):
|
||||
return val
|
||||
return typing.cast(
|
||||
bool,
|
||||
val
|
||||
)
|
||||
|
||||
def get_additional_property_(self, name: str) -> typing.Union[schemas.OUTPUT_BASE_TYPES, schemas.Unset]:
|
||||
schemas.raise_if_key_known(name, self.__required_keys__, self.__optional_keys__)
|
||||
return self.get(name, schemas.unset)
|
||||
NodeDictInput = typing.Mapping[str, schemas.INPUT_TYPES_ALL]
|
||||
|
||||
|
||||
@dataclasses.dataclass(frozen=True)
|
||||
class Node(
|
||||
schemas.Schema[NodeDict, tuple]
|
||||
):
|
||||
"""NOTE: This class is auto generated by OpenAPI JSON Schema Generator.
|
||||
Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator
|
||||
|
||||
Do not edit the class manually.
|
||||
"""
|
||||
types: typing.FrozenSet[typing.Type] = frozenset({schemas.immutabledict})
|
||||
properties: Properties3 = dataclasses.field(default_factory=lambda: schemas.typed_dict_to_instance(Properties3)) # type: ignore
|
||||
type_to_output_cls: typing.Mapping[
|
||||
typing.Type,
|
||||
typing.Type
|
||||
] = dataclasses.field(
|
||||
default_factory=lambda: {
|
||||
schemas.immutabledict: NodeDict
|
||||
}
|
||||
)
|
||||
|
||||
@classmethod
|
||||
def validate(
|
||||
cls,
|
||||
arg: typing.Union[
|
||||
NodeDictInput,
|
||||
NodeDict,
|
||||
],
|
||||
configuration: typing.Optional[schema_configuration.SchemaConfiguration] = None
|
||||
) -> NodeDict:
|
||||
return super().validate_base(
|
||||
arg,
|
||||
configuration=configuration,
|
||||
)
|
||||
|
||||
@@ -0,0 +1,100 @@
|
||||
# coding: utf-8
|
||||
|
||||
"""
|
||||
comfyui
|
||||
No description provided (generated by Openapi JSON Schema Generator https://github.com/openapi-json-schema-tools/openapi-json-schema-generator) # noqa: E501
|
||||
The version of the OpenAPI document: 0.0.1
|
||||
Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator
|
||||
"""
|
||||
|
||||
from __future__ import annotations
|
||||
from comfy.api.shared_imports.schema_imports import * # pyright: ignore [reportWildcardImportFromLibrary]
|
||||
|
||||
|
||||
from comfy.api.components.schema import prompt_node
|
||||
|
||||
|
||||
class PromptDict(schemas.immutabledict[str, prompt_node.PromptNodeDict]):
|
||||
|
||||
__required_keys__: typing.FrozenSet[str] = frozenset({
|
||||
})
|
||||
__optional_keys__: typing.FrozenSet[str] = frozenset({
|
||||
})
|
||||
def __new__(
|
||||
cls,
|
||||
configuration_: typing.Optional[schema_configuration.SchemaConfiguration] = None,
|
||||
**kwargs: typing.Union[
|
||||
prompt_node.PromptNodeDictInput,
|
||||
prompt_node.PromptNodeDict,
|
||||
],
|
||||
):
|
||||
used_kwargs = typing.cast(PromptDictInput, kwargs)
|
||||
return Prompt.validate(used_kwargs, configuration=configuration_)
|
||||
|
||||
@staticmethod
|
||||
def from_dict_(
|
||||
arg: typing.Union[
|
||||
PromptDictInput,
|
||||
PromptDict
|
||||
],
|
||||
configuration: typing.Optional[schema_configuration.SchemaConfiguration] = None
|
||||
) -> PromptDict:
|
||||
return Prompt.validate(arg, configuration=configuration)
|
||||
|
||||
def get_additional_property_(self, name: str) -> typing.Union[prompt_node.PromptNodeDict, schemas.Unset]:
|
||||
schemas.raise_if_key_known(name, self.__required_keys__, self.__optional_keys__)
|
||||
val = self.get(name, schemas.unset)
|
||||
if isinstance(val, schemas.Unset):
|
||||
return val
|
||||
return typing.cast(
|
||||
prompt_node.PromptNodeDict,
|
||||
val
|
||||
)
|
||||
PromptDictInput = typing.Mapping[
|
||||
str,
|
||||
typing.Union[
|
||||
prompt_node.PromptNodeDictInput,
|
||||
prompt_node.PromptNodeDict,
|
||||
],
|
||||
]
|
||||
|
||||
|
||||
@dataclasses.dataclass(frozen=True)
|
||||
class Prompt(
|
||||
schemas.Schema[PromptDict, tuple]
|
||||
):
|
||||
"""NOTE: This class is auto generated by OpenAPI JSON Schema Generator.
|
||||
Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator
|
||||
|
||||
Do not edit the class manually.
|
||||
|
||||
The keys are stringified integers corresponding to nodes.
|
||||
|
||||
You can retrieve the last prompt run using GET /api/v1/prompts
|
||||
|
||||
"""
|
||||
types: typing.FrozenSet[typing.Type] = frozenset({schemas.immutabledict})
|
||||
additional_properties: typing.Type[prompt_node.PromptNode] = dataclasses.field(default_factory=lambda: prompt_node.PromptNode) # type: ignore
|
||||
type_to_output_cls: typing.Mapping[
|
||||
typing.Type,
|
||||
typing.Type
|
||||
] = dataclasses.field(
|
||||
default_factory=lambda: {
|
||||
schemas.immutabledict: PromptDict
|
||||
}
|
||||
)
|
||||
|
||||
@classmethod
|
||||
def validate(
|
||||
cls,
|
||||
arg: typing.Union[
|
||||
PromptDictInput,
|
||||
PromptDict,
|
||||
],
|
||||
configuration: typing.Optional[schema_configuration.SchemaConfiguration] = None
|
||||
) -> PromptDict:
|
||||
return super().validate_base(
|
||||
arg,
|
||||
configuration=configuration,
|
||||
)
|
||||
|
||||
@@ -0,0 +1,405 @@
|
||||
# coding: utf-8
|
||||
|
||||
"""
|
||||
comfyui
|
||||
No description provided (generated by Openapi JSON Schema Generator https://github.com/openapi-json-schema-tools/openapi-json-schema-generator) # noqa: E501
|
||||
The version of the OpenAPI document: 0.0.1
|
||||
Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator
|
||||
"""
|
||||
|
||||
from __future__ import annotations
|
||||
from comfy.api.shared_imports.schema_imports import * # pyright: ignore [reportWildcardImportFromLibrary]
|
||||
|
||||
ClassType: typing_extensions.TypeAlias = schemas.StrSchema
|
||||
_0: typing_extensions.TypeAlias = schemas.NumberSchema
|
||||
_1: typing_extensions.TypeAlias = schemas.StrSchema
|
||||
_2: typing_extensions.TypeAlias = schemas.BoolSchema
|
||||
|
||||
|
||||
class ItemsTuple(
|
||||
typing.Tuple[
|
||||
str,
|
||||
int,
|
||||
typing_extensions.Unpack[typing.Tuple[schemas.OUTPUT_BASE_TYPES, ...]]
|
||||
]
|
||||
):
|
||||
|
||||
def __new__(cls, arg: typing.Union[ItemsTupleInput, ItemsTuple], configuration: typing.Optional[schema_configuration.SchemaConfiguration] = None):
|
||||
return Items.validate(arg, configuration=configuration)
|
||||
ItemsTupleInput = typing.Union[
|
||||
typing.List[
|
||||
typing.Union[
|
||||
schemas.INPUT_TYPES_ALL,
|
||||
schemas.OUTPUT_BASE_TYPES
|
||||
],
|
||||
],
|
||||
typing.Tuple[
|
||||
str,
|
||||
int,
|
||||
typing_extensions.Unpack[typing.Tuple[schemas.INPUT_TYPES_ALL, ...]]
|
||||
]
|
||||
]
|
||||
_02: typing_extensions.TypeAlias = schemas.StrSchema
|
||||
_12: typing_extensions.TypeAlias = schemas.IntSchema
|
||||
|
||||
|
||||
@dataclasses.dataclass(frozen=True)
|
||||
class Items(
|
||||
schemas.AnyTypeSchema[schemas.immutabledict[str, schemas.OUTPUT_BASE_TYPES], ItemsTuple],
|
||||
):
|
||||
# any type
|
||||
prefix_items: typing.Tuple[
|
||||
typing.Type[_02],
|
||||
typing.Type[_12],
|
||||
] = (
|
||||
_02,
|
||||
_12,
|
||||
)
|
||||
max_items: int = 2
|
||||
min_items: int = 2
|
||||
type_to_output_cls: typing.Mapping[
|
||||
typing.Type,
|
||||
typing.Type
|
||||
] = dataclasses.field(
|
||||
default_factory=lambda: {
|
||||
tuple: ItemsTuple,
|
||||
}
|
||||
)
|
||||
|
||||
|
||||
|
||||
class _3Tuple(
|
||||
typing.Tuple[
|
||||
schemas.OUTPUT_BASE_TYPES,
|
||||
...
|
||||
]
|
||||
):
|
||||
|
||||
def __new__(cls, arg: typing.Union[_3TupleInput, _3Tuple], configuration: typing.Optional[schema_configuration.SchemaConfiguration] = None):
|
||||
return _3.validate(arg, configuration=configuration)
|
||||
_3TupleInput = typing.Union[
|
||||
typing.List[
|
||||
typing.Union[
|
||||
schemas.INPUT_TYPES_ALL,
|
||||
schemas.OUTPUT_BASE_TYPES
|
||||
],
|
||||
],
|
||||
typing.Tuple[
|
||||
typing.Union[
|
||||
schemas.INPUT_TYPES_ALL,
|
||||
schemas.OUTPUT_BASE_TYPES
|
||||
],
|
||||
...
|
||||
]
|
||||
]
|
||||
|
||||
|
||||
@dataclasses.dataclass(frozen=True)
|
||||
class _3(
|
||||
schemas.Schema[schemas.immutabledict, _3Tuple]
|
||||
):
|
||||
types: typing.FrozenSet[typing.Type] = frozenset({tuple})
|
||||
items: typing.Type[Items] = dataclasses.field(default_factory=lambda: Items) # type: ignore
|
||||
type_to_output_cls: typing.Mapping[
|
||||
typing.Type,
|
||||
typing.Type
|
||||
] = dataclasses.field(
|
||||
default_factory=lambda: {
|
||||
tuple: _3Tuple
|
||||
}
|
||||
)
|
||||
|
||||
@classmethod
|
||||
def validate(
|
||||
cls,
|
||||
arg: typing.Union[
|
||||
_3TupleInput,
|
||||
_3Tuple,
|
||||
],
|
||||
configuration: typing.Optional[schema_configuration.SchemaConfiguration] = None
|
||||
) -> _3Tuple:
|
||||
return super().validate_base(
|
||||
arg,
|
||||
configuration=configuration,
|
||||
)
|
||||
OneOf = typing.Tuple[
|
||||
typing.Type[_0],
|
||||
typing.Type[_1],
|
||||
typing.Type[_2],
|
||||
typing.Type[_3],
|
||||
]
|
||||
|
||||
|
||||
@dataclasses.dataclass(frozen=True)
|
||||
class AdditionalProperties(
|
||||
schemas.AnyTypeSchema[schemas.immutabledict[str, schemas.OUTPUT_BASE_TYPES], typing.Tuple[schemas.OUTPUT_BASE_TYPES, ...]],
|
||||
):
|
||||
# any type
|
||||
one_of: OneOf = dataclasses.field(default_factory=lambda: schemas.tuple_to_instance(OneOf)) # type: ignore
|
||||
|
||||
|
||||
|
||||
class InputsDict(schemas.immutabledict[str, schemas.OUTPUT_BASE_TYPES]):
|
||||
|
||||
__required_keys__: typing.FrozenSet[str] = frozenset({
|
||||
})
|
||||
__optional_keys__: typing.FrozenSet[str] = frozenset({
|
||||
})
|
||||
def __new__(
|
||||
cls,
|
||||
configuration_: typing.Optional[schema_configuration.SchemaConfiguration] = None,
|
||||
**kwargs: typing.Union[
|
||||
schemas.INPUT_TYPES_ALL,
|
||||
schemas.OUTPUT_BASE_TYPES
|
||||
],
|
||||
):
|
||||
used_kwargs = typing.cast(InputsDictInput, kwargs)
|
||||
return Inputs.validate(used_kwargs, configuration=configuration_)
|
||||
|
||||
@staticmethod
|
||||
def from_dict_(
|
||||
arg: typing.Union[
|
||||
InputsDictInput,
|
||||
InputsDict
|
||||
],
|
||||
configuration: typing.Optional[schema_configuration.SchemaConfiguration] = None
|
||||
) -> InputsDict:
|
||||
return Inputs.validate(arg, configuration=configuration)
|
||||
|
||||
def get_additional_property_(self, name: str) -> typing.Union[schemas.OUTPUT_BASE_TYPES, schemas.Unset]:
|
||||
schemas.raise_if_key_known(name, self.__required_keys__, self.__optional_keys__)
|
||||
val = self.get(name, schemas.unset)
|
||||
if isinstance(val, schemas.Unset):
|
||||
return val
|
||||
return typing.cast(
|
||||
schemas.OUTPUT_BASE_TYPES,
|
||||
val
|
||||
)
|
||||
InputsDictInput = typing.Mapping[
|
||||
str,
|
||||
typing.Union[
|
||||
schemas.INPUT_TYPES_ALL,
|
||||
schemas.OUTPUT_BASE_TYPES
|
||||
],
|
||||
]
|
||||
|
||||
|
||||
@dataclasses.dataclass(frozen=True)
|
||||
class Inputs(
|
||||
schemas.Schema[InputsDict, tuple]
|
||||
):
|
||||
types: typing.FrozenSet[typing.Type] = frozenset({schemas.immutabledict})
|
||||
additional_properties: typing.Type[AdditionalProperties] = dataclasses.field(default_factory=lambda: AdditionalProperties) # type: ignore
|
||||
type_to_output_cls: typing.Mapping[
|
||||
typing.Type,
|
||||
typing.Type
|
||||
] = dataclasses.field(
|
||||
default_factory=lambda: {
|
||||
schemas.immutabledict: InputsDict
|
||||
}
|
||||
)
|
||||
|
||||
@classmethod
|
||||
def validate(
|
||||
cls,
|
||||
arg: typing.Union[
|
||||
InputsDictInput,
|
||||
InputsDict,
|
||||
],
|
||||
configuration: typing.Optional[schema_configuration.SchemaConfiguration] = None
|
||||
) -> InputsDict:
|
||||
return super().validate_base(
|
||||
arg,
|
||||
configuration=configuration,
|
||||
)
|
||||
|
||||
Items2: typing_extensions.TypeAlias = schemas.StrSchema
|
||||
|
||||
|
||||
class _0Tuple(
|
||||
typing.Tuple[
|
||||
str,
|
||||
...
|
||||
]
|
||||
):
|
||||
|
||||
def __new__(cls, arg: typing.Union[_0TupleInput, _0Tuple], configuration: typing.Optional[schema_configuration.SchemaConfiguration] = None):
|
||||
return _03.validate(arg, configuration=configuration)
|
||||
_0TupleInput = typing.Union[
|
||||
typing.List[
|
||||
str,
|
||||
],
|
||||
typing.Tuple[
|
||||
str,
|
||||
...
|
||||
]
|
||||
]
|
||||
|
||||
|
||||
@dataclasses.dataclass(frozen=True)
|
||||
class _03(
|
||||
schemas.Schema[schemas.immutabledict, _0Tuple]
|
||||
):
|
||||
types: typing.FrozenSet[typing.Type] = frozenset({tuple})
|
||||
items: typing.Type[Items2] = dataclasses.field(default_factory=lambda: Items2) # type: ignore
|
||||
type_to_output_cls: typing.Mapping[
|
||||
typing.Type,
|
||||
typing.Type
|
||||
] = dataclasses.field(
|
||||
default_factory=lambda: {
|
||||
tuple: _0Tuple
|
||||
}
|
||||
)
|
||||
|
||||
@classmethod
|
||||
def validate(
|
||||
cls,
|
||||
arg: typing.Union[
|
||||
_0TupleInput,
|
||||
_0Tuple,
|
||||
],
|
||||
configuration: typing.Optional[schema_configuration.SchemaConfiguration] = None
|
||||
) -> _0Tuple:
|
||||
return super().validate_base(
|
||||
arg,
|
||||
configuration=configuration,
|
||||
)
|
||||
_13: typing_extensions.TypeAlias = schemas.StrSchema
|
||||
OneOf2 = typing.Tuple[
|
||||
typing.Type[_03],
|
||||
typing.Type[_13],
|
||||
]
|
||||
|
||||
|
||||
@dataclasses.dataclass(frozen=True)
|
||||
class IsChanged(
|
||||
schemas.AnyTypeSchema[schemas.immutabledict[str, schemas.OUTPUT_BASE_TYPES], typing.Tuple[schemas.OUTPUT_BASE_TYPES, ...]],
|
||||
):
|
||||
# any type
|
||||
one_of: OneOf2 = dataclasses.field(default_factory=lambda: schemas.tuple_to_instance(OneOf2)) # type: ignore
|
||||
|
||||
Properties = typing.TypedDict(
|
||||
'Properties',
|
||||
{
|
||||
"class_type": typing.Type[ClassType],
|
||||
"inputs": typing.Type[Inputs],
|
||||
"is_changed": typing.Type[IsChanged],
|
||||
}
|
||||
)
|
||||
|
||||
|
||||
class PromptNodeDict(schemas.immutabledict[str, schemas.OUTPUT_BASE_TYPES]):
|
||||
|
||||
__required_keys__: typing.FrozenSet[str] = frozenset({
|
||||
"class_type",
|
||||
"inputs",
|
||||
})
|
||||
__optional_keys__: typing.FrozenSet[str] = frozenset({
|
||||
"is_changed",
|
||||
})
|
||||
|
||||
def __new__(
|
||||
cls,
|
||||
*,
|
||||
class_type: str,
|
||||
inputs: typing.Union[
|
||||
InputsDictInput,
|
||||
InputsDict,
|
||||
],
|
||||
is_changed: typing.Union[
|
||||
schemas.INPUT_TYPES_ALL,
|
||||
schemas.OUTPUT_BASE_TYPES,
|
||||
schemas.Unset
|
||||
] = schemas.unset,
|
||||
configuration_: typing.Optional[schema_configuration.SchemaConfiguration] = None,
|
||||
**kwargs: schemas.INPUT_TYPES_ALL,
|
||||
):
|
||||
arg_: typing.Dict[str, typing.Any] = {
|
||||
"class_type": class_type,
|
||||
"inputs": inputs,
|
||||
}
|
||||
for key_, val in (
|
||||
("is_changed", is_changed),
|
||||
):
|
||||
if isinstance(val, schemas.Unset):
|
||||
continue
|
||||
arg_[key_] = val
|
||||
arg_.update(kwargs)
|
||||
used_arg_ = typing.cast(PromptNodeDictInput, arg_)
|
||||
return PromptNode.validate(used_arg_, configuration=configuration_)
|
||||
|
||||
@staticmethod
|
||||
def from_dict_(
|
||||
arg: typing.Union[
|
||||
PromptNodeDictInput,
|
||||
PromptNodeDict
|
||||
],
|
||||
configuration: typing.Optional[schema_configuration.SchemaConfiguration] = None
|
||||
) -> PromptNodeDict:
|
||||
return PromptNode.validate(arg, configuration=configuration)
|
||||
|
||||
@property
|
||||
def class_type(self) -> str:
|
||||
return typing.cast(
|
||||
str,
|
||||
self.__getitem__("class_type")
|
||||
)
|
||||
|
||||
@property
|
||||
def inputs(self) -> InputsDict:
|
||||
return typing.cast(
|
||||
InputsDict,
|
||||
self.__getitem__("inputs")
|
||||
)
|
||||
|
||||
@property
|
||||
def is_changed(self) -> typing.Union[schemas.OUTPUT_BASE_TYPES, schemas.Unset]:
|
||||
val = self.get("is_changed", schemas.unset)
|
||||
if isinstance(val, schemas.Unset):
|
||||
return val
|
||||
return val
|
||||
|
||||
def get_additional_property_(self, name: str) -> typing.Union[schemas.OUTPUT_BASE_TYPES, schemas.Unset]:
|
||||
schemas.raise_if_key_known(name, self.__required_keys__, self.__optional_keys__)
|
||||
return self.get(name, schemas.unset)
|
||||
PromptNodeDictInput = typing.Mapping[str, schemas.INPUT_TYPES_ALL]
|
||||
|
||||
|
||||
@dataclasses.dataclass(frozen=True)
|
||||
class PromptNode(
|
||||
schemas.Schema[PromptNodeDict, tuple]
|
||||
):
|
||||
"""NOTE: This class is auto generated by OpenAPI JSON Schema Generator.
|
||||
Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator
|
||||
|
||||
Do not edit the class manually.
|
||||
"""
|
||||
types: typing.FrozenSet[typing.Type] = frozenset({schemas.immutabledict})
|
||||
required: typing.FrozenSet[str] = frozenset({
|
||||
"class_type",
|
||||
"inputs",
|
||||
})
|
||||
properties: Properties = dataclasses.field(default_factory=lambda: schemas.typed_dict_to_instance(Properties)) # type: ignore
|
||||
type_to_output_cls: typing.Mapping[
|
||||
typing.Type,
|
||||
typing.Type
|
||||
] = dataclasses.field(
|
||||
default_factory=lambda: {
|
||||
schemas.immutabledict: PromptNodeDict
|
||||
}
|
||||
)
|
||||
|
||||
@classmethod
|
||||
def validate(
|
||||
cls,
|
||||
arg: typing.Union[
|
||||
PromptNodeDictInput,
|
||||
PromptNodeDict,
|
||||
],
|
||||
configuration: typing.Optional[schema_configuration.SchemaConfiguration] = None
|
||||
) -> PromptNodeDict:
|
||||
return super().validate_base(
|
||||
arg,
|
||||
configuration=configuration,
|
||||
)
|
||||
|
||||
@@ -0,0 +1,149 @@
|
||||
# coding: utf-8
|
||||
|
||||
"""
|
||||
comfyui
|
||||
No description provided (generated by Openapi JSON Schema Generator https://github.com/openapi-json-schema-tools/openapi-json-schema-generator) # noqa: E501
|
||||
The version of the OpenAPI document: 0.0.1
|
||||
Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator
|
||||
"""
|
||||
|
||||
from __future__ import annotations
|
||||
from comfy.api.shared_imports.schema_imports import * # pyright: ignore [reportWildcardImportFromLibrary]
|
||||
|
||||
ClientId: typing_extensions.TypeAlias = schemas.StrSchema
|
||||
|
||||
from comfy.api.components.schema import extra_data
|
||||
from comfy.api.components.schema import prompt
|
||||
Properties = typing.TypedDict(
|
||||
'Properties',
|
||||
{
|
||||
"client_id": typing.Type[ClientId],
|
||||
"prompt": typing.Type[prompt.Prompt],
|
||||
"extra_data": typing.Type[extra_data.ExtraData],
|
||||
}
|
||||
)
|
||||
|
||||
|
||||
class PromptRequestDict(schemas.immutabledict[str, schemas.OUTPUT_BASE_TYPES]):
|
||||
|
||||
__required_keys__: typing.FrozenSet[str] = frozenset({
|
||||
"prompt",
|
||||
})
|
||||
__optional_keys__: typing.FrozenSet[str] = frozenset({
|
||||
"client_id",
|
||||
"extra_data",
|
||||
})
|
||||
|
||||
def __new__(
|
||||
cls,
|
||||
*,
|
||||
prompt: typing.Union[
|
||||
prompt.PromptDictInput,
|
||||
prompt.PromptDict,
|
||||
],
|
||||
client_id: typing.Union[
|
||||
str,
|
||||
schemas.Unset
|
||||
] = schemas.unset,
|
||||
extra_data: typing.Union[
|
||||
extra_data.ExtraDataDictInput,
|
||||
extra_data.ExtraDataDict,
|
||||
schemas.Unset
|
||||
] = schemas.unset,
|
||||
configuration_: typing.Optional[schema_configuration.SchemaConfiguration] = None,
|
||||
**kwargs: schemas.INPUT_TYPES_ALL,
|
||||
):
|
||||
arg_: typing.Dict[str, typing.Any] = {
|
||||
"prompt": prompt,
|
||||
}
|
||||
for key_, val in (
|
||||
("client_id", client_id),
|
||||
("extra_data", extra_data),
|
||||
):
|
||||
if isinstance(val, schemas.Unset):
|
||||
continue
|
||||
arg_[key_] = val
|
||||
arg_.update(kwargs)
|
||||
used_arg_ = typing.cast(PromptRequestDictInput, arg_)
|
||||
return PromptRequest.validate(used_arg_, configuration=configuration_)
|
||||
|
||||
@staticmethod
|
||||
def from_dict_(
|
||||
arg: typing.Union[
|
||||
PromptRequestDictInput,
|
||||
PromptRequestDict
|
||||
],
|
||||
configuration: typing.Optional[schema_configuration.SchemaConfiguration] = None
|
||||
) -> PromptRequestDict:
|
||||
return PromptRequest.validate(arg, configuration=configuration)
|
||||
|
||||
@property
|
||||
def prompt(self) -> prompt.PromptDict:
|
||||
return typing.cast(
|
||||
prompt.PromptDict,
|
||||
self.__getitem__("prompt")
|
||||
)
|
||||
|
||||
@property
|
||||
def client_id(self) -> typing.Union[str, schemas.Unset]:
|
||||
val = self.get("client_id", schemas.unset)
|
||||
if isinstance(val, schemas.Unset):
|
||||
return val
|
||||
return typing.cast(
|
||||
str,
|
||||
val
|
||||
)
|
||||
|
||||
@property
|
||||
def extra_data(self) -> typing.Union[extra_data.ExtraDataDict, schemas.Unset]:
|
||||
val = self.get("extra_data", schemas.unset)
|
||||
if isinstance(val, schemas.Unset):
|
||||
return val
|
||||
return typing.cast(
|
||||
extra_data.ExtraDataDict,
|
||||
val
|
||||
)
|
||||
|
||||
def get_additional_property_(self, name: str) -> typing.Union[schemas.OUTPUT_BASE_TYPES, schemas.Unset]:
|
||||
schemas.raise_if_key_known(name, self.__required_keys__, self.__optional_keys__)
|
||||
return self.get(name, schemas.unset)
|
||||
PromptRequestDictInput = typing.Mapping[str, schemas.INPUT_TYPES_ALL]
|
||||
|
||||
|
||||
@dataclasses.dataclass(frozen=True)
|
||||
class PromptRequest(
|
||||
schemas.Schema[PromptRequestDict, tuple]
|
||||
):
|
||||
"""NOTE: This class is auto generated by OpenAPI JSON Schema Generator.
|
||||
Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator
|
||||
|
||||
Do not edit the class manually.
|
||||
"""
|
||||
types: typing.FrozenSet[typing.Type] = frozenset({schemas.immutabledict})
|
||||
required: typing.FrozenSet[str] = frozenset({
|
||||
"prompt",
|
||||
})
|
||||
properties: Properties = dataclasses.field(default_factory=lambda: schemas.typed_dict_to_instance(Properties)) # type: ignore
|
||||
type_to_output_cls: typing.Mapping[
|
||||
typing.Type,
|
||||
typing.Type
|
||||
] = dataclasses.field(
|
||||
default_factory=lambda: {
|
||||
schemas.immutabledict: PromptRequestDict
|
||||
}
|
||||
)
|
||||
|
||||
@classmethod
|
||||
def validate(
|
||||
cls,
|
||||
arg: typing.Union[
|
||||
PromptRequestDictInput,
|
||||
PromptRequestDict,
|
||||
],
|
||||
configuration: typing.Optional[schema_configuration.SchemaConfiguration] = None
|
||||
) -> PromptRequestDict:
|
||||
return super().validate_base(
|
||||
arg,
|
||||
configuration=configuration,
|
||||
)
|
||||
|
||||
@@ -0,0 +1,166 @@
|
||||
# coding: utf-8
|
||||
|
||||
"""
|
||||
comfyui
|
||||
No description provided (generated by Openapi JSON Schema Generator https://github.com/openapi-json-schema-tools/openapi-json-schema-generator) # noqa: E501
|
||||
The version of the OpenAPI document: 0.0.1
|
||||
Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator
|
||||
"""
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
from comfy.api.components.schema import prompt, extra_data
|
||||
from comfy.api.shared_imports.schema_imports import * # pyright: ignore [reportWildcardImportFromLibrary]
|
||||
|
||||
|
||||
|
||||
class QueueTupleTuple(
|
||||
typing.Tuple[
|
||||
typing.Union[int, float],
|
||||
str,
|
||||
prompt.PromptDict,
|
||||
extra_data.ExtraDataDict,
|
||||
"_4Tuple",
|
||||
typing_extensions.Unpack[typing.Tuple[schemas.OUTPUT_BASE_TYPES, ...]]
|
||||
]
|
||||
):
|
||||
|
||||
def __new__(cls, arg: typing.Union[QueueTupleTupleInput, QueueTupleTuple], configuration: typing.Optional[schema_configuration.SchemaConfiguration] = None):
|
||||
return QueueTuple.validate(arg, configuration=configuration)
|
||||
QueueTupleTupleInput = typing.Union[
|
||||
typing.List[
|
||||
typing.Union[
|
||||
schemas.INPUT_TYPES_ALL,
|
||||
schemas.OUTPUT_BASE_TYPES
|
||||
],
|
||||
],
|
||||
typing.Tuple[
|
||||
typing.Union[
|
||||
int,
|
||||
float
|
||||
],
|
||||
str,
|
||||
typing.Union[
|
||||
prompt.PromptDictInput,
|
||||
prompt.PromptDict,
|
||||
],
|
||||
typing.Union[
|
||||
extra_data.ExtraDataDictInput,
|
||||
extra_data.ExtraDataDict,
|
||||
],
|
||||
typing.Union[
|
||||
"_4TupleInput",
|
||||
"_4Tuple"
|
||||
],
|
||||
typing_extensions.Unpack[typing.Tuple[schemas.INPUT_TYPES_ALL, ...]]
|
||||
]
|
||||
]
|
||||
_0: typing_extensions.TypeAlias = schemas.NumberSchema
|
||||
_1: typing_extensions.TypeAlias = schemas.StrSchema
|
||||
Items: typing_extensions.TypeAlias = schemas.StrSchema
|
||||
|
||||
|
||||
class _4Tuple(
|
||||
typing.Tuple[
|
||||
str,
|
||||
...
|
||||
]
|
||||
):
|
||||
|
||||
def __new__(cls, arg: typing.Union[_4TupleInput, _4Tuple], configuration: typing.Optional[schema_configuration.SchemaConfiguration] = None):
|
||||
return _4.validate(arg, configuration=configuration)
|
||||
_4TupleInput = typing.Union[
|
||||
typing.List[
|
||||
str,
|
||||
],
|
||||
typing.Tuple[
|
||||
str,
|
||||
...
|
||||
]
|
||||
]
|
||||
|
||||
|
||||
@dataclasses.dataclass(frozen=True)
|
||||
class _4(
|
||||
schemas.Schema[schemas.immutabledict, _4Tuple]
|
||||
):
|
||||
types: typing.FrozenSet[typing.Type] = frozenset({tuple})
|
||||
items: typing.Type[Items] = dataclasses.field(default_factory=lambda: Items) # type: ignore
|
||||
type_to_output_cls: typing.Mapping[
|
||||
typing.Type,
|
||||
typing.Type
|
||||
] = dataclasses.field(
|
||||
default_factory=lambda: {
|
||||
tuple: _4Tuple
|
||||
}
|
||||
)
|
||||
|
||||
@classmethod
|
||||
def validate(
|
||||
cls,
|
||||
arg: typing.Union[
|
||||
_4TupleInput,
|
||||
_4Tuple,
|
||||
],
|
||||
configuration: typing.Optional[schema_configuration.SchemaConfiguration] = None
|
||||
) -> _4Tuple:
|
||||
return super().validate_base(
|
||||
arg,
|
||||
configuration=configuration,
|
||||
)
|
||||
|
||||
|
||||
@dataclasses.dataclass(frozen=True)
|
||||
class QueueTuple(
|
||||
schemas.Schema[schemas.immutabledict, QueueTupleTuple]
|
||||
):
|
||||
"""NOTE: This class is auto generated by OpenAPI JSON Schema Generator.
|
||||
Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator
|
||||
|
||||
Do not edit the class manually.
|
||||
|
||||
The first item is the queue priority
|
||||
The second item is the hash id of the prompt object
|
||||
The third item is a Prompt
|
||||
The fourth item is optionally an ExtraData
|
||||
The fifth item is optionally a list of "Good Outputs" node IDs.
|
||||
|
||||
"""
|
||||
types: typing.FrozenSet[typing.Type] = frozenset({tuple})
|
||||
max_items: int = 5
|
||||
min_items: int = 3
|
||||
prefix_items: typing.Tuple[
|
||||
typing.Type[_0],
|
||||
typing.Type[_1],
|
||||
typing.Type[prompt.Prompt],
|
||||
typing.Type[extra_data.ExtraData],
|
||||
typing.Type[_4],
|
||||
] = (
|
||||
_0,
|
||||
_1,
|
||||
prompt.Prompt,
|
||||
extra_data.ExtraData,
|
||||
_4,
|
||||
)
|
||||
type_to_output_cls: typing.Mapping[
|
||||
typing.Type,
|
||||
typing.Type
|
||||
] = dataclasses.field(
|
||||
default_factory=lambda: {
|
||||
tuple: QueueTupleTuple
|
||||
}
|
||||
)
|
||||
|
||||
@classmethod
|
||||
def validate(
|
||||
cls,
|
||||
arg: typing.Union[
|
||||
QueueTupleTupleInput,
|
||||
QueueTupleTuple,
|
||||
],
|
||||
configuration: typing.Optional[schema_configuration.SchemaConfiguration] = None
|
||||
) -> QueueTupleTuple:
|
||||
return super().validate_base(
|
||||
arg,
|
||||
configuration=configuration,
|
||||
)
|
||||
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user