Documentation Index
Fetch the complete documentation index at: /llms.txt
Use this file to discover all available pages before exploring further.
Skip to main content
Agent Tools
Comfy CLI: Run ComfyUI from the Terminal
Drive Comfy from the terminal: local ComfyUI, partner generate calls, and full workflows on Comfy Cloud. Complements MCP for scripts, CI, and automation.
comfy-cli is Comfy’s command-line tool. Alongside MCP servers, it gives agents and developers another way to drive Comfy from outside the UI.
Use it for terminal or script access: batch jobs, CI pipelines, workflow automation, and pairing with coding agents via bundled CLI skills.
For MCP setup, installation, tool lists, and auth methods, see Comfy MCP.
To get shell completion hints:
Pass
Prerequisites for
The CLI uploads local files, submits the job, polls for completion, and saves results.
Common aliases include:
Run
To upload once and reuse across calls:
Return immediately with
Beyond
Everything above is the agent-focused summary. The full guide walks through each command in depth:
Quick reference for agents. This page is a shortened overview: enough to get oriented alongside MCP and run common
comfy generate calls. For the complete CLI documentation (local install, comfy setup, comfy run, templates, workflow editing, node/model discovery, and more), see Comfy CLI getting started.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.How it fits with MCP
| Comfy MCP (cloud) | Comfy CLI | |
|---|---|---|
| Interface | Chat with an MCP client (Claude Code, Claude Desktop, …) | Terminal commands and scripts |
| Best for | Interactive agent workflows in chat | Automation, batch runs, CI, shell pipelines |
| Auth | OAuth in MCP clients, or API key (headless) | comfy cloud login (OAuth) or API key (CI) |
| Output | Returned in the chat session | Saved to disk (--download) or JSON (--json) |
What the CLI does
- Local ComfyUI — install, launch, update, and manage custom nodes
- Partner generation —
comfy generatefor one-shot image/video/audio/3D partner API calls - Cloud workflows —
comfy run, templates, slot editing, and job watching on Comfy Cloud
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 and set up
pip install comfy-cli
brew tap Comfy-Org/comfy-cli
brew install comfy-org/comfy-cli/comfy-cli
comfy --install-completion
comfy setup
-y for non-interactive installs in CI or scripts. See Comfy CLI getting started for the full comfy setup flag table.
Sign in to Comfy Cloud:
comfy cloud login
comfy cloud whoami
Prerequisites for comfy generate
- 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
Your first generation
comfy generate flux-pro \
--prompt "a cat on the moon, cinematic lighting" \
--width 1024 --height 1024 \
--download cat.png
Available models
comfy generate covers image and video partner models. Discover what is available in your CLI version:
comfy generate list # all models
comfy generate list --category text-to-video # filter by category
comfy generate list --partner kling # filter by partner
comfy generate schema flux-kontext # params for one model
| Category | Examples |
|---|---|
| Image | flux-pro, flux-ultra, flux-kontext, nano-banana, grok, grok-edit, ideogram-edit, dalle, recraft, stability |
| Video | seedance, kling, luma, runway, pika, vidu, hailuo, moonvalley, grok-video |
comfy generate list for the full set in your environment.
Usage examples
Text-to-image
comfy generate nano-banana \
--prompt "a watercolor of a sleeping fox" \
--download fox.png
Image edit (reference image)
Pass local file paths. The CLI uploads via Comfy’s storage endpoint or base64-encodes as needed:comfy generate nano-banana \
--prompt "add a top hat" \
--image ./cat.png \
--download edited.png
comfy generate flux-kontext \
--prompt "add a top hat and a monocle" \
--input_image ./photo.jpg \
--download out.png
comfy generate ideogram-edit \
--image cat.png --mask mask.png \
--prompt "add sunglasses" \
--rendering_speed TURBO \
--download edited.png
comfy generate upload ./photo.jpg # prints a signed URL
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.
Text-to-video
Video jobs are async. The CLI blocks and polls by default:comfy generate seedance \
--prompt "a hummingbird hovering over a flower" \
--resolution 1080p --duration 5 \
--download hummingbird.mp4
comfy generate kling \
--prompt "a paper boat drifting on a river at dusk" \
--duration 5 \
--download boat.mp4
--async, then resume later:
comfy generate luma --prompt "neon koi swimming through clouds" --aspect_ratio 16:9 --async
# prints a job id; resume with:
comfy generate resume luma <job_id> --download out.mp4
Scripting with JSON
comfy generate dalle --prompt "a watercolor whale" --json | jq '.data[0].url'
Beyond comfy generate
Everything above is the agent-focused summary. The full guide walks through each command in depth:
comfy run,comfy jobs, andcomfy validatefor full workflowscomfy templatesandcomfy workflowslot editingcomfy nodes/comfy modelsdiscovery--jsonenvelopes andcomfy --json discoverfor agents
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:comfy skills install
comfy skills list # comfy, comfy-fragments, comfy-debug, comfy-relay, comfy-director
comfy skills status # what's installed where
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.Related resources
| Resource | What it’s for |
|---|---|
| Comfy CLI getting started | Complete install guide and command walkthrough |
| Comfy CLI reference | Commands, flags, and model aliases |
| Comfy MCP | Connect agents via MCP for chat-driven generation |
| comfy-cli on GitHub | Source repo, issues, and latest behavior |
Feedback
- GitHub: comfy-cli issues
- Discord: #comfy-mcp-and-cli
Was this page helpful?
⌘I
