
Security News
Axios Supply Chain Attack Reaches OpenAI macOS Signing Pipeline, Forces Certificate Rotation
OpenAI rotated macOS signing certificates after a malicious Axios package reached its CI pipeline in a broader software supply chain attack.
@optima-chat/comfy-cli
Advanced tools

面向 ComfyUI 的命令行工具,专为 AI Agent 设计,特别适配 Claude Code。
npm install -g @optima-chat/comfy-cli@latest
# 首次使用:配置 ComfyUI 服务器地址
comfy config set server http://localhost:8188
# 检查 ComfyUI 是否运行
comfy system stats
# 生成图像
comfy generate "a beautiful sunset"
# 查看队列状态
comfy queue status
# 列出可用模型
comfy model list --type checkpoints
ComfyUI CLI 支持 Claude Code Skills 自动发现,让 Claude 能够直接通过自然语言调用命令。
在你的项目中运行:
comfy init
这会在项目中创建 .claude/skills/comfy-cli/ 目录和 Skill 配置文件。
打开 Claude Code 后,直接对话:
comfy generate "a cat"comfy edit <file> "anime style"comfy video <file># 查看已安装的 Skill
ls .claude/skills/
# 重新初始化(覆盖)
comfy init --force
# 删除 Skill
rm -rf .claude/skills/comfy-cli/
默认输出 JSON 格式(AI 友好),支持两种模式:
JSON 模式(默认):机器可读,AI 友好,减少 50%+ token
comfy queue status
# {"success":true,"data":{"running":[],"pending":[]}}
Pretty 模式:人类可读,带颜色和表格
comfy queue status --pretty
# 📊 队列状态
# ✓ 当前无正在执行的任务
全局使用:comfy --pretty <command>
单命令使用:comfy <command> --pretty
comfy generate "a beautiful sunset over mountains"
comfy generate "cyberpunk city" --width 1024 --height 768
comfy generate "a cat" # 默认等待完成并显示实时进度
comfy generate "a cat" --no-wait # 提交后立即返回
选项:
--width <number>: 图像宽度(默认:1024)--height <number>: 图像高度(默认:1024)--no-wait: 提交后立即返回(默认等待完成并显示实时进度)--pretty: 人类可读的表格格式输出(默认 JSON)comfy edit input.png "add more details"
comfy edit photo.jpg "make it anime style"
comfy edit image.png "stylize" # 默认等待完成并显示实时进度
comfy edit image.png "stylize" --no-wait # 提交后立即返回
选项:
--no-wait: 提交后立即返回(默认等待完成并显示实时进度)--pretty: 人类可读的表格格式输出(默认 JSON)comfy video portrait.png --prompt "smooth motion"
comfy video scene.jpg --width 512 --height 512
comfy video image.png --prompt "dancing" # 默认等待完成并显示实时进度
comfy video image.png --prompt "dancing" --no-wait # 提交后立即返回
选项:
-p, --prompt <text>: 运动描述提示词-n, --negative <text>: 负向提示词--width <number>: 视频宽度(默认:512)--height <number>: 视频高度(默认:512)--no-wait: 提交后立即返回(默认等待完成并显示实时进度)--pretty: 人类可读的表格格式输出(默认 JSON)# 提交自定义工作流
comfy workflow submit workflow.json
# 查看历史记录
comfy workflow list --limit 10
# 获取执行结果
comfy workflow get <prompt_id>
# 查看队列状态
comfy queue status
# 清空队列
comfy queue clear --confirm
# 删除指定任务
comfy queue delete <item_id>
# 中断当前执行
comfy interrupt
# 列出所有模型
comfy model list
# 列出特定类型模型
comfy model list --type checkpoints
comfy model list --type loras --pretty
# 列出所有节点类型
comfy node list
# 过滤节点
comfy node list --filter sampler
# 查看节点详情
comfy node info KSampler --pretty
# 查看系统状态(默认 JSON)
comfy system stats
# 人类可读的表格格式
comfy system stats --pretty
# 设置服务器地址
comfy config set server http://localhost:8188
# 查看当前配置
comfy config list
# 重置配置
comfy config reset --confirm
默认配置存储在 ~/.comfy-cli/config.json:
{
"server": "http://localhost:8188",
"timeout": 30000,
"autoConnect": true,
"outputDir": "./output"
}
配置项说明:
server: ComfyUI 服务器地址(必需,首次使用前需配置)timeout: 请求超时时间(毫秒)autoConnect: 自动连接到服务器outputDir: 下载文件的默认输出目录在项目中运行 comfy init 创建 Skill 配置,Claude 会自动发现并使用。详见 Claude Code 集成 章节。
在你的 ~/.claude/CLAUDE.md 中添加:
## ComfyUI CLI
ComfyUI CLI 是一个专为 AI Agent 设计的 ComfyUI 命令行工具。
**常见需求映射**:
- "生成图像 XX" → `comfy generate "XX"`
- "编辑图像" → `comfy edit <image> "描述"`
- "生成视频" → `comfy video <image> --prompt "描述"`
- "提交工作流 XX" → `comfy workflow submit XX`
- "查看队列" → `comfy queue status`
- "列出所有 checkpoint 模型" → `comfy model list --type checkpoints`
- "下载生成结果" → `comfy download <prompt_id>`
- "中断当前任务" → `comfy interrupt`
**输出格式**:
- 默认输出 JSON(AI 友好,减少 token)
- 使用 `--pretty` 可切换到人类可读的表格格式
# 安装依赖
npm install
# 开发模式运行
npm run dev
# 构建
npm run build
# 本地测试
npm link
comfy --help
MIT
欢迎贡献!请随时提交 Pull Request。
FAQs
A CLI tool for ComfyUI designed for LLM interactions
The npm package @optima-chat/comfy-cli receives a total of 69 weekly downloads. As such, @optima-chat/comfy-cli popularity was classified as not popular.
We found that @optima-chat/comfy-cli demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
OpenAI rotated macOS signing certificates after a malicious Axios package reached its CI pipeline in a broader software supply chain attack.

Security News
Open source is under attack because of how much value it creates. It has been the foundation of every major software innovation for the last three decades. This is not the time to walk away from it.

Security News
Socket CEO Feross Aboukhadijeh breaks down how North Korea hijacked Axios and what it means for the future of software supply chain security.