Skip to content

feat: Support ComfyUI-Manager for pip version #7555

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 36 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
36 commits
Select commit Hold shift + click to select a range
6897a1d
support pip comfyui-manager
ltdrdata Mar 19, 2025
1855efe
Merge branch 'comfyanonymous:master' into dr-support-pip-cm
ltdrdata Apr 5, 2025
545d96c
Merge branch 'master' into dr-support-pip-cm
ltdrdata Apr 9, 2025
fb1b9c7
added: --disable-manager option
ltdrdata Apr 9, 2025
8b9f31a
fixed: ruff check
ltdrdata Apr 10, 2025
311f64a
Merge branch 'master' into dr-support-pip-cm
ltdrdata Apr 12, 2025
cc975e5
add comfyui_manager to requirements.txt
ltdrdata Apr 12, 2025
418eaed
fixed: Ensure that `comfyui_manager`'s prestartup always runs, even w…
ltdrdata Apr 12, 2025
94f61c6
add --enable-manager-legacy-ui
ltdrdata Apr 14, 2025
d2ed1dc
Merge branch 'master' into dr-support-pip-cm
ltdrdata Apr 15, 2025
4fafc0c
Merge branch 'master' into dr-support-pip-cm
ltdrdata Apr 20, 2025
ec82eea
Merge branch 'master' into dr-support-pip-cm
ltdrdata Apr 21, 2025
9c2eb2c
Merge branch 'master' into dr-support-pip-cm
ltdrdata Apr 21, 2025
ea3d3cc
Merge branch 'master' into dr-support-pip-cm
ltdrdata Apr 23, 2025
57dae14
modified: --disable-manager will prevent importing comfyui-manager
ltdrdata Apr 28, 2025
14598c1
Merge branch 'master' into dr-support-pip-cm
ltdrdata Apr 28, 2025
f51047a
Merge branch 'master' into dr-support-pip-cm
ltdrdata Apr 30, 2025
28d23a7
Merge branch 'master' into dr-support-pip-cm
ltdrdata May 3, 2025
31aecbe
Merge branch 'master' into dr-support-pip-cm
ltdrdata May 8, 2025
b69ef5f
Merge branch 'master' into dr-support-pip-cm
ltdrdata May 10, 2025
9ac1854
Merge branch 'master' into dr-support-pip-cm
ltdrdata May 18, 2025
ef641f3
Merge branch 'master' into dr-support-pip-cm
ltdrdata May 25, 2025
baeeeb0
Merge branch 'master' into dr-support-pip-cm
ltdrdata May 31, 2025
35a2944
Merge branch 'master' into dr-support-pip-cm
ltdrdata Jun 9, 2025
d1ab6ad
Merge branch 'master' into dr-support-pip-cm
ltdrdata Jun 15, 2025
4e95c0c
Merge branch 'master' into dr-support-pip-cm
ltdrdata Jun 20, 2025
39f39c3
Merge branch 'master' into dr-support-pip-cm
ltdrdata Jun 21, 2025
5a0ec18
Merge branch 'master' into dr-support-pip-cm
ltdrdata Jun 22, 2025
364e07d
Merge branch 'master' into dr-support-pip-cm
ltdrdata Jun 24, 2025
d5167d2
Merge branch 'master' into dr-support-pip-cm
ltdrdata Jun 25, 2025
8744ebb
Merge branch 'master' into dr-support-pip-cm
ltdrdata Jun 26, 2025
f398256
Merge branch 'master' into dr-support-pip-cm
ltdrdata Jun 28, 2025
9eba154
Merge branch 'master' into dr-support-pip-cm
ltdrdata Jun 29, 2025
ad633b2
Merge branch 'master' into dr-support-pip-cm
ltdrdata Jul 1, 2025
17cfabe
added: Apply manager middleware
ltdrdata Jul 1, 2025
d6fa7a7
Merge branch 'master' into dr-support-pip-cm
ltdrdata Jul 2, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions comfy/cli_args.py
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,12 @@ class LatentPreviewMethod(enum.Enum):
upcast.add_argument("--dont-upcast-attention", action="store_true", help="Disable all upcasting of attention. Should be unnecessary except for debugging.")


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")


vram_group = parser.add_mutually_exclusive_group()
vram_group.add_argument("--gpu-only", action="store_true", help="Store and run everything (text encoders/CLIP models, etc... on the GPU).")
vram_group.add_argument("--highvram", action="store_true", help="By default models will be unloaded to CPU memory after being used. This option keeps them in GPU memory.")
Expand Down Expand Up @@ -159,6 +165,7 @@ class PerformanceFeature(enum.Enum):
parser.add_argument("--verbose", default='INFO', const='DEBUG', nargs="?", choices=['DEBUG', 'INFO', 'WARNING', 'ERROR', 'CRITICAL'], help='Set the logging level')
parser.add_argument("--log-stdout", action="store_true", help="Send normal process output to stdout instead of stderr (default).")


# The default built-in provider hosted under web/
DEFAULT_VERSION_STRING = "comfyanonymous/ComfyUI@latest"

Expand Down
155 changes: 0 additions & 155 deletions custom_nodes/example_node.py.example

This file was deleted.

44 changes: 0 additions & 44 deletions custom_nodes/websocket_image_save.py

This file was deleted.

15 changes: 15 additions & 0 deletions main.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@
import logging
import sys

if not args.disable_manager:
import comfyui_manager

if __name__ == "__main__":
#NOTE: These do not do anything on core ComfyUI, they are for custom nodes.
os.environ['HF_HUB_DISABLE_TELEMETRY'] = '1'
Expand Down Expand Up @@ -76,6 +79,11 @@ def execute_script(script_path):

for possible_module in possible_modules:
module_path = os.path.join(custom_node_path, possible_module)

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

Expand All @@ -98,6 +106,10 @@ def execute_script(script_path):
logging.info("")

apply_custom_paths()

if not args.disable_manager:
comfyui_manager.prestartup()

execute_prestartup_script()


Expand Down Expand Up @@ -278,6 +290,9 @@ 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:
comfyui_manager.start()

hook_breaker_ac10a0.save_functions()
nodes.init_extra_nodes(
init_custom_nodes=(not args.disable_all_custom_nodes) or len(args.whitelist_custom_nodes) > 0,
Expand Down
9 changes: 9 additions & 0 deletions nodes.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,9 @@
import latent_preview
import node_helpers

if not args.disable_manager:
import comfyui_manager

def before_node_execution():
comfy.model_management.throw_exception_if_processing_interrupted()

Expand Down Expand Up @@ -2190,6 +2193,12 @@ def init_external_custom_nodes():
if args.disable_all_custom_nodes and possible_module not in args.whitelist_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 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")
node_import_times.append((time.perf_counter() - time_before, module_path, success))
Expand Down
1 change: 1 addition & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
comfyui-frontend-package==1.23.4
comfyui-workflow-templates==0.1.31
comfyui-embedded-docs==0.2.3
comfyui_manager
torch
torchsde
torchvision
Expand Down
6 changes: 6 additions & 0 deletions server.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,9 @@
from typing import Optional, Union
from api_server.routes.internal.internal_routes import InternalRoutes

if not args.disable_manager:
import comfyui_manager

class BinaryEventTypes:
PREVIEW_IMAGE = 1
UNENCODED_PREVIEW_IMAGE = 2
Expand Down Expand Up @@ -175,6 +178,9 @@ def __init__(self, loop):
else:
middlewares.append(create_origin_only_middleware())

if not args.disable_manager:
middlewares.append(comfyui_manager.create_middleware())

max_upload_size = round(args.max_upload_size * 1024 * 1024)
self.app = web.Application(client_max_size=max_upload_size, middlewares=middlewares)
self.sockets = dict()
Expand Down
Loading