Loading...
Loading...
通过命令行在RunComfy上运行任意模型。`runcomfy` CLI是一个独立二进制文件,一次认证即可访问数百个模型端点——涵盖图像生成、图像编辑、视频生成、图生视频、唇形同步、人脸替换、视频编辑、图像修复、图像扩展、画面延伸、ControlNet、重新打光、图像超分辨率、LoRA训练等功能。提交请求、轮询状态、下载输出结果。本技能将指导Agent如何安装、认证、发现模型架构、调用模型、流式处理/轮询/无需等待、以JSON输出模式编写脚本以及处理错误。当触发词为“runcomfy cli”、“install runcomfy”、“runcomfy login”、“runcomfy run”、“runcomfy whoami”、“runcomfy api”,或任何明确要求从脚本或终端调用RunComfy模型的请求时,本技能将启动。相关的兄弟技能(ai-image-generation、ai-video-generation、image-edit、video-edit、face-swap、lipsync、image-to-video、image-inpainting、image-outpainting、video-extend、controlnet-pose、relight)均通过此CLI进行调度。
npx skill4agent add prime-skills/runcomfy-agent-skills runcomfy-cliruncomfy run <model_id> --input '{...}'runcomfy-*npx skills add agentspace-so/runcomfy-agent-skills --skill runcomfy-cli -g# 通过npm全局安装(推荐重复使用)
npm i -g @runcomfy/cli
# 零安装一次性使用(无Node全局状态)
npx -y @runcomfy/cli --versionBash(runcomfy *)runcomfy --versionruncomfy login
# 终端显示验证码 —— 将其粘贴到浏览器页面,点击“授权”
# Token将保存到~/.config/runcomfy/token.json,权限为0600export RUNCOMFY_TOKEN=<token-from-runcomfy.com/profile>runcomfy whoami
# 📛 you@example.com
# token type: cli
# user id: ...runcomfy run <vendor>/<model>/<endpoint> \
--input '<JSON body>' \
--output-dir <path>runcomfy run openai/gpt-image-2/text-to-image \
--input '{"prompt": "a small purple cat at sunset, photorealistic"}'⏳ Submitting request to openai/gpt-image-2/text-to-image
request_id: 8a3f...
⏳ Polling status (every 2s)...
in_queue
in_progress
completed
✅ completed
{
"images": [
"https://playgrounds-storage-public.runcomfy.net/.../result.png"
]
}
📥 Downloading 1 file(s) to .
./result.png--output-dir ./out--no-downloadopen https://www.runcomfy.com/models| URL | 内容 |
|---|---|
| 所有精选模型 |
| 完整模型目录 |
| 新增模型 |
| 精选品牌模型集合 |
| 唇形同步功能 |
| 角色/人脸替换 |
| 视频超分辨率 |
runcomfy run <model_id>| 参数 | 说明 |
|---|---|
| 内联JSON请求体。字符串可包含换行符;必要时需转义引号 |
| 从文件读取请求体(根据扩展名支持JSON或YAML) |
| 结果文件的下载目录(默认:当前工作目录) |
| 跳过下载步骤;仅打印结果JSON |
| 提交请求后立即返回 |
| 设置轮询等待超时时间。默认值:取决于模型 |
| 打印机器可读的JSON格式输出(默认:人类可读格式) |
| 抑制进度输出,仅保留最终结果行 |
runcomfy loginruncomfy whoamiruncomfy logoutloginwhoamilogoutRUNCOMFY_TOKENruncomfy status <request_id>--no-waitRID=$(runcomfy --output json run google/nano-banana-2/text-to-image \
--input '{"prompt": "..."}' --no-wait | jq -r .request_id)
runcomfy status "$RID"runcomfy --output json run openai/gpt-image-2/text-to-image \
--input '{"prompt": "X"}' \
--no-download \
| jq -r '.images[0]'while IFS= read -r prompt; do
runcomfy run blackforestlabs/flux-2-klein/9b/text-to-image \
--input "$(jq -nc --arg p "$prompt" '{prompt:$p, steps:8}')" \
--output-dir "./out/$(date +%s%N)"
done < prompts.txt# 提交一个或多个任务,无需阻塞
RID=$(runcomfy --output json run bytedance/seedance-v2/pro \
--input '{"prompt": "..."}' --no-wait | jq -r .request_id)
# 稍后——可在不同终端执行:
runcomfy status "$RID"for i in 1 2 3; do
runcomfy run <model_id> --input '{...}' && break
rc=$?
[ $rc -eq 75 ] && sleep $((2**i)) && continue
exit $rc
done| 代码 | 含义 | 是否可重试 |
|---|---|---|
| 0 | 成功 | — |
| 64 | CLI参数错误 | 否 |
| 65 | 输入JSON错误/架构不匹配 | 否 |
| 69 | 上游服务5xx错误 | 是(退避后重试) |
| 75 | 可重试:超时/429 | 是 |
| 77 | 未登录或Token被拒绝 | 否——重新认证 |
| 130 | 中断(Ctrl-C);退出前已取消远程请求 | — |
runmodel-api.runcomfy.netcompletedfailedcanceled*.runcomfy.net*.runcomfy.com--output-dirCtrl-CDELETEnpm i -g @runcomfy/clinpx -y @runcomfy/cliruncomfy login~/.config/runcomfy/token.jsonRUNCOMFY_TOKEN--input$(...)enable_web_searchenable_web_searchfalsetruemodel-api.runcomfy.net*.runcomfy.net*.runcomfy.comallowed-tools: Bash(runcomfy *)runcomfy <subcommand>npmcurlexport RUNCOMFY_TOKEN=...ai-image-generationai-video-generationai-avatar-videoimage-editvideo-editimage-to-videoface-swaplipsyncimage-inpaintingimage-outpaintingvideo-extendcontrolnet-poserelight