Skip to main content
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.
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 MCPComfy CLI
InterfaceChat with an MCP client (Claude Code, Claude Desktop, โ€ฆ)Terminal commands and scripts
Best forInteractive agent workflows in chatAutomation, batch runs, CI, shell pipelines
AuthOAuth in MCP clients, or API key (headless)comfy cloud login (OAuth) or API key (CI)
OutputReturned in the chat sessionSaved to disk (--download) or JSON (--json)
For MCP setup, installation, tool lists, and auth methods, see Comfy Cloud MCP.

What the CLI does

  1. Local ComfyUI โ€” install, launch, update, and manage custom nodes
  2. Partner generation โ€” comfy generate for one-shot image/video/audio/3D partner API calls
  3. 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

To get shell completion hints:
Pass -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

Your first generation

The CLI uploads local files, submits the job, polls for completion, and saves results.

Available models

comfy generate covers image and video partner models. Discover what is available in your CLI version:
Common aliases include:
CategoryExamples
Imageflux-pro, flux-ultra, flux-kontext, nano-banana, grok, grok-edit, ideogram-edit, dalle, recraft, stability
Videoseedance, kling, luma, runway, pika, vidu, hailuo, moonvalley, grok-video
Run 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:
To upload once and reuse across calls:
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:
Return immediately with --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, and comfy validate for full workflows
  • comfy templates and comfy workflow slot editing
  • comfy nodes / comfy models discovery
  • --json envelopes and comfy --json discover for agents
โ†’ Comfy CLI getting started (complete documentation)

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.
ResourceWhat itโ€™s for
Comfy CLI getting startedComplete install guide and command walkthrough
Comfy CLI referenceCommands, flags, and model aliases
Comfy Cloud MCPConnect agents via MCP for chat-driven generation
comfy-cli on GitHubSource repo, issues, and latest behavior

Feedback