Overview
comfy-cli is a command line tool that streamlines installation and management of Comfy, and gives you scriptable, single-command access to the entire ComfyUI ecosystem locally or in the cloud.
It serves three primary functions:
- Manage a local ComfyUI installation — install, launch, update, snapshot, and bisect ComfyUI and custom nodes.
- Access hosted partner nodes — generate images, video, audio, and 3D from providers including Seedance, Nano Banana (Gemini), Grok, Flux, Ideogram, DALL·E, Recraft, Stability, Kling, Luma, Runway, Pika, Vidu, Hailuo, Moonvalley, and others with single commands.
- Run full workflows on Comfy Cloud — submit workflow graphs, browse the curated template gallery, slot-edit workflows, and watch jobs to completion without a local GPU.
Two surfaces, one CLI. Every command auto-detects where to run. If you are signed in to Comfy Cloud, commands route to cloud; otherwise they run against your local server. Override per call with
--where local|cloud, the COMFY_WHERE env var, or persist it with comfy set-default --where cloud.Install CLI
Quick Setup (Recommended)
New in recent versions: a single interactive wizard that handles routing, auth, and agent skills in one step.Non-interactive (CI only). Browser OAuth needs an interactive session. For CI, devcontainers, and scripted installs where no browser is available, pass an API key instead:
| Flag | Purpose |
|---|---|
--where local|cloud | Routing target; skips the prompt |
--project-dir | Directory for workflows, inputs, and outputs |
--api-key | (Optional) Comfy Cloud API key for headless/CI; implies --where cloud |
-y, --non-interactive | No prompts. Drive everything from flags |
--skip-skills | Do not install agent skills |
--skip-verify | Skip the connectivity check |
Install ComfyUI (Local)
Create a virtual environment with any Python version greater than 3.9.Run ComfyUI (Local)
Comfy Cloud
Run workflows and partner nodes on Comfy’s hosted GPUs. No local install required.API key is optional. You only need an API key for headless or CI use where a browser sign-in is not possible. It is a fallback, not the default:
Session lifetime. Cloud session tokens are short-lived (~1h). The CLI auto-refreshes them on demand. If a command reports
cloud_unauthorized, run comfy cloud login again.Generate with Partner Nodes
comfy generate is in beta. Flag names, model aliases, and output formats may change. The underlying partner endpoints are stable. File feedback on the comfy-cli GitHub repo.Prerequisites
- An active Comfy Cloud session via
comfy cloud login(browser OAuth), or a Comfy API key (--api-key/COMFY_API_KEY) for headless or CI use - Credits on your account
- Optional: Browse partner nodes and per-call pricing
First generation
Common models
Nano Banana (Google Gemini): text-to-image and editing:Discover models
Image editing with references
Pass local file paths. The CLI uploads via Comfy’s storage endpoint or base64-encodes as needed:Uploaded reference assets auto-delete after 24 hours. They are stored in Comfy-managed GCS with signed URLs. For long-running pipelines, re-upload before each job. See the reference for details.
Video generation (async jobs)
Video jobs are async. The CLI blocks and polls by default:--async, then resume later:
JSON output for scripts
Emit raw API responses for pipeline integration:Run Workflows (comfy run)
Beyond single partner calls, comfy run submits a complete ComfyUI workflow graph. It accepts both API-format and exported UI-format JSON (UI workflows are converted to API format client-side), and routes to local or cloud like every other command. It is async by default. It returns a prompt_id in milliseconds while a background watcher tracks progress. Pass --wait to block instead.
--wait:
Start from a Template
The curatedComfy-Org/workflow_templates gallery is the fastest way to get a known-good workflow for a given task. You do not need to build from scratch.
comfy run --where cloud auto-converts it to API format on submit.
Edit Workflows In Place
comfy workflow exposes the agent-tweakable slots in any frontend-format workflow and lets you override them. No manual JSON surgery.
Discover Nodes and Models
Introspect everything available on the resolved backend. Nodes:Upload and Download Files
Manage Custom Nodes
cm-cli for custom node installation. See the ComfyUI Manager cm-cli docs for details.
Manage Models (Local)
Download models easily:JSON Output for Scripts and Agents
Every command accepts--json and emits the same envelope shape, making the CLI fully scriptable and agent-friendly:
error is present, read the hint and act on it:
Agent Skills
Install the bundled Comfy agent skills into Claude Code, Cursor, and any AGENTS.md-aware tool, so your coding agent can drive the CLI directly:These are bundled CLI skills installed by
comfy skills install. They are separate from the Comfy Skills repository, which hosts the comfy-cloud Claude Code plugin for Comfy Cloud MCP.Contributing
Contributions are welcome. Open issues or submit pull requests on the comfy-cli GitHub repository. Refer to the Dev Guide for further details.Analytics
Usage tracking helps improve the CLI. Disable it with:DO_NOT_TRACK or COMFY_NO_TELEMETRY environment variables.