Skip to content

feat: add ComfyUI-Manager v4 support and uv-compile unified dependency resolution#363

Open
ltdrdata wants to merge 2 commits intomainfrom
feat/support-manager-v4
Open

feat: add ComfyUI-Manager v4 support and uv-compile unified dependency resolution#363
ltdrdata wants to merge 2 commits intomainfrom
feat/support-manager-v4

Conversation

@ltdrdata
Copy link
Member

@ltdrdata ltdrdata commented Jan 28, 2026

Summary

ComfyUI-Manager v4 is now installed as a pip package (via manager_requirements.txt) rather than being git-cloned into custom_nodes/.

Breaking Changes

  • Remove --manager-url and --manager-commit options from install command
  • validate_comfyui_manager() now uses find_cm_cli() instead of git path check

Manager Subcommand Changes

Command Description
comfy manager disable Disable manager completely (no flags passed)
comfy manager enable-gui Enable manager with new GUI
comfy manager disable-gui Enable manager but disable GUI only
comfy manager enable-legacy-gui Enable manager with legacy GUI
comfy manager migrate-legacy Migrate git-cloned manager to pip package
comfy manager uv-compile-default Set default for --uv-compile flag

--uv-compile Unified Dependency Resolution

Adds --uv-compile/--no-uv-compile flag to 7 custom node commands for Manager v4.1+ unified dependency resolution via uv pip compile.

Commands with --uv-compile:
install, reinstall, update, fix, restore-snapshot, restore-dependencies, install-deps

Standalone command: comfy node uv-sync — batch-resolve all installed custom node dependencies.

Flag resolution priority: explicit flag → config default (comfy manager uv-compile-default) → disabled

Mutual exclusivity: --uv-compile cannot be used with --fast-deps or --no-deps.

Pass-through pattern:

if uv_compile:
    cmd += ["--uv-compile"]
elif fast_deps or no_deps:
    cmd += ["--no-deps"]

Cache Management

comfy node update-cache — force-fetch remote data and populate local Manager cache (blocking). Wraps cm_cli update-cache (requires Manager v4.1b5+).

E2E test fixtures call update-cache after workspace installation to ensure node listings are fully populated before any test operations. This fixes test reliability issues where an empty cache caused comfy node show all to miss nodes or return inconsistent ID formats.

Implementation Details

  • find_cm_cli() uses importlib.util.find_spec("cm_cli") with @lru_cache
  • execute_cm_cli() uses module-based execution via resolve_workspace_python() + python -m cm_cli
  • _get_manager_flags() injects --enable-manager flags based on config mode
  • resolve_manager_gui_mode() shared helper for legacy config migration (handles bool strings)
  • _resolve_uv_compile() implements tri-state (bool | None) flag with config default priority
  • pip_install_manager() replaces git-clone based installation with pip-based manager_requirements.txt
  • comfy env displays Manager status and UV Compile Default
  • Launch automatically detects cm-cli availability and skips manager flags if unavailable
  • Error handler in execute_cm_cli forwards cm_cli stdout/stderr on failure

Reviewer Guide

Recommended review order by logical group:

1. Core infrastructure (review first)

File Changes Key points
constants.py New config keys MANAGER_REQUIREMENTS_FILE, CONFIG_KEY_MANAGER_GUI_MODE, CONFIG_KEY_UV_COMPILE_DEFAULT
cm_cli_util.py find_cm_cli(), execute_cm_cli(), resolve_manager_gui_mode() Module-based cm-cli detection and execution; uses resolve_workspace_python()
install.py pip_install_manager() replaces git-clone Now uses manager_requirements.txt; accepts python param for workspace Python

2. Command layer

File Changes Key points
command.py _resolve_uv_compile(), 7 commands with --uv-compile, manager subcommands, update-cache Tri-state flag resolution, mutual exclusivity validation, blocking cache population
cmdline.py Remove --manager-url/--manager-commit Breaking change: git-clone options removed

3. Launch integration

File Changes Key points
launch.py _get_manager_flags() Config-driven manager flag injection at launch
workspace_manager.py Manager status display in comfy env Shows Manager mode and UV Compile Default

4. Tests (bulk of the diff)

File Tests Coverage
test_manager_gui.py 69 tests Manager commands, launch flags, display, legacy migration
test_cm_cli_util.py 28 tests execute_cm_cli error paths, find_cm_cli caching, resolve_manager_gui_mode
test_node_install.py 35 tests uv-compile pass-through, mutual exclusivity, all node commands
test_e2e_uv_compile.py 12 E2E tests Real pack install, progressive conflict, config default

Test plan

Reference: Comfy-Org/ComfyUI#12140

@dosubot dosubot bot added size:XXL This PR changes 1000+ lines, ignoring generated files. enhancement New feature or request labels Jan 28, 2026
@ltdrdata ltdrdata requested a review from bigcat88 January 28, 2026 17:34
@codecov
Copy link

codecov bot commented Jan 28, 2026

Codecov Report

❌ Patch coverage is 91.90141% with 23 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
comfy_cli/command/install.py 70.00% 12 Missing ⚠️
comfy_cli/command/custom_nodes/cm_cli_util.py 90.00% 5 Missing ⚠️
comfy_cli/command/custom_nodes/command.py 97.45% 4 Missing ⚠️
comfy_cli/workspace_manager.py 86.66% 2 Missing ⚠️
@@            Coverage Diff             @@
##             main     #363      +/-   ##
==========================================
+ Coverage   63.44%   67.50%   +4.06%     
==========================================
  Files          33       33              
  Lines        3699     3915     +216     
==========================================
+ Hits         2347     2643     +296     
+ Misses       1352     1272      -80     
Files with missing lines Coverage Δ
comfy_cli/cmdline.py 58.00% <ø> (ø)
comfy_cli/command/launch.py 42.33% <100.00%> (+7.15%) ⬆️
comfy_cli/constants.py 100.00% <100.00%> (ø)
comfy_cli/workspace_manager.py 73.25% <86.66%> (+3.84%) ⬆️
comfy_cli/command/custom_nodes/command.py 79.65% <97.45%> (+22.28%) ⬆️
comfy_cli/command/custom_nodes/cm_cli_util.py 94.39% <90.00%> (+3.76%) ⬆️
comfy_cli/command/install.py 75.19% <70.00%> (+2.44%) ⬆️

... and 1 file with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@ltdrdata ltdrdata force-pushed the feat/support-manager-v4 branch 3 times, most recently from c29f340 to b7d0a07 Compare January 28, 2026 17:45
@bigcat88
Copy link
Contributor

@ltdrdata hello! is this PR is ready to be reviewed? (sorry, I completely forgot about this PR)

@ltdrdata
Copy link
Member Author

Oh… additional updates to support uv-compile are currently in progress. Since the changes are fairly extensive, I’m also validating them more thoroughly. Please wait a bit longer.

@ltdrdata ltdrdata force-pushed the feat/support-manager-v4 branch from e8a78ce to a4212d6 Compare March 14, 2026 04:06
@ltdrdata ltdrdata force-pushed the feat/support-manager-v4 branch from 8b55247 to 73e3aea Compare March 14, 2026 10:15
@ltdrdata ltdrdata changed the title feat(manager): add ComfyUI-Manager v4 support feat: add ComfyUI-Manager v4 support and uv-compile unified dependency resolution Mar 14, 2026
Manager v4 is now installed as a pip package (via manager_requirements.txt)
instead of being git-cloned into custom_nodes/.

- Add manager subcommands: disable, enable-gui, disable-gui,
  enable-legacy-gui, migrate-legacy, uv-compile-default
- Add --uv-compile/--no-uv-compile flag to 7 node commands
- Add standalone `comfy node uv-sync` for batch dependency resolution
- Add `comfy node update-cache` for blocking Manager cache population
- Remove --manager-url and --manager-commit install options
- Launch auto-detects cm-cli availability and skips manager flags
  if unavailable
@ltdrdata ltdrdata force-pushed the feat/support-manager-v4 branch from 73e3aea to a655999 Compare March 15, 2026 01:14
@ltdrdata
Copy link
Member Author

For the E2E tests to function correctly, the update-cache feature introduced in 4.1b5 is required, so the following PR needs to be merged.

Comfy-Org/ComfyUI#12957

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request size:XXL This PR changes 1000+ lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants