From d233db0ef1e6fc0b367d0056ed097f0506c03cd2 Mon Sep 17 00:00:00 2001 From: Jacob Segal Date: Wed, 20 Sep 2023 19:49:17 -0700 Subject: [PATCH] Move ExecutionBlocker to a better location --- comfy/graph.py | 6 ++++++ comfy/graph_utils.py | 5 ----- .../execution-inversion-demo-comfyui/flow_control.py | 3 ++- execution.py | 4 ++-- 4 files changed, 10 insertions(+), 8 deletions(-) diff --git a/comfy/graph.py b/comfy/graph.py index a16774309..2612317f9 100644 --- a/comfy/graph.py +++ b/comfy/graph.py @@ -164,3 +164,9 @@ class ExecutionList(TopologicalSort): node_id = self.staged_node_id self.pop_node(node_id) self.staged_node_id = None + +# Return this from a node and any users will be blocked with the given error message. +class ExecutionBlocker: + def __init__(self, message): + self.message = message + diff --git a/comfy/graph_utils.py b/comfy/graph_utils.py index f7aacaa7c..f48a38308 100644 --- a/comfy/graph_utils.py +++ b/comfy/graph_utils.py @@ -84,11 +84,6 @@ class GraphBuilder: id = self.prefix + id del self.nodes[id] -# Return this from a node and any users will be blocked with the given error message. -class ExecutionBlocker: - def __init__(self, message): - self.message = message - class Node: def __init__(self, id, class_type, inputs): self.id = id diff --git a/custom_nodes/execution-inversion-demo-comfyui/flow_control.py b/custom_nodes/execution-inversion-demo-comfyui/flow_control.py index 3f05a89a4..1b328d957 100644 --- a/custom_nodes/execution-inversion-demo-comfyui/flow_control.py +++ b/custom_nodes/execution-inversion-demo-comfyui/flow_control.py @@ -1,4 +1,5 @@ -from comfy.graph_utils import GraphBuilder, is_link, ExecutionBlocker +from comfy.graph_utils import GraphBuilder, is_link +from comfy.graph import ExecutionBlocker NUM_FLOW_SOCKETS = 5 class WhileLoopOpen: diff --git a/execution.py b/execution.py index d9289d3c4..a16c31497 100644 --- a/execution.py +++ b/execution.py @@ -13,8 +13,8 @@ import nodes import comfy.model_management import comfy.graph_utils -from comfy.graph import get_input_info, ExecutionList, DynamicPrompt -from comfy.graph_utils import is_link, ExecutionBlocker, GraphBuilder +from comfy.graph import get_input_info, ExecutionList, DynamicPrompt, ExecutionBlocker +from comfy.graph_utils import is_link, GraphBuilder from comfy.caching import HierarchicalCache, LRUCache, CacheKeySetInputSignature, CacheKeySetInputSignatureWithID, CacheKeySetID class ExecutionResult(Enum):