Merge pull request #1 from Alschain/leon/dev

Leon/dev
This commit is contained in:
Wang Shuheng 2024-09-05 13:23:12 +08:00 committed by GitHub
commit 950656e725
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
10 changed files with 38 additions and 28 deletions

1
.gitignore vendored
View File

@ -7,6 +7,7 @@ __pycache__/
/temp/ /temp/
/custom_nodes/ /custom_nodes/
!custom_nodes/example_node.py.example !custom_nodes/example_node.py.example
!custom_nodes/ComfyUI-Manager
extra_model_paths.yaml extra_model_paths.yaml
/.vs /.vs
.vscode/ .vscode/

6
.gitmodules vendored
View File

@ -1,6 +1,6 @@
[submodule "ComfyUI-Manager"]
path = ComfyUI-Manager
url = https://github.com/ltdrdata/ComfyUI-Manager
[submodule "ComfyUI-to-Python-Extension"] [submodule "ComfyUI-to-Python-Extension"]
path = ComfyUI-to-Python-Extension path = ComfyUI-to-Python-Extension
url = https://github.com/Alschain/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

@ -1 +0,0 @@
Subproject commit d7170c0264ca1623b7a4ba7d63756a9b54a7d119

@ -1 +1 @@
Subproject commit d3b82726a7f185f25f3d0194702ea17df47ee167 Subproject commit 2c75211aa0080368804401856c0b1c4c19558b72

6
__init__.py Normal file
View File

@ -0,0 +1,6 @@
import os
import sys
sys.path.append(os.path.dirname(__file__))
from ComfyUI import (
comfy,
)

0
comfy/__init__.py Normal file
View File

View File

@ -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. 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") 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_comfyui_directory_to_sys_path()
add_extra_model_paths() add_extra_model_paths()
from nodes import ( from nodes import (
NODE_CLASS_MAPPINGS, NODE_CLASS_MAPPINGS,
SaveImage, SaveImage,

@ -0,0 +1 @@
Subproject commit 0f679ac99c3ae83a1ce58579916afec1faf257c8

22
main.py
View File

@ -6,7 +6,7 @@ import importlib.util
import folder_paths import folder_paths
import time import time
from comfy.cli_args import args from comfy.cli_args import args
from main_utils import load_extra_path_config
def execute_prestartup_script(): def execute_prestartup_script():
def execute_script(script_path): def execute_script(script_path):
@ -176,26 +176,6 @@ def cleanup_temp():
shutil.rmtree(temp_dir, ignore_errors=True) 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 __name__ == "__main__":
if args.temp_directory: if args.temp_directory:

24
main_utils.py Normal file
View File

@ -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)