diff --git a/comfy_api/latest/_io.py b/comfy_api/latest/_io.py index 425408e41..3f79cf134 100644 --- a/comfy_api/latest/_io.py +++ b/comfy_api/latest/_io.py @@ -1239,17 +1239,15 @@ class BoundingBox(ComfyTypeIO): @comfytype(io_type="CURVE") class Curve(ComfyTypeIO): - Type = list + CurvePoint = tuple[float, float] + Type = list[CurvePoint] class Input(WidgetInput): def __init__(self, id: str, display_name: str=None, optional=False, tooltip: str=None, - socketless: bool=True, default: list=None, advanced: bool=None): + socketless: bool=True, default: list[tuple[float, float]]=None, advanced: bool=None): super().__init__(id, display_name, optional, tooltip, None, default, socketless, None, None, None, None, advanced) if default is None: - self.default = [[0, 0], [1, 1]] - - def as_dict(self): - return super().as_dict() + self.default = [[0.0, 0.0], [1.0, 1.0]] DYNAMIC_INPUT_LOOKUP: dict[str, Callable[[dict[str, Any], dict[str, Any], tuple[str, dict[str, Any]], str, list[str] | None], None]] = {} diff --git a/execution.py b/execution.py index 75b021892..b5617638f 100644 --- a/execution.py +++ b/execution.py @@ -876,12 +876,17 @@ async def validate_inputs(prompt_id, prompt, item, validated): continue else: try: - # Unwraps values wrapped in __value__ key. This is used to pass - # list widget value to execution, as by default list value is - # reserved to represent the connection between nodes. - if isinstance(val, dict) and "__value__" in val: - val = val["__value__"] - inputs[x] = val + # Unwraps values wrapped in __value__ key or typed wrapper. + # This is used to pass list widget values to execution, + # as by default list value is reserved to represent the + # connection between nodes. + if isinstance(val, dict): + if "__value__" in val: + val = val["__value__"] + inputs[x] = val + elif "__type__" in val and "__value__" in val: + val = val["__value__"] + inputs[x] = val if input_type == "INT": val = int(val)