@optima-chat/comfy-cli 0.4.1 → 0.4.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +55 -16
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -2,16 +2,17 @@
|
|
|
2
2
|
|
|
3
3
|

|
|
4
4
|
|
|
5
|
-
面向 [ComfyUI](https://github.com/comfyanonymous/ComfyUI) 的命令行工具,专为
|
|
5
|
+
面向 [ComfyUI](https://github.com/comfyanonymous/ComfyUI) 的命令行工具,专为 AI Agent 设计,特别适配 Claude Code。
|
|
6
6
|
|
|
7
7
|
## 特性
|
|
8
8
|
|
|
9
9
|
- 🚀 **简单易用**:所有 ComfyUI 操作的简单命令
|
|
10
|
-
- 🤖 **LLM
|
|
10
|
+
- 🤖 **AI 友好**:默认 JSON 输出,优化 LLM 解析,减少 50%+ token
|
|
11
11
|
- 📊 **实时监控**:WebSocket 支持实时进度更新
|
|
12
12
|
- 🎨 **图像处理**:无缝上传和下载图像
|
|
13
13
|
- 📦 **模型管理**:列出和查询可用模型
|
|
14
14
|
- ⚡ **队列控制**:管理工作流执行队列
|
|
15
|
+
- 🎯 **双输出模式**:JSON(AI 友好)和 Pretty(人类可读)
|
|
15
16
|
|
|
16
17
|
## 安装
|
|
17
18
|
|
|
@@ -22,11 +23,14 @@ npm install -g @optima-chat/comfy-cli@latest
|
|
|
22
23
|
## 快速开始
|
|
23
24
|
|
|
24
25
|
```bash
|
|
26
|
+
# 首次使用:配置 ComfyUI 服务器地址
|
|
27
|
+
comfy config set server http://localhost:8188
|
|
28
|
+
|
|
25
29
|
# 检查 ComfyUI 是否运行
|
|
26
30
|
comfy system stats
|
|
27
31
|
|
|
28
|
-
#
|
|
29
|
-
comfy
|
|
32
|
+
# 生成图像
|
|
33
|
+
comfy generate "a beautiful sunset"
|
|
30
34
|
|
|
31
35
|
# 查看队列状态
|
|
32
36
|
comfy queue status
|
|
@@ -35,6 +39,26 @@ comfy queue status
|
|
|
35
39
|
comfy model list --type checkpoints
|
|
36
40
|
```
|
|
37
41
|
|
|
42
|
+
## 输出格式
|
|
43
|
+
|
|
44
|
+
默认输出 **JSON 格式**(AI 友好),支持两种模式:
|
|
45
|
+
|
|
46
|
+
- **JSON 模式(默认)**:机器可读,AI 友好,减少 50%+ token
|
|
47
|
+
```bash
|
|
48
|
+
comfy queue status
|
|
49
|
+
# {"success":true,"data":{"running":[],"pending":[]}}
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
- **Pretty 模式**:人类可读,带颜色和表格
|
|
53
|
+
```bash
|
|
54
|
+
comfy queue status --pretty
|
|
55
|
+
# 📊 队列状态
|
|
56
|
+
# ✓ 当前无正在执行的任务
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
全局使用:`comfy --pretty <command>`
|
|
60
|
+
单命令使用:`comfy <command> --pretty`
|
|
61
|
+
|
|
38
62
|
## 命令
|
|
39
63
|
|
|
40
64
|
### ✨ 快捷功能命令
|
|
@@ -52,7 +76,7 @@ comfy generate "a cat" --no-wait # 提交后立即返回
|
|
|
52
76
|
- `--width <number>`: 图像宽度(默认:1024)
|
|
53
77
|
- `--height <number>`: 图像高度(默认:1024)
|
|
54
78
|
- `--no-wait`: 提交后立即返回(默认等待完成并显示实时进度)
|
|
55
|
-
- `--
|
|
79
|
+
- `--pretty`: 人类可读的表格格式输出(默认 JSON)
|
|
56
80
|
|
|
57
81
|
#### 图像编辑(图生图)
|
|
58
82
|
|
|
@@ -65,7 +89,7 @@ comfy edit image.png "stylize" --no-wait # 提交后立即返回
|
|
|
65
89
|
|
|
66
90
|
**选项**:
|
|
67
91
|
- `--no-wait`: 提交后立即返回(默认等待完成并显示实时进度)
|
|
68
|
-
- `--
|
|
92
|
+
- `--pretty`: 人类可读的表格格式输出(默认 JSON)
|
|
69
93
|
|
|
70
94
|
#### 视频生成(图生视频)
|
|
71
95
|
|
|
@@ -82,7 +106,7 @@ comfy video image.png --prompt "dancing" --no-wait # 提交后立即返回
|
|
|
82
106
|
- `--width <number>`: 视频宽度(默认:512)
|
|
83
107
|
- `--height <number>`: 视频高度(默认:512)
|
|
84
108
|
- `--no-wait`: 提交后立即返回(默认等待完成并显示实时进度)
|
|
85
|
-
- `--
|
|
109
|
+
- `--pretty`: 人类可读的表格格式输出(默认 JSON)
|
|
86
110
|
|
|
87
111
|
---
|
|
88
112
|
|
|
@@ -125,7 +149,7 @@ comfy model list
|
|
|
125
149
|
|
|
126
150
|
# 列出特定类型模型
|
|
127
151
|
comfy model list --type checkpoints
|
|
128
|
-
comfy model list --type loras --
|
|
152
|
+
comfy model list --type loras --pretty
|
|
129
153
|
```
|
|
130
154
|
|
|
131
155
|
#### 节点信息
|
|
@@ -138,17 +162,17 @@ comfy node list
|
|
|
138
162
|
comfy node list --filter sampler
|
|
139
163
|
|
|
140
164
|
# 查看节点详情
|
|
141
|
-
comfy node info KSampler --
|
|
165
|
+
comfy node info KSampler --pretty
|
|
142
166
|
```
|
|
143
167
|
|
|
144
168
|
#### 系统信息
|
|
145
169
|
|
|
146
170
|
```bash
|
|
147
|
-
#
|
|
171
|
+
# 查看系统状态(默认 JSON)
|
|
148
172
|
comfy system stats
|
|
149
173
|
|
|
150
|
-
#
|
|
151
|
-
comfy system stats --
|
|
174
|
+
# 人类可读的表格格式
|
|
175
|
+
comfy system stats --pretty
|
|
152
176
|
```
|
|
153
177
|
|
|
154
178
|
#### 配置管理
|
|
@@ -170,13 +194,19 @@ comfy config reset --confirm
|
|
|
170
194
|
|
|
171
195
|
```json
|
|
172
196
|
{
|
|
173
|
-
"server": "http://
|
|
197
|
+
"server": "http://localhost:8188",
|
|
174
198
|
"timeout": 30000,
|
|
175
199
|
"autoConnect": true,
|
|
176
|
-
"outputDir": "./
|
|
200
|
+
"outputDir": "./output"
|
|
177
201
|
}
|
|
178
202
|
```
|
|
179
203
|
|
|
204
|
+
**配置项说明**:
|
|
205
|
+
- `server`: ComfyUI 服务器地址(必需,首次使用前需配置)
|
|
206
|
+
- `timeout`: 请求超时时间(毫秒)
|
|
207
|
+
- `autoConnect`: 自动连接到服务器
|
|
208
|
+
- `outputDir`: 下载文件的默认输出目录
|
|
209
|
+
|
|
180
210
|
## 在 Claude Code 中使用
|
|
181
211
|
|
|
182
212
|
在你的 `~/.claude/CLAUDE.md` 中添加:
|
|
@@ -184,18 +214,27 @@ comfy config reset --confirm
|
|
|
184
214
|
```markdown
|
|
185
215
|
## ComfyUI CLI
|
|
186
216
|
|
|
217
|
+
ComfyUI CLI 是一个专为 AI Agent 设计的 ComfyUI 命令行工具。
|
|
218
|
+
|
|
187
219
|
**常见需求映射**:
|
|
220
|
+
- "生成图像 XX" → `comfy generate "XX"`
|
|
221
|
+
- "编辑图像" → `comfy edit <image> "描述"`
|
|
222
|
+
- "生成视频" → `comfy video <image> --prompt "描述"`
|
|
188
223
|
- "提交工作流 XX" → `comfy workflow submit XX`
|
|
189
224
|
- "查看队列" → `comfy queue status`
|
|
190
225
|
- "列出所有 checkpoint 模型" → `comfy model list --type checkpoints`
|
|
191
|
-
- "
|
|
226
|
+
- "下载生成结果" → `comfy download <prompt_id>`
|
|
192
227
|
- "中断当前任务" → `comfy interrupt`
|
|
228
|
+
|
|
229
|
+
**输出格式**:
|
|
230
|
+
- 默认输出 JSON(AI 友好,减少 token)
|
|
231
|
+
- 使用 `--pretty` 可切换到人类可读的表格格式
|
|
193
232
|
```
|
|
194
233
|
|
|
195
234
|
## 系统要求
|
|
196
235
|
|
|
197
236
|
- Node.js >= 18.0.0
|
|
198
|
-
- ComfyUI 实例运行中(默认:http://
|
|
237
|
+
- ComfyUI 实例运行中(默认:http://localhost:8188)
|
|
199
238
|
|
|
200
239
|
## 开发
|
|
201
240
|
|