---
title: "Comfy CLI - Drive ComfyUI from your terminal and any coding agent"
description: "The command line for the full ComfyUI engine. Generate images, video, audio, and 3D from Claude Code, Codex, Cursor, or any shell, on Comfy Cloud or your own GPU."
canonical: https://comfy.org/cli/
lang: en
index: https://comfy.org/llms.txt
---

CLI

# Drive ComfyUI from your terminal. Or your agent's.

One CLI for the whole engine: generate images, video, audio, and 3D, run real workflow graphs, and pipe every output where you need it. Built for coding agents, CI jobs, and anyone with a terminal.

INSTALL CLI [VIEW DOCS](https://docs.comfy.org/agent-tools/cli)

$

## Create images and videos with Claude Code.

Bring ComfyUI workflows and creative models into the tools you already use. Run on Comfy Cloud or your own machine.

pip install comfy-cli

Python CLI · Cloud or Local · Agent skills included

FROM PROMPT TO OUTPUT

## A creative session, from your terminal.

✓ 2 files saved

![Cat in moonlight, extracted from the supplied recording](https://comfy.org/images/cli/session/cat.png)

cat.png

![Lighthouse at dusk, extracted from the supplied recording](https://comfy.org/images/cli/session/lighthouse.png)

f5308bc5_000.png

```
Session transcript: comfy generate renders a cat and saves cat.png. comfy templates fetch retrieves image_z_image_turbo as zimage.json. comfy workflow set-slot changes the prompt to a lighthouse at dusk. comfy run submits that workflow to Cloud and comfy download saves f5308bc5_000.png. The animation ends with both saved images.
```

AGENT SKILLS

## Skills your agent already knows.

One command installs five bundled skills that teach Claude Code, Cursor, and any AGENTS.md-aware tool the whole CLI. Below are six production briefs. Every prompt is ready to paste.

comfy skills install

Illustrative examples

### Batch pack shots

Run our pack-shot workflow for every SKU in ./skus.csv, 4 angles each, route it to cloud, and download everything to ./shots.

comfy-fragments

![Batch pack shots](https://media.comfy.org/website/learning/advertising3-thumb.png)

### Keyframe boards

Board a 30-second spot from BRIEF.md: 8 keyframes, consistent hero character, 16:9, contact sheet at the end.

comfy-director

![Keyframe boards](https://media.comfy.org/website/learning/advertising2-thumb.png)

### Character sheets

Load our saved character workflow and generate a 4-view turnaround for each hero in ./characters.

comfy

![Character sheets](https://media.comfy.org/website/learning/animation1-thumb.jpg)

### Set extension

Extend this plate to a 21:9 crop, matte-painting style. Keep the horizon line and the light direction.

comfy

![Set extension](https://media.comfy.org/website/mcp/hero-demo/set-extension.webp)

### 3D hero props

Build a 3D hero prop from sketch.png, game-ready, and hand me the .glb.

comfy

![3D hero props](https://media.comfy.org/website/learning/animation4-thumb.jpg)

### Campaign key art

Match frame_04.png's palette and produce campaign key art in 1:1, 4:5, and 16:9.

comfy

![Campaign key art](https://media.comfy.org/website/learning/advertising1-thumb.png)

[Comfy Skills repository](https://github.com/Comfy-Org/comfy-skills)

AI MODELS

## Run the world’s leading AI models

New models are added as they launch.

[Seedance 2.5](https://comfy.org/hub/workflows/) [MiniMax H3](https://comfy.org/hub/workflows/) [Gemini Omni 1.1 Flash](https://comfy.org/hub/workflows/) [Wan 3.0](https://comfy.org/hub/workflows/) [Wan 2.2](https://comfy.org/hub/workflows/) [GPT Image 2](https://comfy.org/hub/workflows/)

[EXPLORE WORKFLOWS](https://comfy.org/hub/workflows/)

THE AGENT CONTRACT

## Built for agents, not adapted for them.

The contract lives in the CLI itself. No wrapper, no guesswork.

--json

### Structured output

Every command accepts --json and returns one envelope shape: ok, data, error, and a hint your agent can act on. Pipe it into anything that reads JSON.

comfy --json discover

### Self-describing

One call dumps the entire command tree, output schemas, and error codes. Your agent reads the contract instead of guessing flags.

comfy run --workflow

### Real workflow graphs

Not one-shot endpoints. A run is a workflow JSON your agent can edit, validate, rerun, and hand to a teammate. It's the same graph that opens on the ComfyUI canvas.

## Why build on Comfy CLI?

The terminal counterpart to Comfy MCP: the same engine and the same account, scripted.

### Open source, end to end.

comfy-cli is open source, and so is the engine it drives. Install from PyPI, read the source when you need to, and never build on a black box.

### The full engine, not a sandbox.

Multi-step workflow graphs, thousands of community nodes, and partner models through the same commands. A creation engine, not a menu of hosted endpoints.

### Reproducible by design.

A run is a workflow file plus a seed. Check it into git, diff it in review, replay it in CI, and get the same output every time.

### Your GPUs, or ours.

Every command auto-detects where to run: signed in, jobs route to Comfy Cloud GPUs; otherwise they hit the ComfyUI on your machine. Override per call with --where.

### Works alongside MCP.

[Set up Comfy MCP](https://comfy.org/mcp/)

One account, two surfaces. Chat through Comfy MCP, script through the CLI, and let your agent pick the right one per task. Cloud outputs land in the same asset library either way.

## How it works

01

### INSTALL

pip install comfy-cli, then comfy setup. Sign in with OAuth for cloud GPUs, and comfy skills install teaches your agent the rest.

02

### DISCOVER

comfy --json discover hands your agent the full command tree; templates, models, and nodes are one search away.

03

### CREATE

Queue a run, wait on the job, download the outputs. Or pipe all three into a single line.

INSTALL CLI [VIEW DOCS](https://docs.comfy.org/agent-tools/cli)

Products

## The AI creation engine for complete control

Over every model, every node, every step, every output.

[Comfy Desktop

Run ComfyUI on your own hardware.

SEE DESKTOP FEATURES](https://comfy.org/download/) [Comfy Cloud

The full power of ComfyUI from anywhere.

SEE CLOUD FEATURES](https://comfy.org/cloud/) [Developer Platform

Deploy and scale ComfyUI workflows.

SEE PLATFORM FEATURES](https://comfy.org/platform/) [Comfy Enterprise

Enterprise-grade infrastructure for the creative engine inside your organization.

SEE ENTERPRISE FEATURES](https://comfy.org/enterprise/)

## Q&As

Any coding agent that can run shell commands. comfy skills install adds bundled skills for Claude Code, Cursor, and any AGENTS.md-aware tool, and the paste-prompt setup works in Codex, Gemini CLI, OpenClaw, Hermes, and the rest. For humans: any terminal, with tab completion via comfy --install-completion.

Both drive the same engine with the same account. Comfy MCP is for interactive agent work in chat: results come back in the session. The CLI is for automation: batch runs, CI, shell pipelines, and outputs saved to disk with --download or emitted as --json. Many teams run both and let the agent pick per task. Comfy MCP lives at [https://comfy.org/mcp/](https://comfy.org/mcp/).

The CLI is free and open source. With a Comfy account you can browse templates, models, and nodes at no cost, and runs on your own hardware are free. Partner models are the exception: they run on partner infrastructure and spend Comfy credits. Cloud runs spend credits too, either added directly or through an existing [Comfy Cloud subscription](https://comfy.org/pricing/).

Every command auto-detects where to run: signed in to Comfy Cloud, commands route to cloud; otherwise they run against your local server. Override per call with --where local or --where cloud, set the COMFY_WHERE environment variable, or persist a default with comfy set-default --where cloud.

Browser OAuth is the recommended path: comfy cloud login opens a sign-in, and the CLI refreshes tokens for you. API keys are the fallback for headless and CI use where no browser exists: create one at [https://platform.comfy.org/profile/api-keys](https://platform.comfy.org/profile/api-keys), then set COMFY_API_KEY or pass --api-key per call.

--download saves generate results to the path you name. comfy download pulls a run's outputs into ./outputs/, and it reads prompt IDs straight from piped stdin, so comfy run --workflow flux.json --wait | comfy download is the whole loop. On cloud, outputs also land in your Comfy Cloud asset library.

Yes. comfy-cli lives at [https://github.com/Comfy-Org/comfy-cli](https://github.com/Comfy-Org/comfy-cli) and installs from PyPI with pip install comfy-cli, or from Homebrew. The ComfyUI engine it drives is open source too.

comfy generate is in beta: flag names, model aliases, and output formats may change while we iterate. The underlying partner endpoints are stable. File feedback on the comfy-cli GitHub repo.

Yes, that's what it's for. comfy setup --where cloud --api-key comfyui-... --non-interactive configures a runner without a browser, every command takes --json, and comfy validate --workflow catches unknown nodes and missing models before you spend compute.

• Generate images, video, audio, and 3D through partner models like Flux, Seedance, Kling, and Ideogram • Build, edit, validate, and run workflow graphs; save and rerun them • Queue batches, wait on jobs, and download every output • Search templates, models, and nodes with full schemas • Compose multi-stage workflows from typed fragments Run comfy skills install once, and the bundled skills teach your agent all of it.
