mirror of
https://github.com/comfyanonymous/ComfyUI.git
synced 2025-07-27 16:26:39 +00:00
Abstracted out NodeOutput into _NodeOutputInternal in execution.py
This commit is contained in:
parent
d3a62a440f
commit
44afeab124
@ -36,6 +36,13 @@ class _ComfyNodeInternal:
|
|||||||
...
|
...
|
||||||
|
|
||||||
|
|
||||||
|
class _NodeOutputInternal:
|
||||||
|
"""Class that all V3-based APIs inherit from for NodeOutput.
|
||||||
|
|
||||||
|
This is intended to only be referenced within execution.py, as it has to handle all V3 APIs going forward."""
|
||||||
|
...
|
||||||
|
|
||||||
|
|
||||||
def as_pruned_dict(dataclass_obj):
|
def as_pruned_dict(dataclass_obj):
|
||||||
'''Return dict of dataclass object with pruned None values.'''
|
'''Return dict of dataclass object with pruned None values.'''
|
||||||
return prune_dict(asdict(dataclass_obj))
|
return prune_dict(asdict(dataclass_obj))
|
||||||
|
@ -22,7 +22,7 @@ from comfy.samplers import CFGGuider, Sampler
|
|||||||
from comfy.sd import CLIP, VAE
|
from comfy.sd import CLIP, VAE
|
||||||
from comfy.sd import StyleModel as StyleModel_
|
from comfy.sd import StyleModel as StyleModel_
|
||||||
from comfy_api.input import VideoInput
|
from comfy_api.input import VideoInput
|
||||||
from comfy_api.internal import (_ComfyNodeInternal, classproperty, copy_class, first_real_override, is_class,
|
from comfy_api.internal import (_ComfyNodeInternal, _NodeOutputInternal, classproperty, copy_class, first_real_override, is_class,
|
||||||
prune_dict, shallow_clone_class)
|
prune_dict, shallow_clone_class)
|
||||||
from comfy_api.v3._resources import Resources, ResourcesLocal
|
from comfy_api.v3._resources import Resources, ResourcesLocal
|
||||||
from comfy_execution.graph import ExecutionBlocker
|
from comfy_execution.graph import ExecutionBlocker
|
||||||
@ -1486,7 +1486,7 @@ class ComfyNode(_ComfyNodeBaseInternal):
|
|||||||
return ComfyNode
|
return ComfyNode
|
||||||
|
|
||||||
|
|
||||||
class NodeOutput:
|
class NodeOutput(_NodeOutputInternal):
|
||||||
'''
|
'''
|
||||||
Standardized output of a node; can pass in any number of args and/or a UIOutput into 'ui' kwarg.
|
Standardized output of a node; can pass in any number of args and/or a UIOutput into 'ui' kwarg.
|
||||||
'''
|
'''
|
||||||
|
@ -32,7 +32,7 @@ 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_execution.progress import get_progress_state, reset_progress_state, add_progress_handler, WebUIProgressHandler
|
from comfy_execution.progress import get_progress_state, reset_progress_state, add_progress_handler, WebUIProgressHandler
|
||||||
from comfy_execution.utils import CurrentNodeContext
|
from comfy_execution.utils import CurrentNodeContext
|
||||||
from comfy_api.internal import _ComfyNodeInternal, first_real_override, is_class, make_locked_method_func
|
from comfy_api.internal import _ComfyNodeInternal, _NodeOutputInternal, first_real_override, is_class, make_locked_method_func
|
||||||
from comfy_api.v3 import io, resources
|
from comfy_api.v3 import io, resources
|
||||||
|
|
||||||
|
|
||||||
@ -358,7 +358,7 @@ def get_output_from_returns(return_values, obj):
|
|||||||
result = tuple([result] * len(obj.RETURN_TYPES))
|
result = tuple([result] * len(obj.RETURN_TYPES))
|
||||||
results.append(result)
|
results.append(result)
|
||||||
subgraph_results.append((None, result))
|
subgraph_results.append((None, result))
|
||||||
elif isinstance(r, io.NodeOutput):
|
elif isinstance(r, _NodeOutputInternal):
|
||||||
# V3
|
# V3
|
||||||
if r.ui is not None:
|
if r.ui is not None:
|
||||||
if isinstance(r.ui, dict):
|
if isinstance(r.ui, dict):
|
||||||
|
Loading…
x
Reference in New Issue
Block a user