corrected check if the node is V3 or not

This commit is contained in:
bigcat88 2025-07-08 18:02:26 +03:00
parent aff5271291
commit 89b5f50b5f
No known key found for this signature in database
GPG Key ID: 1F0BF0EC3CF22721
2 changed files with 6 additions and 6 deletions

View File

@ -1015,7 +1015,7 @@ class ComfyNodeV3:
type_clone: type[ComfyNodeV3] = type(f"CLEAN_{c_type.__name__}", c_type.__bases__, {}) type_clone: type[ComfyNodeV3] = type(f"CLEAN_{c_type.__name__}", c_type.__bases__, {})
# TODO: what parameters should be carried over? # TODO: what parameters should be carried over?
type_clone.SCHEMA = c_type.SCHEMA type_clone.SCHEMA = c_type.SCHEMA
type_clone.hidden = HiddenHolder.from_dict(hidden_inputs) type_clone.hidden = HiddenHolder.from_dict(hidden_inputs) if hidden_inputs is not None else None
# TODO: add anything we would want to expose inside node's execute function # TODO: add anything we would want to expose inside node's execute function
return type_clone return type_clone

View File

@ -28,7 +28,7 @@ from comfy_execution.graph import (
) )
from comfy_execution.graph_utils import GraphBuilder, is_link from comfy_execution.graph_utils import GraphBuilder, is_link
from comfy_execution.validation import validate_node_input from comfy_execution.validation import validate_node_input
from comfy_api.v3.io import NodeOutput, ComfyNodeV3, Hidden, NodeStateLocal, ResourcesLocal from comfy_api.v3.io import NodeOutput, ComfyNodeV3, Hidden, NodeStateLocal, ResourcesLocal, is_class
class ExecutionResult(Enum): class ExecutionResult(Enum):
@ -216,9 +216,9 @@ def _map_node_over_list(obj, input_data_all, func, allow_interrupt=False, execut
if pre_execute_cb is not None and index is not None: if pre_execute_cb is not None and index is not None:
pre_execute_cb(index) pre_execute_cb(index)
# V3 # V3
if isinstance(obj, ComfyNodeV3): if is_class(obj) and issubclass(obj, ComfyNodeV3):
type(obj).VALIDATE_CLASS() obj.VALIDATE_CLASS()
class_clone = type(obj).prepare_class_clone(hidden_inputs) class_clone = obj.prepare_class_clone(hidden_inputs)
# NOTE: this is a mock of state management; for local, just stores NodeStateLocal on node instance # NOTE: this is a mock of state management; for local, just stores NodeStateLocal on node instance
if hasattr(obj, "local_state"): if hasattr(obj, "local_state"):
if obj.local_state is None: if obj.local_state is None:
@ -229,7 +229,7 @@ def _map_node_over_list(obj, input_data_all, func, allow_interrupt=False, execut
if obj.local_resources is None: if obj.local_resources is None:
obj.local_resources = ResourcesLocal() obj.local_resources = ResourcesLocal()
class_clone.resources = obj.local_resources class_clone.resources = obj.local_resources
results.append(getattr(type(obj), func).__func__(class_clone, **inputs)) results.append(getattr(obj, func).__func__(class_clone, **inputs))
# V1 # V1
else: else:
results.append(getattr(obj, func)(**inputs)) results.append(getattr(obj, func)(**inputs))