diff --git a/.gitignore b/.gitignore index b212b0297..15b2ee51a 100644 --- a/.gitignore +++ b/.gitignore @@ -7,6 +7,7 @@ __pycache__/ /temp/ /custom_nodes/ !custom_nodes/example_node.py.example +!custom_nodes/ComfyUI-Manager extra_model_paths.yaml /.vs .vscode/ diff --git a/.gitmodules b/.gitmodules index f2f749ec8..55802fa4c 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,6 +1,6 @@ -[submodule "ComfyUI-Manager"] - path = ComfyUI-Manager - url = https://github.com/ltdrdata/ComfyUI-Manager [submodule "ComfyUI-to-Python-Extension"] path = ComfyUI-to-Python-Extension url = https://github.com/Alschain/ComfyUI-to-Python-Extension +[submodule "custom_nodes/ComfyUI-Manager"] + path = custom_nodes/ComfyUI-Manager + url = https://github.com/ltdrdata/ComfyUI-Manager diff --git a/ComfyUI-Manager b/ComfyUI-Manager deleted file mode 160000 index d7170c026..000000000 --- a/ComfyUI-Manager +++ /dev/null @@ -1 +0,0 @@ -Subproject commit d7170c0264ca1623b7a4ba7d63756a9b54a7d119 diff --git a/ComfyUI-to-Python-Extension b/ComfyUI-to-Python-Extension index d3b82726a..2c75211aa 160000 --- a/ComfyUI-to-Python-Extension +++ b/ComfyUI-to-Python-Extension @@ -1 +1 @@ -Subproject commit d3b82726a7f185f25f3d0194702ea17df47ee167 +Subproject commit 2c75211aa0080368804401856c0b1c4c19558b72 diff --git a/__init__.py b/__init__.py new file mode 100644 index 000000000..7913b6259 --- /dev/null +++ b/__init__.py @@ -0,0 +1,6 @@ +import os +import sys +sys.path.append(os.path.dirname(__file__)) +from ComfyUI import ( + comfy, + ) \ No newline at end of file diff --git a/comfy/__init__.py b/comfy/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/custom_functions/image_text_to_image.py b/custom_functions/image_text_to_image.py index 5a828d996..c5729609b 100644 --- a/custom_functions/image_text_to_image.py +++ b/custom_functions/image_text_to_image.py @@ -69,7 +69,7 @@ def add_extra_model_paths() -> None: """ Parse the optional extra_model_paths.yaml file and add the parsed paths to the sys.path. """ - from main import load_extra_path_config + from main_utils import load_extra_path_config extra_model_paths = find_path("extra_model_paths.yaml") @@ -81,7 +81,6 @@ def add_extra_model_paths() -> None: add_comfyui_directory_to_sys_path() add_extra_model_paths() - from nodes import ( NODE_CLASS_MAPPINGS, SaveImage, diff --git a/custom_nodes/ComfyUI-Manager b/custom_nodes/ComfyUI-Manager new file mode 160000 index 000000000..0f679ac99 --- /dev/null +++ b/custom_nodes/ComfyUI-Manager @@ -0,0 +1 @@ +Subproject commit 0f679ac99c3ae83a1ce58579916afec1faf257c8 diff --git a/main.py b/main.py index 9bd985149..645d7ec2d 100644 --- a/main.py +++ b/main.py @@ -6,7 +6,7 @@ import importlib.util import folder_paths import time from comfy.cli_args import args - +from main_utils import load_extra_path_config def execute_prestartup_script(): def execute_script(script_path): @@ -176,26 +176,6 @@ def cleanup_temp(): shutil.rmtree(temp_dir, ignore_errors=True) -def load_extra_path_config(yaml_path): - with open(yaml_path, 'r') as stream: - config = yaml.safe_load(stream) - for c in config: - conf = config[c] - if conf is None: - continue - base_path = None - if "base_path" in conf: - base_path = conf.pop("base_path") - for x in conf: - for y in conf[x].split("\n"): - if len(y) == 0: - continue - full_path = y - if base_path is not None: - full_path = os.path.join(base_path, full_path) - logging.info("Adding extra search path {} {}".format(x, full_path)) - folder_paths.add_model_folder_path(x, full_path) - if __name__ == "__main__": if args.temp_directory: diff --git a/main_utils.py b/main_utils.py new file mode 100644 index 000000000..d55e343dd --- /dev/null +++ b/main_utils.py @@ -0,0 +1,24 @@ +import os +import folder_paths +import logging +import yaml + +def load_extra_path_config(yaml_path): + with open(yaml_path, 'r') as stream: + config = yaml.safe_load(stream) + for c in config: + conf = config[c] + if conf is None: + continue + base_path = None + if "base_path" in conf: + base_path = conf.pop("base_path") + for x in conf: + for y in conf[x].split("\n"): + if len(y) == 0: + continue + full_path = y + if base_path is not None: + full_path = os.path.join(base_path, full_path) + logging.info("Adding extra search path {} {}".format(x, full_path)) + folder_paths.add_model_folder_path(x, full_path) \ No newline at end of file