From 5960f946a9353f4a8ff97e92f82e0541caa32bf7 Mon Sep 17 00:00:00 2001 From: comfyanonymous Date: Thu, 15 Aug 2024 09:37:30 -0400 Subject: [PATCH] Move a few files from comfy -> comfy_execution. Python code in the comfy folder should not import things from outside it. --- {comfy => comfy_execution}/caching.py | 4 ++-- {comfy => comfy_execution}/graph.py | 2 +- {comfy => comfy_execution}/graph_utils.py | 0 execution.py | 7 +++---- tests/inference/test_execution.py | 2 +- tests/inference/testing_nodes/testing-pack/flow_control.py | 4 ++-- .../inference/testing_nodes/testing-pack/specific_tests.py | 2 +- tests/inference/testing_nodes/testing-pack/util.py | 2 +- 8 files changed, 11 insertions(+), 12 deletions(-) rename {comfy => comfy_execution}/caching.py (99%) rename {comfy => comfy_execution}/graph.py (99%) rename {comfy => comfy_execution}/graph_utils.py (100%) diff --git a/comfy/caching.py b/comfy_execution/caching.py similarity index 99% rename from comfy/caching.py rename to comfy_execution/caching.py index abcf68ae..6664a342 100644 --- a/comfy/caching.py +++ b/comfy_execution/caching.py @@ -1,10 +1,10 @@ import itertools from typing import Sequence, Mapping -from comfy.graph import DynamicPrompt +from comfy_execution.graph import DynamicPrompt import nodes -from comfy.graph_utils import is_link +from comfy_execution.graph_utils import is_link class CacheKeySet: def __init__(self, dynprompt, node_ids, is_changed_cache): diff --git a/comfy/graph.py b/comfy_execution/graph.py similarity index 99% rename from comfy/graph.py rename to comfy_execution/graph.py index 8980c693..303ccae3 100644 --- a/comfy/graph.py +++ b/comfy_execution/graph.py @@ -1,6 +1,6 @@ import nodes -from comfy.graph_utils import is_link +from comfy_execution.graph_utils import is_link class DependencyCycleError(Exception): pass diff --git a/comfy/graph_utils.py b/comfy_execution/graph_utils.py similarity index 100% rename from comfy/graph_utils.py rename to comfy_execution/graph_utils.py diff --git a/execution.py b/execution.py index ee675893..9018ddab 100644 --- a/execution.py +++ b/execution.py @@ -13,10 +13,9 @@ import torch import nodes import comfy.model_management -import comfy.graph_utils -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, CacheKeySetID +from comfy_execution.graph import get_input_info, ExecutionList, DynamicPrompt, ExecutionBlocker +from comfy_execution.graph_utils import is_link, GraphBuilder +from comfy_execution.caching import HierarchicalCache, LRUCache, CacheKeySetInputSignature, CacheKeySetID from comfy.cli_args import args class ExecutionResult(Enum): diff --git a/tests/inference/test_execution.py b/tests/inference/test_execution.py index 8616ca1e..9df1d7df 100644 --- a/tests/inference/test_execution.py +++ b/tests/inference/test_execution.py @@ -13,7 +13,7 @@ import uuid import urllib.request import urllib.parse import urllib.error -from comfy.graph_utils import GraphBuilder, Node +from comfy_execution.graph_utils import GraphBuilder, Node class RunResult: def __init__(self, prompt_id: str): diff --git a/tests/inference/testing_nodes/testing-pack/flow_control.py b/tests/inference/testing_nodes/testing-pack/flow_control.py index 1ef1cf80..ba943be6 100644 --- a/tests/inference/testing_nodes/testing-pack/flow_control.py +++ b/tests/inference/testing_nodes/testing-pack/flow_control.py @@ -1,5 +1,5 @@ -from comfy.graph_utils import GraphBuilder, is_link -from comfy.graph import ExecutionBlocker +from comfy_execution.graph_utils import GraphBuilder, is_link +from comfy_execution.graph import ExecutionBlocker from .tools import VariantSupport NUM_FLOW_SOCKETS = 5 diff --git a/tests/inference/testing_nodes/testing-pack/specific_tests.py b/tests/inference/testing_nodes/testing-pack/specific_tests.py index 5884cae0..b961d1b6 100644 --- a/tests/inference/testing_nodes/testing-pack/specific_tests.py +++ b/tests/inference/testing_nodes/testing-pack/specific_tests.py @@ -1,6 +1,6 @@ import torch from .tools import VariantSupport -from comfy.graph_utils import GraphBuilder +from comfy_execution.graph_utils import GraphBuilder class TestLazyMixImages: @classmethod diff --git a/tests/inference/testing_nodes/testing-pack/util.py b/tests/inference/testing_nodes/testing-pack/util.py index fea83e37..ca116c16 100644 --- a/tests/inference/testing_nodes/testing-pack/util.py +++ b/tests/inference/testing_nodes/testing-pack/util.py @@ -1,4 +1,4 @@ -from comfy.graph_utils import GraphBuilder +from comfy_execution.graph_utils import GraphBuilder from .tools import VariantSupport @VariantSupport()