ComfyCLI

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.

WORKS WITH

Claude Code

Codex

Cursor

Gemini CLI

OpenClaw

Hermes

Any shell

GET STARTED

Set up Comfy CLI

One install, two places to run: Comfy Cloud GPUs, or the ComfyUI on your own machine. Paste one prompt into your coding agent, or run the commands yourself.

Cloud runs spend Comfy credits. Add credits, or use an existing Comfy Cloud subscription. Browsing templates, models, and nodes is free with a Comfy account.

Install the CLI

Install from PyPI (Homebrew works too), then set up the cloud connection. It opens a browser sign-in.

pip install comfy-cli

Prefer the manual path? After the install above:

comfy setup --where cloud comfy skills install

Ask Claude Code to set it up

Paste this into Claude Code. It installs the CLI, runs setup, signs you in, and adds the bundled skills.

Set up the Comfy CLI for me: pip install comfy-cli, then comfy setup --where cloud, then comfy skills install. Follow the guide at https://docs.comfy.org/agent-tools/cli.md and tell me when it's ready.

comfy generate is in beta: flag names, model aliases, and output formats may change. The underlying partner endpoints are stable.

Every command and flag lives in the command reference.

A real session, start to finish.

Recorded in one take against Comfy Cloud: a generation with a partner model, a workflow run on cloud GPUs, and the bundled skills. Idle seconds trimmed, output untouched.

Video transcript: comfy setup connects the CLI to Comfy Cloud. comfy generate renders a prompt with a partner model and saves cat.png. comfy run submits a workflow to cloud GPUs, comfy jobs wait tracks it, and comfy download saves the result as f5308bc5_000.png. comfy skills list prints the bundled skills. The session ends with two files saved: cat.png and f5308bc5_000.png.

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

BUNDLED SKILLS

  • comfyworkflows, models, and generation from the shell
  • comfy-fragmentstyped fragments and YAML recipes for big workflows
  • comfy-debugfrom failed run to fixed, fast
  • comfy-relaysurfaces every workflow artifact in chat
  • comfy-directornarrative, multi-shot video direction

BATCH PACK SHOTS

comfy-fragments

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

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

KEYFRAME BOARDS

comfy-director

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

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

CHARACTER SHEETS

comfy

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

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

SET EXTENSION

comfy

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

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

3D HERO PROPS

comfy

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

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

CAMPAIGN KEY ART

comfy

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

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

More agent skills live in the Comfy Skills repository.

AI MODELS

Run the world’s leading AI models

New models are added as they launch.

EXPLORE 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

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.

Products

The AI creation engine for complete control

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

Q&As