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 generationcomfy generate for one-shot image/video/audio/3D partner API calls
  3. Cloud workflowscomfy 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
To get shell completion hints:
comfy --install-completion
comfy setup
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:
comfy cloud login
comfy cloud whoami

Prerequisites for comfy generate

Your first generation

comfy generate flux-pro \
    --prompt "a cat on the moon, cinematic lighting" \
    --width 1024 --height 1024 \
    --download cat.png
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:
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
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

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
To upload once and reuse across calls:
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
Return immediately with --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, 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:
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.
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