From 6897a1d077e06e8147e55932fc880a5cd6ef8f13 Mon Sep 17 00:00:00 2001
From: "Dr.Lt.Data" <dr.lt.data@gmail.com>
Date: Wed, 19 Mar 2025 22:24:04 +0900
Subject: [PATCH 1/3] support pip comfyui-manager

---
 main.py  | 4 ++++
 nodes.py | 1 +
 2 files changed, 5 insertions(+)

diff --git a/main.py b/main.py
index 1b100fa8..16a13cf9 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 71d1b8dd..c0626952 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" <dr.lt.data@gmail.com>
Date: Thu, 10 Apr 2025 08:40:53 +0900
Subject: [PATCH 2/3] 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 62079e6a..52930652 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 16a13cf9..3ab31f41 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" <dr.lt.data@gmail.com>
Date: Thu, 10 Apr 2025 12:10:24 +0900
Subject: [PATCH 3/3] fixed: ruff check

---
 nodes.py | 1 -
 1 file changed, 1 deletion(-)

diff --git a/nodes.py b/nodes.py
index 0b62a9f7..f63e8cb5 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()