Merge branch 'dr-support-pip-cm'

This commit is contained in:
Dr.Lt.Data 2025-08-26 19:45:36 +09:00
commit eda556d7b4
5 changed files with 42 additions and 0 deletions

View File

@ -120,6 +120,12 @@ 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.")
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.")
@ -163,6 +169,7 @@ parser.add_argument("--multi-user", action="store_true", help="Enables per-user
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"

19
main.py
View File

@ -15,6 +15,13 @@ from comfy_execution.progress import get_progress_state
from comfy_execution.utils import get_executing_context
from comfy_api import feature_flags
if not args.disable_manager:
try:
import comfyui_manager
except Exception:
logging.warning(f"\n\nUnable to run comfyui-manager, disabling it. To enable comfyui-manager, run the following command:\ncommand:\n\t{sys.executable} -m pip install --pre comfyui_manager\n")
args.disable_manager = True
if __name__ == "__main__":
#NOTE: These do not do anything on core ComfyUI, they are for custom nodes.
os.environ['HF_HUB_DISABLE_TELEMETRY'] = '1'
@ -79,6 +86,11 @@ 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 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,6 +113,10 @@ def execute_prestartup_script():
logging.info("")
apply_custom_paths()
if not args.disable_manager:
comfyui_manager.prestartup()
execute_prestartup_script()
@ -312,6 +328,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()
asyncio_loop.run_until_complete(nodes.init_extra_nodes(
init_custom_nodes=(not args.disable_all_custom_nodes) or len(args.whitelist_custom_nodes) > 0,

View File

@ -43,6 +43,9 @@ import folder_paths
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()
@ -2226,6 +2229,12 @@ async 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 = await load_custom_node(module_path, base_node_names, module_parent="custom_nodes")
node_import_times.append((time.perf_counter() - time_before, module_path, success))

View File

@ -1,6 +1,7 @@
comfyui-frontend-package==1.25.10
comfyui-workflow-templates==0.1.65
comfyui-embedded-docs==0.2.6
comfyui_manager==4.0.0b13
torch
torchsde
torchvision

View File

@ -39,6 +39,9 @@ from typing import Optional, Union
from api_server.routes.internal.internal_routes import InternalRoutes
from protocol import BinaryEventTypes
if not args.disable_manager:
import comfyui_manager
async def send_socket_catch_exception(function, message):
try:
await function(message)
@ -173,6 +176,9 @@ class PromptServer():
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()