fix(V3-Schema): use empty list defaults for Schema.inputs/outputs/hidden to avoid None issues (#11083)

This commit is contained in:
Alexander Piskun 2025-12-03 18:37:35 +02:00 committed by GitHub
parent 519c941165
commit 19f2192d69
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -5,7 +5,7 @@ import inspect
from abc import ABC, abstractmethod from abc import ABC, abstractmethod
from collections import Counter from collections import Counter
from collections.abc import Iterable from collections.abc import Iterable
from dataclasses import asdict, dataclass from dataclasses import asdict, dataclass, field
from enum import Enum from enum import Enum
from typing import Any, Callable, Literal, TypedDict, TypeVar, TYPE_CHECKING from typing import Any, Callable, Literal, TypedDict, TypeVar, TYPE_CHECKING
from typing_extensions import NotRequired, final from typing_extensions import NotRequired, final
@ -1199,9 +1199,9 @@ class Schema:
"""Display name of node.""" """Display name of node."""
category: str = "sd" category: str = "sd"
"""The category of the node, as per the "Add Node" menu.""" """The category of the node, as per the "Add Node" menu."""
inputs: list[Input]=None inputs: list[Input] = field(default_factory=list)
outputs: list[Output]=None outputs: list[Output] = field(default_factory=list)
hidden: list[Hidden]=None hidden: list[Hidden] = field(default_factory=list)
description: str="" description: str=""
"""Node description, shown as a tooltip when hovering over the node.""" """Node description, shown as a tooltip when hovering over the node."""
is_input_list: bool = False is_input_list: bool = False