mirror of
https://github.com/comfyanonymous/ComfyUI.git
synced 2025-12-20 19:42:59 +08:00
fixed: Ensure that comfyui_manager's prestartup always runs, even when --disable-all-custom-nodes is used.
feat: Disable specific custom nodes according to the policy of `comfyui_manager`.
This commit is contained in:
parent
cc975e5f0b
commit
418eaed42c
7
main.py
7
main.py
@ -70,8 +70,6 @@ def execute_prestartup_script():
|
|||||||
if args.disable_all_custom_nodes:
|
if args.disable_all_custom_nodes:
|
||||||
return
|
return
|
||||||
|
|
||||||
comfyui_manager.prestartup()
|
|
||||||
|
|
||||||
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 +77,10 @@ def execute_prestartup_script():
|
|||||||
|
|
||||||
for possible_module in possible_modules:
|
for possible_module in possible_modules:
|
||||||
module_path = os.path.join(custom_node_path, possible_module)
|
module_path = os.path.join(custom_node_path, possible_module)
|
||||||
|
|
||||||
|
if comfyui_manager.should_be_disabled(module_path):
|
||||||
|
continue
|
||||||
|
|
||||||
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
|
||||||
|
|
||||||
@ -98,6 +100,7 @@ def execute_prestartup_script():
|
|||||||
logging.info("")
|
logging.info("")
|
||||||
|
|
||||||
apply_custom_paths()
|
apply_custom_paths()
|
||||||
|
comfyui_manager.prestartup()
|
||||||
execute_prestartup_script()
|
execute_prestartup_script()
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
5
nodes.py
5
nodes.py
@ -37,6 +37,7 @@ import importlib
|
|||||||
import folder_paths
|
import folder_paths
|
||||||
import latent_preview
|
import latent_preview
|
||||||
import node_helpers
|
import node_helpers
|
||||||
|
import comfyui_manager
|
||||||
|
|
||||||
def before_node_execution():
|
def before_node_execution():
|
||||||
comfy.model_management.throw_exception_if_processing_interrupted()
|
comfy.model_management.throw_exception_if_processing_interrupted()
|
||||||
@ -2196,6 +2197,10 @@ def init_external_custom_nodes():
|
|||||||
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
|
||||||
|
if comfyui_manager.should_be_disabled(module_path):
|
||||||
|
logging.info(f"Blocked by policy: {module_path}")
|
||||||
|
continue
|
||||||
|
|
||||||
time_before = time.perf_counter()
|
time_before = time.perf_counter()
|
||||||
success = load_custom_node(module_path, base_node_names, module_parent="custom_nodes")
|
success = load_custom_node(module_path, base_node_names, module_parent="custom_nodes")
|
||||||
node_import_times.append((time.perf_counter() - time_before, module_path, success))
|
node_import_times.append((time.perf_counter() - time_before, module_path, success))
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user