Skip to content

feat(node): support --fast-deps on restore-snapshot (BE-4276) - #589

Open
mattmillerai wants to merge 1 commit into
mainfrom
matt/be-4276-fast-deps-restore-snapshot
Open

feat(node): support --fast-deps on restore-snapshot (BE-4276)#589
mattmillerai wants to merge 1 commit into
mainfrom
matt/be-4276-fast-deps-restore-snapshot

Conversation

@mattmillerai

Copy link
Copy Markdown
Collaborator

ELI-5

comfy install --fast-deps uses the fast uv installer, but restoring a
snapshot with many custom nodes had no equivalent — so it stayed slow. This adds
a --fast-deps flag to comfy node restore-snapshot so the restore also uses
the fast uv dependency install. Requested in issue #217.

comfy node restore-snapshot snapshot.json --fast-deps

What changed

  • New --fast-deps option on comfy node restore-snapshot.
  • When set, the restore forwards the uv-compile fast path to cm_cli.
  • Default (flag omitted) behavior is byte-for-byte unchanged.
  • Contradictory --fast-deps --no-uv-compile is rejected with a clear error.

Why it maps to --uv-compile (the interesting bit / AC #3)

comfy-cli has two uv-based fast paths:

  1. --fast-deps (install/reinstall): pass --no-deps to cm_cli, then run
    comfy-cli's own DependencyCompiler.
  2. --uv-compile: pass --uv-compile to cm_cli, which batch-resolves with uv.

I verified against ComfyUI-Manager's actual cm_cli v4 source
(cm_cli/__main__.py, manager-v4 branch): its restore-snapshot subcommand
accepts --uv-compile but does not accept --no-deps (only
install/reinstall/fix/update accept --no-deps). So path (1) is
genuinely unavailable upstream for snapshot restore — passing --no-deps
would make cm_cli error out.

The fast uv install that restore-snapshot does support is --uv-compile,
which internally does cmd_ctx.set_no_deps(True) + a batch uv resolve — i.e. it
already is the fast-deps equivalent. So --fast-deps forwards that path rather
than being silently ignored. On a ComfyUI-Manager older than v4.1 (no
--uv-compile on restore-snapshot), cm_cli surfaces its own "no such option"
error — same contract as the pre-existing --uv-compile flag.

Acceptance criteria

  • restore-snapshot <file> --fast-deps accepts the flag and forwards the
    uv/fast path.
  • Restore uses the fast (uv) dependency install when --fast-deps is set;
    default behavior unchanged when omitted.
  • cm_cli honors it (v4.1+); never silently ignored, and the upstream
    limitation (no --no-deps on restore-snapshot) is documented above.

Judgment calls

  • restore-dependencies has the identical uv plumbing and could gain the
    same alias, but issue Add "--fast-deps" (using uv) flag to restore snapshot functionality #217 and the ticket scope this to restore-snapshot
    only — left as an easy follow-up rather than expanding scope.
  • --fast-deps maps to the --uv-compile mechanism here (not the
    DependencyCompiler mechanism it uses for install), because that is the only
    fast uv path cm_cli exposes for snapshot restore. The help text says so.

Testing

  • New tests/comfy_cli/command/nodes/test_restore_snapshot_fast_deps.py (5 tests):
    flag forwards uv_compile=True, default omitted stays False, --uv-compile
    still works, --fast-deps --no-uv-compile is rejected, pip extras compose.
  • Full tests/comfy_cli/command + cm_cli suites: 1282 passed, 2 skipped.
  • ruff check + ruff format --diff: clean.

Add a --fast-deps flag to `comfy node restore-snapshot`, mirroring the
`comfy install --fast-deps` UX requested in issue #217.

cm_cli's `restore-snapshot` subcommand accepts --uv-compile but NOT
--no-deps (unlike install/reinstall), so the DependencyCompiler-based
fast path is unavailable there. The fast uv dependency install that
restore-snapshot *does* support is --uv-compile (it sets no-deps and
batch-resolves with uv internally), so --fast-deps forwards that path.
Default behavior is unchanged when the flag is omitted.
@mattmillerai mattmillerai added the agent-coded PR authored by the agent-work loop label Jul 24, 2026
@mattmillerai
mattmillerai marked this pull request as ready for review July 24, 2026 05:36
@coderabbitai

coderabbitai Bot commented Jul 24, 2026

Copy link
Copy Markdown

Warning

Review limit reached

You’ve reached a temporary PR review limit under our Fair Usage Limits Policy.

Your recent review volume is higher than typical usage, so adaptive limits are currently applied.

Next review available in: 22 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: 79734548-caa2-4cfc-a742-50b577ffd619

📥 Commits

Reviewing files that changed from the base of the PR and between 85b62da and e53a18e.

📒 Files selected for processing (2)
  • comfy_cli/command/custom_nodes/command.py
  • tests/comfy_cli/command/nodes/test_restore_snapshot_fast_deps.py
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch matt/be-4276-fast-deps-restore-snapshot
✨ Simplify code
  • Create PR with simplified code
  • Commit simplified code in branch matt/be-4276-fast-deps-restore-snapshot

Comment @coderabbitai help to get the list of available commands.

@dosubot dosubot Bot added size:S This PR changes 10-29 lines, ignoring generated files. enhancement New feature or request labels Jul 24, 2026
@mattmillerai mattmillerai added the cursor-review Request Cursor bot review label Jul 24, 2026

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔍 Cursor Review — Consolidated panel

Triggered by @mattmillerai.

✅ No high-signal findings.

Panel: 6/8 reviewers contributed findings.

Reviewers that did not contribute: kimi-k2.5:adversarial (empty), kimi-k2.5:edge-case (empty)

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

Labels

agent-coded PR authored by the agent-work loop cursor-review Request Cursor bot review enhancement New feature or request size:S This PR changes 10-29 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant