mirror of
https://git.datalinker.icu/comfyanonymous/ComfyUI
synced 2026-09-03 00:07:07 +08:00
corrected check if the node is V3 or not
This commit is contained in:
parent
aff5271291
commit
89b5f50b5f
@ -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
|
||||
|
||||
|
||||
10
execution.py
10
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))
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user