__typing
This commit is contained in:
@@ -0,0 +1,8 @@
|
||||
# encoding: utf-8
|
||||
"""
|
||||
"""
|
||||
|
||||
from typing import TypeVar as _TypeVar
|
||||
|
||||
T = _TypeVar('T')
|
||||
T2 = _TypeVar('T2')
|
||||
@@ -10,9 +10,7 @@ try:
|
||||
except ImportError:
|
||||
from comfy.comfy_types.node_typing import StrEnum as _StrEnum
|
||||
|
||||
|
||||
T = _t.TypeVar('T')
|
||||
T2 = _t.TypeVar('T2')
|
||||
from .__typing import T as _T
|
||||
|
||||
|
||||
class __BaseEnum(_StrEnum):
|
||||
@@ -26,7 +24,7 @@ class DataTypes(__BaseEnum):
|
||||
DICT = 'DICT'
|
||||
|
||||
@staticmethod
|
||||
def __custom_input_type_dict(_dict_args: _t.Tuple[_t.Dict[str, T], ...], kwargs: _t.Dict[str, T]) -> _t.Dict[str, T]:
|
||||
def __custom_input_type_dict(_dict_args: _t.Tuple[_t.Dict[str, _T], ...], kwargs: _t.Dict[str, _T]) -> _t.Dict[str, _T]:
|
||||
res_dict: _t.Dict[str, _t.Any] = {"forceInput": True}
|
||||
for d in _dict_args:
|
||||
if d is not None:
|
||||
@@ -35,5 +33,5 @@ class DataTypes(__BaseEnum):
|
||||
return res_dict
|
||||
|
||||
@classmethod
|
||||
def input_dict(cls, *_dicts: _t.Dict[str, T], **kwargs: T) -> _t.Tuple[_t.Union['DataTypes', str], _t.Dict[str, T]]:
|
||||
def input_dict(cls, *_dicts: _t.Dict[str, _T], **kwargs: _T) -> _t.Tuple[_t.Union['DataTypes', str], _t.Dict[str, _T]]:
|
||||
return str(cls.DICT), cls.__custom_input_type_dict(_dicts, kwargs)
|
||||
|
||||
+1
-1
@@ -11,7 +11,7 @@ from frozendict import deepfreeze as _deepfreeze, frozendict as _frozendict
|
||||
|
||||
from server import PromptServer as _PromptServer
|
||||
|
||||
from .enums import T as _T, T2 as _T2
|
||||
from .__typing import T as _T, T2 as _T2
|
||||
|
||||
|
||||
def _show_text_on_node(text: str = None, unique_id: str = None):
|
||||
|
||||
Reference in New Issue
Block a user