Comfy-Org/comfy-cli

CLI for using ComfyUI

comfy‑cli – Command‑line manager for ComfyUI

What it is

  • A Python‑based CLI that automates the whole lifecycle of ComfyUI, an open‑source generative‑media engine (image/video diffusion models). It can install ComfyUI, pull in custom nodes, download models, launch the server, run workflows, and even submit jobs to the hosted Comfy Cloud service.

Key capabilities

Feature What it does
One‑command install & launch comfy install (or comfy setup) downloads ComfyUI + the official manager and gets you running with a single command.
Cloud execution comfy run … --where cloud sends any API‑format workflow to Comfy Cloud, returns a prompt_id, and lets you poll or download results later.
Direct generation comfy generate calls partner image/video models (Flux, DALL·E, Stability, etc.) without writing a JSON workflow.
Custom‑node management Install, update, snapshot, bisect, or bulk‑update nodes via comfy node …. Supports both the standard ComfyUI‑Manager flow and a registry‑direct flow.
Fast dependency resolution --fast-deps or --uv-compile uses the uv resolver to compile a single lockfile for all nodes, dramatically speeding up installs.
Model fetching Pull models from CivitAI, Hugging Face, or arbitrary URLs with a single command.
Cross‑platform Works on Windows, macOS, and Linux; can run inside Docker or a virtualenv.
Agent‑friendly output --json flag wraps every response in a structured envelope, making it easy for LLM agents (Claude, Cursor, etc.) to drive the tool.
Shell completion comfy --install-completion adds tab‑completion for Bash/Zsh/Fish.
Background server management comfy launch --background starts a detached ComfyUI instance that can be listed/stopped via comfy env / comfy stop.
PR testing & caching comfy launch --frontend-pr … or comfy install --pr … lets you spin up a UI or backend from a GitHub pull request, with automatic cache cleanup.

Typical workflow

  1. Install – pip install comfy-cli && comfy setup (interactive wizard) or comfy install -y for CI.
  2. Add nodes / models – comfy node install comfyui-impact-pack or comfy node registry-install …; comfy model download <url>.
  3. Run locally – comfy launch (optionally --background).
  4. Run a workflow – comfy run --workflow my.json (local) or add --where cloud to offload to the hosted service.
  5. Monitor / retrieve – comfy jobs wait <id>, comfy download <id> -o ./out.
  6. Update – comfy update all (core + nodes) or comfy update comfy --version latest.

Why it matters

  • Reduces friction: Setting up ComfyUI manually involves cloning the repo, installing a Python environment, handling GPU‑specific PyTorch wheels, and manually pulling custom nodes. comfy‑cli bundles all those steps.
  • Makes cloud‑first pipelines easy: Users without a GPU can still run heavy diffusion models by routing to Comfy Cloud with a single flag.
  • Facilitates automation: The JSON envelope and deterministic exit codes let CI pipelines or LLM‑driven agents script installations, updates, and job submissions reliably.
  • Unified dependency handling: By leveraging uv and the manager’s unified resolver, version conflicts across many custom nodes are detected early, saving time.

Installation

# Recommended: inside a virtualenv or conda env
pip install comfy-cli   # Python ≥3.10
# Optional: enable tab‑completion
comfy --install-completion

Getting help

  • comfy --help – top‑level command list.
  • comfy <subcommand> --help – detailed options for each action.
  • comfy which – shows which workspace the CLI will act on.
  • comfy env – shows the current environment, background servers, and cloud status.

License & community

  • Distributed under the MIT license.
  • Actively maintained by the Comfy‑Org team; CI badges show test coverage and PyPI releases.

All information above is taken directly from the project's README; no external assumptions have been added.

Related

  • Project
  • Project
  • Project
  • Project
  • Project