modified: --disable-manager will prevent importing comfyui-manager

feat: --disable-manager-ui will disable the endpoints and ui of comfyui-manager
This commit is contained in:
Dr.Lt.Data 2025-04-28 17:56:50 +09:00
parent ea3d3cc6a4
commit 57dae1469f
3 changed files with 21 additions and 10 deletions

View File

@ -119,7 +119,8 @@ upcast.add_argument("--dont-upcast-attention", action="store_true", help="Disabl
manager_group = parser.add_mutually_exclusive_group()
manager_group.add_argument("--disable-manager", action="store_true", help="Disable ComfyUI-Manager feature.")
manager_group.add_argument("--disable-manager", action="store_true", help="Completely disable the ComfyUI-Manager feature.")
manager_group.add_argument("--disable-manager-ui", action="store_true", help="Disables only the ComfyUI-Manager UI and endpoints. Scheduled installations and similar background tasks will still operate.")
manager_group.add_argument("--enable-manager-legacy-ui", action="store_true", help="Enables the legacy UI of ComfyUI-Manager")

16
main.py
View File

@ -11,7 +11,9 @@ import itertools
import utils.extra_config
import logging
import sys
import comfyui_manager
if not args.disable_manager:
import comfyui_manager
if __name__ == "__main__":
#NOTE: These do not do anything on core ComfyUI which should already have no communication with the internet, they are for custom nodes.
@ -79,8 +81,9 @@ def execute_prestartup_script():
for possible_module in possible_modules:
module_path = os.path.join(custom_node_path, possible_module)
if comfyui_manager.should_be_disabled(module_path):
continue
if not args.disable_manager:
if comfyui_manager.should_be_disabled(module_path):
continue
if os.path.isfile(module_path) or module_path.endswith(".disabled") or module_path == "__pycache__":
continue
@ -101,7 +104,10 @@ def execute_prestartup_script():
logging.info("")
apply_custom_paths()
comfyui_manager.prestartup()
if not args.disable_manager:
comfyui_manager.prestartup()
execute_prestartup_script()
@ -274,7 +280,7 @@ def start_comfyui(asyncio_loop=None):
prompt_server = server.PromptServer(asyncio_loop)
q = execution.PromptQueue(prompt_server)
if not args.disable_manager:
if not args.disable_manager and not args.disable_manager_ui:
comfyui_manager.start()
nodes.init_extra_nodes(init_custom_nodes=not args.disable_all_custom_nodes)

View File

@ -37,7 +37,9 @@ import importlib
import folder_paths
import latent_preview
import node_helpers
import comfyui_manager
if not args.disable_manager:
import comfyui_manager
def before_node_execution():
comfy.model_management.throw_exception_if_processing_interrupted()
@ -2173,9 +2175,11 @@ def init_external_custom_nodes():
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 module_path.endswith(".disabled"): continue
if comfyui_manager.should_be_disabled(module_path):
logging.info(f"Blocked by policy: {module_path}")
continue
if not args.disable_manager:
if comfyui_manager.should_be_disabled(module_path):
logging.info(f"Blocked by policy: {module_path}")
continue
time_before = time.perf_counter()
success = load_custom_node(module_path, base_node_names, module_parent="custom_nodes")