mirror of
https://git.datalinker.icu/comfyanonymous/ComfyUI
synced 2026-09-13 13:37:11 +08:00
commit
950656e725
1
.gitignore
vendored
1
.gitignore
vendored
@ -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
6
.gitmodules
vendored
@ -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
6
__init__.py
Normal 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
0
comfy/__init__.py
Normal 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,
|
||||||
|
|||||||
1
custom_nodes/ComfyUI-Manager
Submodule
1
custom_nodes/ComfyUI-Manager
Submodule
@ -0,0 +1 @@
|
|||||||
|
Subproject commit 0f679ac99c3ae83a1ce58579916afec1faf257c8
|
||||||
22
main.py
22
main.py
@ -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
24
main_utils.py
Normal 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)
|
||||||
Loading…
x
Reference in New Issue
Block a user