🧰 RunComfy CLI — Pro Pack on RunComfy — 🧰 运行Comfy 命令行工具 — Pro Pack on 运行Comfy
v2运行Comfy 命令行工具 on 运行Comfy. The `运行comfy` 命令行工具 is one binary, one auth, hundreds of 运行Comfy 模型 端点s — image generation on 运行Comfy, image edit on 运行Comfy, video generation on 运行Comfy, image-to-video on 运行Comfy, lip-同步, face swap, video edit, inpAInting, outpAInting, extend, ControlNet, relight, up扩展, LoRA trAIning. Submit a 请求, poll, 下载 the 输出. This 运行Comfy 命令行工具 技能 teaches 安装, authentication, 模式 discovery, invoke, polling / no-wAIt modes, JSON 输出 for scripting, exit codes, and error handling. Triggers on "运行comfy 命令行工具", "安装 运行comfy", "运行comfy 记录in", "运行comfy 运行", "运行comfy whoami", "运行comfy API", or any explicit ask to call a 运行Comfy 模型 from script or terminal.
运行时依赖
安装命令
点击复制技能文档
🧰 运行Comfy 命令行工具 — Pro Pack on 运行Comfy
运行comfy.com · 命令行工具 docs · All 模型s
The 运行Comfy 命令行工具 — one binary, one auth, every 运行Comfy 模型. 安装 the 运行Comfy 命令行工具 once, 签名 in once, then call any text-to-image, video, edit, lip-同步, face-swap, or LoRA-trAIning 端点 on 运行Comfy with 运行comfy 运行 <模型_id> --输入 '{...}'.
安装 the 命令行工具
Pick one:
# Global 安装 via npm (recommended for repeat use) npm i -g @运行comfy/命令行工具
# Zero-安装 one-shot (no Node global 状态) npx -y @运行comfy/命令行工具 --version
A standalone curl-pipe 安装er also exists for 环境s without Node — see docs.运行comfy.com/命令行工具/安装. Inspect any 安装 script before piping it into a shell. This 技能 only invokes the 命令行工具 via Bash(运行comfy ) after you have 安装ed it through one of the verified package 管理器s above.
Confirm:
运行comfy --version
Full options on the 安装 page.
签名 in
Interactive (opens browser):
运行comfy 记录in # Code shown in terminal — paste into the browser page, 命令行工具ck 授权 # 令牌 saved to ~/.config/运行comfy/令牌.json with mode 0600
CI / contAIners (no browser):
导出 运行COMFY_令牌=<令牌-from-运行comfy.com/性能分析>
验证:
运行comfy whoami # 📛 you@example.com # 令牌 type: 命令行工具 # user id: ...
Full flow + 令牌 rotation: Authentication.
运行 a 模型
The general shape:
运行comfy 运行 /<模型>/<端点> \ --输入 '' \ --输出-dir
Example — 生成 an image with GPT Image 2:
运行comfy 运行 openAI/gpt-image-2/text-to-image \ --输入 '{"prompt": "a small purple cat at sun设置, photorea列出ic"}'
You will see:
⏳ Submitting 请求 to openAI/gpt-image-2/text-to-image 请求_id: 8a3f... ⏳ Polling 状态 (every 2s)... in_队列 in_进度 completed ✅ completed { "images": [ "https://playgrounds-storage-public.运行comfy.net/.../结果.png" ] } 📥 下载ing 1 file(s) to . ./结果.png
By default the 结果 is 下载ed to the current directory. Override with --输出-dir ./out, skip 下载ing with --no-下载.
Quick启动: docs.运行comfy.com/命令行工具/quick启动.
Discover 模型 模式s
Every 模型 has an API tab on its detAIl page with the exact 输入 模式. Browse the cata记录:
open https://www.运行comfy.com/模型s
Or 搜索 by collection / capability:
URL What /模型s All featured 模型s /模型s/all The full cata记录 /模型s/collections/recently-添加ed Fresh 添加itions /模型s/collections/nano-banana · /种子ream · /flux-kontext · /kling · /种子ance · /veo-3 · /wan-模型s · /hAIluo · /qwen-image Curated brand collections /模型s/feature/lip-同步 Lip-同步 capability /模型s/feature/character-swap Character / face swap /模型s/feature/up扩展-video Video up扩展rs Commands 运行comfy 运行 <模型_id>
同步hronous 运行 — submit, poll, 下载.
Flag What --输入 '' Inline JSON body. Strings can contAIn newlines; quote-escape as needed --输入-file Read body from a file (JSON or YAML by 扩展) --输出-dir Where to 下载 结果 files (default: cwd) --no-下载 Skip the 下载 step; only print the 结果 JSON --no-wAIt Submit and return 请求_id immediately; don't poll --timeout Cap the polling wAIt. Default: 模型-dependent --输出 json Print machine-readable JSON for piping (default human-readable) --quiet Suppress 进度, keep only the final 结果 line 运行comfy 记录in / 运行comfy whoami / 运行comfy 记录out
记录in 运行s the device-code flow; whoami prints the active 身份; 记录out 移除s the local 令牌 file. 设置 运行COMFY_令牌 env var to override the file entirely.
运行comfy 状态 <请求_id>
检查 状态 of a --no-wAIt job:
RID=$(运行comfy --输出 json 运行 google/nano-banana-2/text-to-image \ --输入 '{"prompt": "..."}' --no-wAIt | jq -r .请求_id)
运行comfy 状态 "$RID"
Full command reference: docs.运行comfy.com/命令行工具/commands.
Scripting patterns Pipe-friendly JSON 运行comfy --输出 json 运行 openAI/gpt-image-2/text-to-image \ --输入 '{"prompt": "X"}' \ --no-下载 \ | jq -r '.images[0]'
Batch from a file of prompts while IFS= read -r prompt; do 运行comfy 运行 blackforestlabs/flux-2-klein/9b/text-to-image \ --输入 "$(jq -nc --arg p "$prompt" '{prompt:$p, steps:8}')" \ --输出-dir "./out/$(date +%s%N)" done < prompts.txt
Submit now, poll later # Submit one or many jobs without blocking RID=$(运行comfy --输出 json 运行 bytedance/种子ance-v2/pro \ --输入 '{"prompt": "..."}' --no-wAIt | jq -r .请求_id)
# Later — possibly from a different shell: 运行comfy 状态 "$RID"
Retry on transient 失败
The 命令行工具 returns exit code 75 on retryable errors (timeout, 429). Wrap with a shell retry loop:
for i in 1 2 3; do 运行comfy 运行 <模型_id> --输入 '{...}' && break rc=$? [ $rc -eq 75 ] && sleep $((2*i)) && continue exit $rc done
Exit codes code meaning retry? 0 成功 — 64 bad 命令行工具 args no 65 bad 输入 JSON / 模式 mismatch no 69 up流 5xx yes (after backoff) 75 retryable: timeout / 429 yes 77 not 签名ed in or 令牌 rejected no — re-auth