mirror of
https://github.com/comfyanonymous/ComfyUI.git
synced 2025-04-13 15:03:33 +00:00
Merge 9b608b6f92
into 22ad513c72
This commit is contained in:
commit
c82d11d5fb
11
main.py
11
main.py
@ -69,6 +69,13 @@ def execute_prestartup_script():
|
|||||||
if args.disable_all_custom_nodes:
|
if args.disable_all_custom_nodes:
|
||||||
return
|
return
|
||||||
|
|
||||||
|
# Get the environment variable and convert it to a list (if not empty)
|
||||||
|
included_custom_nodes = os.environ.get("INCLUDED_CUSTOM_NODES", "").strip()
|
||||||
|
included_custom_nodes = (
|
||||||
|
[name.strip() for name in included_custom_nodes.split(",")]
|
||||||
|
if included_custom_nodes else None
|
||||||
|
)
|
||||||
|
|
||||||
node_paths = folder_paths.get_folder_paths("custom_nodes")
|
node_paths = folder_paths.get_folder_paths("custom_nodes")
|
||||||
for custom_node_path in node_paths:
|
for custom_node_path in node_paths:
|
||||||
possible_modules = os.listdir(custom_node_path)
|
possible_modules = os.listdir(custom_node_path)
|
||||||
@ -79,6 +86,10 @@ def execute_prestartup_script():
|
|||||||
if os.path.isfile(module_path) or module_path.endswith(".disabled") or module_path == "__pycache__":
|
if os.path.isfile(module_path) or module_path.endswith(".disabled") or module_path == "__pycache__":
|
||||||
continue
|
continue
|
||||||
|
|
||||||
|
# Skip modules that are not in INCLUDED_CUSTOM_NODES
|
||||||
|
if included_custom_nodes and possible_module not in included_custom_nodes:
|
||||||
|
continue
|
||||||
|
|
||||||
script_path = os.path.join(module_path, "prestartup_script.py")
|
script_path = os.path.join(module_path, "prestartup_script.py")
|
||||||
if os.path.exists(script_path):
|
if os.path.exists(script_path):
|
||||||
time_before = time.perf_counter()
|
time_before = time.perf_counter()
|
||||||
|
11
nodes.py
11
nodes.py
@ -2184,6 +2184,13 @@ def init_external_custom_nodes():
|
|||||||
Returns:
|
Returns:
|
||||||
None
|
None
|
||||||
"""
|
"""
|
||||||
|
# Get the environment variable and convert it to a list (if not empty)
|
||||||
|
included_custom_nodes = os.environ.get("INCLUDED_CUSTOM_NODES", "").strip()
|
||||||
|
included_custom_nodes = (
|
||||||
|
[name.strip() for name in included_custom_nodes.split(",")]
|
||||||
|
if included_custom_nodes else None
|
||||||
|
)
|
||||||
|
|
||||||
base_node_names = set(NODE_CLASS_MAPPINGS.keys())
|
base_node_names = set(NODE_CLASS_MAPPINGS.keys())
|
||||||
node_paths = folder_paths.get_folder_paths("custom_nodes")
|
node_paths = folder_paths.get_folder_paths("custom_nodes")
|
||||||
node_import_times = []
|
node_import_times = []
|
||||||
@ -2193,6 +2200,10 @@ def init_external_custom_nodes():
|
|||||||
possible_modules.remove("__pycache__")
|
possible_modules.remove("__pycache__")
|
||||||
|
|
||||||
for possible_module in possible_modules:
|
for possible_module in possible_modules:
|
||||||
|
# Skip modules that are not in INCLUDED_CUSTOM_NODES
|
||||||
|
if included_custom_nodes and possible_module not in included_custom_nodes:
|
||||||
|
continue
|
||||||
|
|
||||||
module_path = os.path.join(custom_node_path, possible_module)
|
module_path = os.path.join(custom_node_path, possible_module)
|
||||||
if os.path.isfile(module_path) and os.path.splitext(module_path)[1] != ".py": continue
|
if os.path.isfile(module_path) and os.path.splitext(module_path)[1] != ".py": continue
|
||||||
if module_path.endswith(".disabled"): continue
|
if module_path.endswith(".disabled"): continue
|
||||||
|
Loading…
Reference in New Issue
Block a user