Added 'not_idempotent' support for SchemaV3

This commit is contained in:
Jedrzej Kosinski 2025-06-19 02:53:35 -05:00
parent fe9a47ae50
commit 002e16ac71

View File

@ -695,6 +695,8 @@ class SchemaV3:
"""Flags a node as experimental, informing users that it may change or not work as expected.""" """Flags a node as experimental, informing users that it may change or not work as expected."""
is_api_node: bool=False is_api_node: bool=False
"""Flags a node as an API node. See: https://docs.comfy.org/tutorials/api-nodes/overview.""" """Flags a node as an API node. See: https://docs.comfy.org/tutorials/api-nodes/overview."""
not_idempotent: bool=False
"""Flags a node as not idempotent; when True, the node will run and not reuse the cached outputs when identical inputs are provided on a different node in the graph."""
class Serializer: class Serializer:
@ -855,6 +857,13 @@ class ComfyNodeV3:
cls.GET_SCHEMA() cls.GET_SCHEMA()
return cls._OUTPUT_TOOLTIPS return cls._OUTPUT_TOOLTIPS
_NOT_IDEMPOTENT = None
@classproperty
def NOT_IDEMPOTENT(cls):
if cls._NOT_IDEMPOTENT is None:
cls.GET_SCHEMA()
return cls._NOT_IDEMPOTENT
FUNCTION = "execute" FUNCTION = "execute"
@classmethod @classmethod
@ -893,6 +902,8 @@ class ComfyNodeV3:
cls._OUTPUT_NODE = schema.is_output_node cls._OUTPUT_NODE = schema.is_output_node
if cls._INPUT_IS_LIST is None: if cls._INPUT_IS_LIST is None:
cls._INPUT_IS_LIST = schema.is_input_list cls._INPUT_IS_LIST = schema.is_input_list
if cls._NOT_IDEMPOTENT is None:
cls._NOT_IDEMPOTENT = schema.not_idempotent
if cls._RETURN_TYPES is None: if cls._RETURN_TYPES is None:
output = [] output = []