Comfy CLI

raw JSON →
1.7.3 verified Mon Apr 27 auth: no python

A command-line interface for managing ComfyUI installations, workflows, and models. Version 1.7.3 requires Python >=3.10 and is actively maintained.

pip install comfy-cli
error ModuleNotFoundError: No module named 'comfy_cli'
cause Trying to import with hyphen instead of underscore
fix
Use from comfy_cli import ComfyUI
error comfy: command not found
cause comfy-cli not installed or not in PATH
fix
Run pip install comfy-cli and ensure Python binaries are in PATH
breaking Version 1.7.0 changed the CLI argument --port to --port-number
fix Update scripts to use --port-number instead of --port
gotcha The CLI uses `comfy` command, not `comfy-cli`. Some users try `comfy-cli` which fails.
fix Use `comfy` as the command, e.g., `comfy install`

Initialize a ComfyUI instance, install it, and start the server.

from comfy_cli import ComfyUI
import os

# Initialize with optional API key
comfy = ComfyUI(api_key=os.environ.get('COMFY_API_KEY', ''))
# Install and run ComfyUI
comfy.install()
comfy.start()