From 6897a1d077e06e8147e55932fc880a5cd6ef8f13 Mon Sep 17 00:00:00 2001 From: "Dr.Lt.Data" Date: Wed, 19 Mar 2025 22:24:04 +0900 Subject: [PATCH 1/4] support pip comfyui-manager --- main.py | 4 ++++ nodes.py | 1 + 2 files changed, 5 insertions(+) diff --git a/main.py b/main.py index 1b100fa8a..16a13cf97 100644 --- a/main.py +++ b/main.py @@ -10,6 +10,7 @@ from app.logger import setup_logger import itertools import utils.extra_config import logging +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. @@ -69,6 +70,8 @@ def execute_prestartup_script(): if args.disable_all_custom_nodes: return + comfyui_manager.prestartup() + node_paths = folder_paths.get_folder_paths("custom_nodes") for custom_node_path in node_paths: possible_modules = os.listdir(custom_node_path) @@ -261,6 +264,7 @@ def start_comfyui(asyncio_loop=None): prompt_server = server.PromptServer(asyncio_loop) q = execution.PromptQueue(prompt_server) + comfyui_manager.start() nodes.init_extra_nodes(init_custom_nodes=not args.disable_all_custom_nodes) cuda_malloc_warning() diff --git a/nodes.py b/nodes.py index 71d1b8dd7..c06269525 100644 --- a/nodes.py +++ b/nodes.py @@ -37,6 +37,7 @@ import importlib import folder_paths import latent_preview import node_helpers +import comfyui_manager def before_node_execution(): comfy.model_management.throw_exception_if_processing_interrupted() From fb1b9c76b02442f89e97302499b627d122ffd1c4 Mon Sep 17 00:00:00 2001 From: "Dr.Lt.Data" Date: Thu, 10 Apr 2025 08:40:53 +0900 Subject: [PATCH 2/4] added: --disable-manager option --- comfy/cli_args.py | 1 + main.py | 4 +++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/comfy/cli_args.py b/comfy/cli_args.py index 62079e6a7..52930652b 100644 --- a/comfy/cli_args.py +++ b/comfy/cli_args.py @@ -49,6 +49,7 @@ parser.add_argument("--temp-directory", type=str, default=None, help="Set the Co parser.add_argument("--input-directory", type=str, default=None, help="Set the ComfyUI input directory. Overrides --base-directory.") parser.add_argument("--auto-launch", action="store_true", help="Automatically launch ComfyUI in the default browser.") parser.add_argument("--disable-auto-launch", action="store_true", help="Disable auto launching the browser.") +parser.add_argument("--disable-manager", action="store_true", help="Disable ComfyUI-Manager feature.") parser.add_argument("--cuda-device", type=int, default=None, metavar="DEVICE_ID", help="Set the id of the cuda device this instance will use.") cm_group = parser.add_mutually_exclusive_group() cm_group.add_argument("--cuda-malloc", action="store_true", help="Enable cudaMallocAsync (enabled by default for torch 2.0 and up).") diff --git a/main.py b/main.py index 16a13cf97..3ab31f414 100644 --- a/main.py +++ b/main.py @@ -264,7 +264,9 @@ def start_comfyui(asyncio_loop=None): prompt_server = server.PromptServer(asyncio_loop) q = execution.PromptQueue(prompt_server) - comfyui_manager.start() + if not args.disable_manager: + comfyui_manager.start() + nodes.init_extra_nodes(init_custom_nodes=not args.disable_all_custom_nodes) cuda_malloc_warning() From 8b9f31abdfed38b199db9ff9bcc33b55fb6d5958 Mon Sep 17 00:00:00 2001 From: "Dr.Lt.Data" Date: Thu, 10 Apr 2025 12:10:24 +0900 Subject: [PATCH 3/4] fixed: ruff check --- nodes.py | 1 - 1 file changed, 1 deletion(-) diff --git a/nodes.py b/nodes.py index 0b62a9f70..f63e8cb5e 100644 --- a/nodes.py +++ b/nodes.py @@ -37,7 +37,6 @@ import importlib import folder_paths import latent_preview import node_helpers -import comfyui_manager def before_node_execution(): comfy.model_management.throw_exception_if_processing_interrupted() From cc975e5f0b141fac0e3548d058d36260183a7814 Mon Sep 17 00:00:00 2001 From: "Dr.Lt.Data" Date: Sat, 12 Apr 2025 19:11:02 +0900 Subject: [PATCH 4/4] add comfyui_manager to requirements.txt It's still in the development stage, so the version is not pinned yet. --- requirements.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/requirements.txt b/requirements.txt index 851db23bd..310ab57ba 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,4 +1,5 @@ comfyui-frontend-package==1.15.13 +comfyui_manager torch torchsde torchvision