Skip to main content

Documentation Index

Fetch the complete documentation index at: https://docs.comfy.org/llms.txt

Use this file to discover all available pages before exploring further.

Overview

comfy-cli is a command line tool that makes it easier to install and manage Comfy. It does two things:
  1. Manage a local ComfyUI install — install, launch, update, snapshot, and bisect ComfyUI and its custom nodes.
  2. Call hosted partner nodes directly — generate images and video from Seedance, Nano Banana (Gemini), Grok, Flux, Ideogram, DALL·E, Recraft, Stability, Kling, Luma, Runway, Pika, Vidu, Hailuo, Moonvalley, and more, with a single command. No local ComfyUI or workflow JSON required.

Install CLI

pip install comfy-cli
To get shell completion hints:
comfy --install-completion

Install ComfyUI

Create a virtual environment with any Python version greater than 3.9.
conda create -n comfy-env python=3.11
conda activate comfy-env
Install ComfyUI
comfy install
You still need to install CUDA, or ROCm depending on your GPU.

Run ComfyUI

comfy launch

Call partner nodes directly with comfy generate (Beta)

comfy generate is in beta. Flag names, model aliases, and output formats may change while we iron things out based on feedback. The underlying partner endpoints are stable — the CLI ergonomics on top of them are what’s still evolving. File feedback or issues on the comfy-cli GitHub repo.
comfy generate is the fastest way to call Comfy’s partner nodes from a terminal or a script. It hits the same hosted endpoints you’d otherwise wire into a ComfyUI workflow, but as one-shot CLI calls — perfect for batch jobs, quick experiments, and automation pipelines where standing up a full ComfyUI graph is overkill.

Prerequisites

Set the key once, then go:
export COMFY_API_KEY=comfyui-...   # or pass --api-key on each call

Your first generation

comfy generate flux-pro \
    --prompt "a cat on the moon, cinematic lighting" \
    --width 1024 --height 1024 \
    --download cat.png
That’s it — the CLI uploads any local file inputs, submits the job, polls until it’s ready, and saves the result to cat.png. A few of the most-used partner models, callable with one line:
# Nano Banana (Google Gemini Flash Image) — text-to-image and prompt-driven edits
comfy generate nano-banana \
    --prompt "a watercolor of a sleeping fox" \
    --download fox.png

# Same alias, now an image edit — pass a reference with --image (repeatable):
comfy generate nano-banana \
    --prompt "add a top hat" \
    --image ./cat.png \
    --download edited.png

# Pick a Gemini variant:
comfy generate nano-banana \
    --prompt "neon city skyline" \
    --model gemini-3-pro-image-preview \
    --download city.png

# Seedance (ByteDance) — text-to-video, up to 1080p / 12s clips
comfy generate seedance \
    --prompt "a hummingbird hovering over a flower" \
    --resolution 1080p --duration 5 \
    --download hummingbird.mp4

# Seedance image-to-video — pick a lite/i2v variant and pass a first frame
comfy generate seedance \
    --model seedance-1-0-lite-i2v-250428 \
    --prompt "the wave crests and crashes" \
    --image ./still.jpg \
    --download wave.mp4

# Grok (xAI) — image generation and editing
comfy generate grok --prompt "a cyberpunk street market at night" --download street.png
comfy generate grok-edit --prompt "swap the umbrella for a parasol" --image ./photo.jpg --download out.png

# Grok video
comfy generate grok-video --prompt "a paper plane gliding through a cathedral" --download flight.mp4

Discover models

comfy generate list                            # all available models
comfy generate list --category text-to-video   # filter by category
comfy generate list --partner kling            # filter by partner
comfy generate schema flux-kontext             # see the params for one model

Image editing with a reference image

Pass local file paths directly — the CLI uploads them through Comfy’s storage endpoint (or base64-encodes inline, depending on what each partner expects):
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
If you’d rather upload once and reuse the signed URL across many calls:
comfy generate upload ./photo.jpg
# → prints a signed URL you can pass as --input_image
Uploaded reference assets are auto-deleted after 24 hours. They’re stored in a Comfy-managed GCS bucket and served via signed URLs. For most workflows (upload → use → done) this is transparent; for long-running pipelines, plan to re-upload before each job. See the reference for details.

Video generation (async jobs)

Video jobs are async — the CLI blocks and polls until ready by default:
comfy generate kling \
    --prompt "a paper boat drifting on a river at dusk" \
    --duration 5 \
    --download boat.mp4
Pass --async to return immediately with a job id, 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 output

For pipelines, --json emits the raw API response:
comfy generate dalle --prompt "a watercolor whale" --json | jq '.data[0].url'
See the reference for the full list of commands, flags, and model aliases.

Manage Custom Nodes

comfy node install <NODE_NAME>
We use cm-cli for installing custom nodes. See the docs for more information.

Manage Models

Downloading models with comfy-cli is easy. Just run:
comfy model download --url <url> --relative-path models/checkpoints

Contributing

We encourage contributions to comfy-cli! If you have suggestions, ideas, or bug reports, please open an issue on our GitHub repository. If you want to contribute code, fork the repository and submit a pull request. Refer to the Dev Guide for further details.

Analytics

We track usage of the CLI to improve the user experience. You can disable this by running:
comfy tracking disable
To re-enable tracking, run:
comfy tracking enable