From 89b5f50b5f26df4a9382b581436335443ffd89b2 Mon Sep 17 00:00:00 2001 From: bigcat88 Date: Tue, 8 Jul 2025 18:02:26 +0300 Subject: [PATCH] corrected check if the node is V3 or not --- comfy_api/v3/io.py | 2 +- execution.py | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/comfy_api/v3/io.py b/comfy_api/v3/io.py index 4cc758562..3db6dd4a1 100644 --- a/comfy_api/v3/io.py +++ b/comfy_api/v3/io.py @@ -1015,7 +1015,7 @@ class ComfyNodeV3: type_clone: type[ComfyNodeV3] = type(f"CLEAN_{c_type.__name__}", c_type.__bases__, {}) # TODO: what parameters should be carried over? 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 return type_clone diff --git a/execution.py b/execution.py index 5ab7f1fe0..63acf6100 100644 --- a/execution.py +++ b/execution.py @@ -28,7 +28,7 @@ from comfy_execution.graph import ( ) from comfy_execution.graph_utils import GraphBuilder, is_link 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): @@ -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: pre_execute_cb(index) # V3 - if isinstance(obj, ComfyNodeV3): - type(obj).VALIDATE_CLASS() - class_clone = type(obj).prepare_class_clone(hidden_inputs) + if is_class(obj) and issubclass(obj, ComfyNodeV3): + obj.VALIDATE_CLASS() + class_clone = obj.prepare_class_clone(hidden_inputs) # NOTE: this is a mock of state management; for local, just stores NodeStateLocal on node instance if hasattr(obj, "local_state"): 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: obj.local_resources = ResourcesLocal() 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 else: results.append(getattr(obj, func)(**inputs))