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 Cloud MCP | 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
-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:
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
Available models
comfy generate covers image and video partner models. Discover what is available in your CLI version:
| 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
Image edit (reference image)
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.
Text-to-video
Video jobs are async. The CLI blocks and polls by default:--async, then resume later:
Scripting with JSON
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: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 Cloud 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