mirror of
https://github.com/comfyanonymous/ComfyUI.git
synced 2026-01-12 07:10:52 +08:00
- 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.
206 lines
6.4 KiB
Python
206 lines
6.4 KiB
Python
# 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,
|
|
)
|
|
|