From e7ff647d0230cea3cffa7449ee5d353e75625467 Mon Sep 17 00:00:00 2001 From: comfyanonymous Date: Wed, 17 Sep 2025 20:58:42 -0400 Subject: [PATCH] --disable-manager -> --enable-manager --- comfy/cli_args.py | 2 +- main.py | 24 ++++++++++++------------ nodes.py | 4 ++-- server.py | 4 ++-- 4 files changed, 17 insertions(+), 17 deletions(-) diff --git a/comfy/cli_args.py b/comfy/cli_args.py index 9cc6b712f..f062d9734 100644 --- a/comfy/cli_args.py +++ b/comfy/cli_args.py @@ -120,8 +120,8 @@ upcast.add_argument("--force-upcast-attention", action="store_true", help="Force upcast.add_argument("--dont-upcast-attention", action="store_true", help="Disable all upcasting of attention. Should be unnecessary except for debugging.") +parser.add_argument("--enable-manager", action="store_true", help="Enable the ComfyUI-Manager feature.") manager_group = parser.add_mutually_exclusive_group() -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") diff --git a/main.py b/main.py index 341b26717..df83f0800 100644 --- a/main.py +++ b/main.py @@ -16,12 +16,19 @@ from comfy_execution.utils import get_executing_context from comfy_api import feature_flags +if __name__ == "__main__": + #NOTE: These do not do anything on core ComfyUI, they are for custom nodes. + os.environ['HF_HUB_DISABLE_TELEMETRY'] = '1' + os.environ['DO_NOT_TRACK'] = '1' + +setup_logger(log_level=args.verbose, use_stdout=args.log_stdout) + + def handle_comfyui_manager_unavailable(): logging.warning(f"\n\nYou appear to be running comfyui-manager from source, this is not recommended. Please install comfyui-manager using the following command:\ncommand:\n\t{sys.executable} -m pip install --pre comfyui_manager\n") - args.disable_manager = True -if not args.disable_manager: +if args.enable_manager: if importlib.util.find_spec("comfyui_manager"): import comfyui_manager @@ -31,13 +38,6 @@ if not args.disable_manager: handle_comfyui_manager_unavailable() -if __name__ == "__main__": - #NOTE: These do not do anything on core ComfyUI, they are for custom nodes. - os.environ['HF_HUB_DISABLE_TELEMETRY'] = '1' - os.environ['DO_NOT_TRACK'] = '1' - -setup_logger(log_level=args.verbose, use_stdout=args.log_stdout) - def apply_custom_paths(): # extra model paths extra_model_paths_config_path = os.path.join(os.path.dirname(os.path.realpath(__file__)), "extra_model_paths.yaml") @@ -96,7 +96,7 @@ def execute_prestartup_script(): for possible_module in possible_modules: module_path = os.path.join(custom_node_path, possible_module) - if not args.disable_manager: + if args.enable_manager: if comfyui_manager.should_be_disabled(module_path): continue @@ -123,7 +123,7 @@ def execute_prestartup_script(): apply_custom_paths() -if not args.disable_manager: +if args.enable_manager: comfyui_manager.prestartup() execute_prestartup_script() @@ -337,7 +337,7 @@ def start_comfyui(asyncio_loop=None): asyncio.set_event_loop(asyncio_loop) prompt_server = server.PromptServer(asyncio_loop) - if not args.disable_manager and not args.disable_manager_ui: + if args.enable_manager and not args.disable_manager_ui: comfyui_manager.start() hook_breaker_ac10a0.save_functions() diff --git a/nodes.py b/nodes.py index 9bd3b4dcf..ca15fb9cd 100644 --- a/nodes.py +++ b/nodes.py @@ -43,7 +43,7 @@ import folder_paths import latent_preview import node_helpers -if not args.disable_manager: +if args.enable_manager: import comfyui_manager def before_node_execution(): @@ -2234,7 +2234,7 @@ async def init_external_custom_nodes(): logging.info(f"Skipping {possible_module} due to disable_all_custom_nodes and whitelist_custom_nodes") continue - if not args.disable_manager: + if args.enable_manager: if comfyui_manager.should_be_disabled(module_path): logging.info(f"Blocked by policy: {module_path}") continue diff --git a/server.py b/server.py index df6138639..46b105268 100644 --- a/server.py +++ b/server.py @@ -42,7 +42,7 @@ from protocol import BinaryEventTypes # Import cache control middleware from middleware.cache_middleware import cache_control -if not args.disable_manager: +if args.enable_manager: import comfyui_manager async def send_socket_catch_exception(function, message): @@ -171,7 +171,7 @@ class PromptServer(): else: middlewares.append(create_origin_only_middleware()) - if not args.disable_manager: + if args.enable_manager: middlewares.append(comfyui_manager.create_middleware()) max_upload_size = round(args.max_upload_size * 1024 * 1024)