@optima-chat/comfy-cli 0.5.0 → 0.5.1
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/.claude/skills/comfy-cli/SKILL.md +222 -222
- package/package.json +1 -1
|
@@ -3,195 +3,195 @@ name: comfy-cli
|
|
|
3
3
|
description: "ComfyUI CLI tool for AI agents. ALWAYS use when user wants to: generate images (生成图片/画图/图像/生成画), edit images (编辑图片/修改图片/图生图/改图), create videos (生成视频/图生视频/制作视频), manage ComfyUI workflows (工作流/ComfyUI). Uses 'comfy generate', 'comfy edit', 'comfy video' commands."
|
|
4
4
|
---
|
|
5
5
|
|
|
6
|
-
# ComfyUI CLI - AI
|
|
6
|
+
# ComfyUI CLI - AI 图像与视频生成工具
|
|
7
7
|
|
|
8
|
-
##
|
|
8
|
+
## 何时使用此 Skill
|
|
9
9
|
|
|
10
|
-
|
|
11
|
-
-
|
|
12
|
-
-
|
|
13
|
-
-
|
|
14
|
-
-
|
|
15
|
-
-
|
|
10
|
+
在以下情况使用此 Skill:
|
|
11
|
+
- 用户想要从文本提示词生成图像(文生图)
|
|
12
|
+
- 用户想要编辑或转换现有图像(图生图)
|
|
13
|
+
- 用户想要从图像创建视频(图生视频)
|
|
14
|
+
- 用户询问 ComfyUI 工作流、队列状态或模型
|
|
15
|
+
- 用户提到:生成图片、画图、图像处理、视频生成、ComfyUI
|
|
16
16
|
|
|
17
|
-
##
|
|
17
|
+
## 可用命令
|
|
18
18
|
|
|
19
|
-
### 1.
|
|
19
|
+
### 1. 生成图像:`comfy generate`
|
|
20
20
|
|
|
21
|
-
|
|
21
|
+
使用 Stable Diffusion / FLUX 模型从文本提示词生成图像。
|
|
22
22
|
|
|
23
|
-
|
|
23
|
+
**语法:**
|
|
24
24
|
```bash
|
|
25
|
-
comfy generate "
|
|
25
|
+
comfy generate "提示词" [选项]
|
|
26
26
|
```
|
|
27
27
|
|
|
28
|
-
|
|
29
|
-
-
|
|
30
|
-
- `--width
|
|
31
|
-
- `--height
|
|
32
|
-
- `--no-wait`:
|
|
33
|
-
- `--pretty`:
|
|
28
|
+
**参数:**
|
|
29
|
+
- `提示词`: 要生成图像的文本描述
|
|
30
|
+
- `--width <数字>`: 图像宽度(默认:1024)
|
|
31
|
+
- `--height <数字>`: 图像高度(默认:1024)
|
|
32
|
+
- `--no-wait`: 提交后立即返回,不等待完成
|
|
33
|
+
- `--pretty`: 人类可读的表格格式输出(默认:JSON)
|
|
34
34
|
|
|
35
|
-
|
|
36
|
-
-
|
|
37
|
-
-
|
|
35
|
+
**返回:**
|
|
36
|
+
- 包含 `prompt_id`、`status`、`outputs`(图像文件路径)的 JSON
|
|
37
|
+
- 默认行为:等待完成并显示实时进度
|
|
38
38
|
|
|
39
|
-
|
|
40
|
-
-
|
|
41
|
-
-
|
|
42
|
-
-
|
|
39
|
+
**使用场景:**
|
|
40
|
+
- 用户要求生成/创建图像
|
|
41
|
+
- 用户提供图像描述
|
|
42
|
+
- 文本生成图像
|
|
43
43
|
|
|
44
|
-
### 2.
|
|
44
|
+
### 2. 编辑图像:`comfy edit`
|
|
45
45
|
|
|
46
|
-
|
|
46
|
+
使用文本提示词编辑或转换现有图像(图生图)。
|
|
47
47
|
|
|
48
|
-
|
|
48
|
+
**语法:**
|
|
49
49
|
```bash
|
|
50
|
-
comfy edit
|
|
50
|
+
comfy edit <图像路径> "提示词" [选项]
|
|
51
51
|
```
|
|
52
52
|
|
|
53
|
-
|
|
54
|
-
-
|
|
55
|
-
-
|
|
56
|
-
- `--no-wait`:
|
|
57
|
-
- `--pretty`:
|
|
53
|
+
**参数:**
|
|
54
|
+
- `图像路径`: 输入图像文件的路径
|
|
55
|
+
- `提示词`: 转换描述(例如:"动漫风格"、"添加更多细节")
|
|
56
|
+
- `--no-wait`: 提交后立即返回,不等待完成
|
|
57
|
+
- `--pretty`: 人类可读的表格格式输出(默认:JSON)
|
|
58
58
|
|
|
59
|
-
|
|
60
|
-
-
|
|
61
|
-
-
|
|
59
|
+
**返回:**
|
|
60
|
+
- 包含 `prompt_id`、`status`、`outputs`(编辑后图像文件路径)的 JSON
|
|
61
|
+
- 默认行为:等待完成并显示实时进度
|
|
62
62
|
|
|
63
|
-
|
|
64
|
-
-
|
|
65
|
-
-
|
|
66
|
-
-
|
|
63
|
+
**使用场景:**
|
|
64
|
+
- 用户想要修改/编辑现有图像
|
|
65
|
+
- 用户想要应用风格转换
|
|
66
|
+
- 图像到图像的转换
|
|
67
67
|
|
|
68
|
-
### 3.
|
|
68
|
+
### 3. 创建视频:`comfy video`
|
|
69
69
|
|
|
70
|
-
|
|
70
|
+
使用 I2V(图像到视频)模型从图像生成视频。
|
|
71
71
|
|
|
72
|
-
|
|
72
|
+
**语法:**
|
|
73
73
|
```bash
|
|
74
|
-
comfy video
|
|
74
|
+
comfy video <图像路径> [选项]
|
|
75
75
|
```
|
|
76
76
|
|
|
77
|
-
|
|
78
|
-
-
|
|
79
|
-
- `-p, --prompt
|
|
80
|
-
- `-n, --negative
|
|
81
|
-
- `--width
|
|
82
|
-
- `--height
|
|
83
|
-
- `--no-wait`:
|
|
84
|
-
- `--pretty`:
|
|
77
|
+
**参数:**
|
|
78
|
+
- `图像路径`: 输入图像文件的路径
|
|
79
|
+
- `-p, --prompt <文本>`: 运动描述提示词(可选)
|
|
80
|
+
- `-n, --negative <文本>`: 负面提示词(可选)
|
|
81
|
+
- `--width <数字>`: 视频宽度(默认:512)
|
|
82
|
+
- `--height <数字>`: 视频高度(默认:512)
|
|
83
|
+
- `--no-wait`: 提交后立即返回,不等待完成
|
|
84
|
+
- `--pretty`: 人类可读的表格格式输出(默认:JSON)
|
|
85
85
|
|
|
86
|
-
|
|
87
|
-
-
|
|
88
|
-
-
|
|
86
|
+
**返回:**
|
|
87
|
+
- 包含 `prompt_id`、`status`、`outputs`(视频文件路径)的 JSON
|
|
88
|
+
- 默认行为:等待完成并显示实时进度
|
|
89
89
|
|
|
90
|
-
|
|
91
|
-
-
|
|
92
|
-
-
|
|
93
|
-
-
|
|
90
|
+
**使用场景:**
|
|
91
|
+
- 用户想要为静态图像添加动画
|
|
92
|
+
- 用户想要从图像创建视频
|
|
93
|
+
- 图像到视频的生成
|
|
94
94
|
|
|
95
|
-
### 4.
|
|
95
|
+
### 4. 下载结果:`comfy download`
|
|
96
96
|
|
|
97
|
-
|
|
97
|
+
将生成的图像/视频下载到本地目录。
|
|
98
98
|
|
|
99
|
-
|
|
99
|
+
**语法:**
|
|
100
100
|
```bash
|
|
101
|
-
comfy download <PROMPT_ID> [
|
|
101
|
+
comfy download <PROMPT_ID> [选项]
|
|
102
102
|
```
|
|
103
103
|
|
|
104
|
-
|
|
105
|
-
- `PROMPT_ID`:
|
|
106
|
-
- `-o, --output
|
|
107
|
-
- `--pretty`:
|
|
104
|
+
**参数:**
|
|
105
|
+
- `PROMPT_ID`: 从 generate/edit/video 命令返回的提示词 ID
|
|
106
|
+
- `-o, --output <目录>`: 输出目录(默认:./comfy-output)
|
|
107
|
+
- `--pretty`: 人类可读的输出
|
|
108
108
|
|
|
109
|
-
|
|
110
|
-
- JSON
|
|
109
|
+
**返回:**
|
|
110
|
+
- 包含已下载文件路径的 JSON
|
|
111
111
|
|
|
112
|
-
### 5.
|
|
112
|
+
### 5. 工作流管理
|
|
113
113
|
|
|
114
|
-
|
|
114
|
+
**列出工作流历史:**
|
|
115
115
|
```bash
|
|
116
116
|
comfy workflow list [--limit 10] [--pretty]
|
|
117
117
|
```
|
|
118
118
|
|
|
119
|
-
|
|
119
|
+
**获取工作流结果:**
|
|
120
120
|
```bash
|
|
121
121
|
comfy workflow get <PROMPT_ID> [--pretty]
|
|
122
122
|
```
|
|
123
123
|
|
|
124
|
-
|
|
124
|
+
**提交自定义工作流:**
|
|
125
125
|
```bash
|
|
126
|
-
comfy workflow submit
|
|
126
|
+
comfy workflow submit <工作流文件> [--pretty]
|
|
127
127
|
```
|
|
128
128
|
|
|
129
|
-
### 6.
|
|
129
|
+
### 6. 队列管理
|
|
130
130
|
|
|
131
|
-
|
|
131
|
+
**检查队列状态:**
|
|
132
132
|
```bash
|
|
133
133
|
comfy queue status [--pretty]
|
|
134
134
|
```
|
|
135
135
|
|
|
136
|
-
|
|
136
|
+
**清空队列:**
|
|
137
137
|
```bash
|
|
138
138
|
comfy queue clear --confirm [--pretty]
|
|
139
139
|
```
|
|
140
140
|
|
|
141
|
-
|
|
141
|
+
**删除队列项:**
|
|
142
142
|
```bash
|
|
143
|
-
comfy queue delete
|
|
143
|
+
comfy queue delete <项目ID> [--pretty]
|
|
144
144
|
```
|
|
145
145
|
|
|
146
|
-
|
|
146
|
+
**中断当前执行:**
|
|
147
147
|
```bash
|
|
148
148
|
comfy interrupt [--pretty]
|
|
149
149
|
```
|
|
150
150
|
|
|
151
|
-
### 7.
|
|
151
|
+
### 7. 模型管理
|
|
152
152
|
|
|
153
|
-
|
|
153
|
+
**列出可用模型:**
|
|
154
154
|
```bash
|
|
155
155
|
comfy model list [--type checkpoints|loras|vae|...] [--pretty]
|
|
156
156
|
```
|
|
157
157
|
|
|
158
|
-
|
|
159
|
-
- `checkpoints`: Stable Diffusion / FLUX
|
|
160
|
-
- `loras`: LoRA
|
|
161
|
-
- `vae`: VAE
|
|
162
|
-
- `controlnet`: ControlNet
|
|
163
|
-
- `upscale_models`:
|
|
158
|
+
**模型类型:**
|
|
159
|
+
- `checkpoints`: Stable Diffusion / FLUX 检查点模型
|
|
160
|
+
- `loras`: LoRA 模型
|
|
161
|
+
- `vae`: VAE 模型
|
|
162
|
+
- `controlnet`: ControlNet 模型
|
|
163
|
+
- `upscale_models`: 放大模型
|
|
164
164
|
|
|
165
|
-
### 8.
|
|
165
|
+
### 8. 系统信息
|
|
166
166
|
|
|
167
|
-
|
|
167
|
+
**获取系统状态:**
|
|
168
168
|
```bash
|
|
169
169
|
comfy system stats [--pretty]
|
|
170
170
|
```
|
|
171
171
|
|
|
172
|
-
|
|
172
|
+
返回:GPU/CPU 使用率、内存、设备信息
|
|
173
173
|
|
|
174
|
-
### 9.
|
|
174
|
+
### 9. 配置
|
|
175
175
|
|
|
176
|
-
|
|
176
|
+
**设置 ComfyUI 服务器地址(首次使用必需):**
|
|
177
177
|
```bash
|
|
178
178
|
comfy config set server http://localhost:8188
|
|
179
179
|
```
|
|
180
180
|
|
|
181
|
-
|
|
181
|
+
**查看当前配置:**
|
|
182
182
|
```bash
|
|
183
183
|
comfy config list [--pretty]
|
|
184
184
|
```
|
|
185
185
|
|
|
186
|
-
|
|
186
|
+
**其他配置选项:**
|
|
187
187
|
```bash
|
|
188
188
|
comfy config set timeout 30000
|
|
189
189
|
comfy config set outputDir ./my-outputs
|
|
190
190
|
```
|
|
191
191
|
|
|
192
|
-
##
|
|
192
|
+
## 输出格式
|
|
193
193
|
|
|
194
|
-
|
|
194
|
+
所有命令默认输出 **JSON 格式**(AI 友好,减少 50%+ token):
|
|
195
195
|
|
|
196
196
|
```json
|
|
197
197
|
{
|
|
@@ -204,238 +204,238 @@ All commands default to **JSON output** (AI-friendly, reduces 50%+ tokens):
|
|
|
204
204
|
}
|
|
205
205
|
```
|
|
206
206
|
|
|
207
|
-
|
|
207
|
+
使用 `--pretty` 标志获取带颜色的人类可读表格格式。
|
|
208
208
|
|
|
209
|
-
##
|
|
209
|
+
## 工作流示例
|
|
210
210
|
|
|
211
|
-
###
|
|
212
|
-
|
|
211
|
+
### 示例 1:快速生成图像
|
|
212
|
+
**用户**:"帮我生成一张猫的图片"
|
|
213
213
|
|
|
214
|
-
|
|
214
|
+
**助手**:
|
|
215
215
|
```bash
|
|
216
216
|
comfy generate "a cute cat"
|
|
217
217
|
```
|
|
218
218
|
|
|
219
|
-
|
|
219
|
+
**结果**:返回包含 `prompt_id` 和 `outputs`(包含图像文件路径)的 JSON。默认行为等待完成并通过 WebSocket 显示实时进度。
|
|
220
220
|
|
|
221
|
-
###
|
|
222
|
-
|
|
221
|
+
### 示例 2:高分辨率图像
|
|
222
|
+
**用户**:"生成一张 1920x1080 的风景画"
|
|
223
223
|
|
|
224
|
-
|
|
224
|
+
**助手**:
|
|
225
225
|
```bash
|
|
226
226
|
comfy generate "beautiful landscape with mountains and lake" --width 1920 --height 1080
|
|
227
227
|
```
|
|
228
228
|
|
|
229
|
-
###
|
|
230
|
-
|
|
229
|
+
### 示例 3:图像风格转换
|
|
230
|
+
**用户**:"把这张图片改成动漫风格"
|
|
231
231
|
|
|
232
|
-
|
|
232
|
+
**助手**(假设用户上传了 `photo.jpg`):
|
|
233
233
|
```bash
|
|
234
234
|
comfy edit photo.jpg "anime style"
|
|
235
235
|
```
|
|
236
236
|
|
|
237
|
-
###
|
|
238
|
-
|
|
237
|
+
### 示例 4:添加细节的图像编辑
|
|
238
|
+
**用户**:"给这张照片添加更多细节,提高质量"
|
|
239
239
|
|
|
240
|
-
|
|
240
|
+
**助手**:
|
|
241
241
|
```bash
|
|
242
242
|
comfy edit photo.jpg "add more details, enhance quality, 4k resolution"
|
|
243
243
|
```
|
|
244
244
|
|
|
245
|
-
###
|
|
246
|
-
|
|
245
|
+
### 示例 5:视频创建
|
|
246
|
+
**用户**:"用这张人物图片生成一个视频"
|
|
247
247
|
|
|
248
|
-
|
|
248
|
+
**助手**:
|
|
249
249
|
```bash
|
|
250
250
|
comfy video portrait.png --prompt "smooth motion, natural movement"
|
|
251
251
|
```
|
|
252
252
|
|
|
253
|
-
###
|
|
254
|
-
|
|
253
|
+
### 示例 6:非阻塞生成
|
|
254
|
+
**用户**:"生成一张图片,不用等完成"
|
|
255
255
|
|
|
256
|
-
|
|
256
|
+
**助手**:
|
|
257
257
|
```bash
|
|
258
258
|
comfy generate "sunset over ocean" --no-wait
|
|
259
259
|
```
|
|
260
260
|
|
|
261
|
-
|
|
261
|
+
立即返回 `prompt_id`。稍后检查状态:
|
|
262
262
|
```bash
|
|
263
263
|
comfy workflow get <prompt_id>
|
|
264
264
|
```
|
|
265
265
|
|
|
266
|
-
###
|
|
267
|
-
|
|
266
|
+
### 示例 7:批量图像生成
|
|
267
|
+
**用户**:"帮我生成 3 张不同的猫的图片"
|
|
268
268
|
|
|
269
|
-
|
|
269
|
+
**助手**:
|
|
270
270
|
```bash
|
|
271
271
|
comfy generate "a cute cat sitting" --no-wait
|
|
272
272
|
comfy generate "a cat playing with toys" --no-wait
|
|
273
273
|
comfy generate "a cat sleeping on a couch" --no-wait
|
|
274
274
|
```
|
|
275
275
|
|
|
276
|
-
|
|
276
|
+
然后检查队列状态:
|
|
277
277
|
```bash
|
|
278
278
|
comfy queue status
|
|
279
279
|
```
|
|
280
280
|
|
|
281
|
-
###
|
|
282
|
-
|
|
281
|
+
### 示例 8:检查模型后生成
|
|
282
|
+
**用户**:"检查一下有哪些可用的模型,然后生成图片"
|
|
283
283
|
|
|
284
|
-
|
|
284
|
+
**助手**:
|
|
285
285
|
```bash
|
|
286
|
-
#
|
|
286
|
+
# 首先检查可用模型
|
|
287
287
|
comfy model list --type checkpoints
|
|
288
288
|
|
|
289
|
-
#
|
|
289
|
+
# 然后使用适当的提示词生成
|
|
290
290
|
comfy generate "a beautiful portrait"
|
|
291
291
|
```
|
|
292
292
|
|
|
293
|
-
###
|
|
294
|
-
|
|
293
|
+
### 示例 9:完整工作流
|
|
294
|
+
**用户**:"生成一张图片,编辑它,然后生成视频"
|
|
295
295
|
|
|
296
|
-
|
|
296
|
+
**助手**:
|
|
297
297
|
```bash
|
|
298
|
-
# 1.
|
|
298
|
+
# 1. 生成基础图像
|
|
299
299
|
comfy generate "a portrait of a woman"
|
|
300
|
-
#
|
|
300
|
+
# 输出:./comfy-output/image_001.png
|
|
301
301
|
|
|
302
|
-
# 2.
|
|
302
|
+
# 2. 编辑图像
|
|
303
303
|
comfy edit ./comfy-output/image_001.png "add cinematic lighting"
|
|
304
|
-
#
|
|
304
|
+
# 输出:./comfy-output/image_002.png
|
|
305
305
|
|
|
306
|
-
# 3.
|
|
306
|
+
# 3. 从编辑后的图像创建视频
|
|
307
307
|
comfy video ./comfy-output/image_002.png --prompt "slow motion, cinematic"
|
|
308
|
-
#
|
|
308
|
+
# 输出:./comfy-output/video_001.mp4
|
|
309
309
|
```
|
|
310
310
|
|
|
311
|
-
##
|
|
311
|
+
## 最佳实践
|
|
312
312
|
|
|
313
|
-
### 1.
|
|
314
|
-
-
|
|
315
|
-
- **Pretty
|
|
316
|
-
-
|
|
313
|
+
### 1. 输出格式选择
|
|
314
|
+
- **默认(JSON)**:最适合 AI 代理、编程解析,减少 token
|
|
315
|
+
- **Pretty 模式**:最适合人工检查、调试、视觉反馈
|
|
316
|
+
- 当用户明确要求查看格式化输出时使用 `--pretty`
|
|
317
317
|
|
|
318
|
-
### 2.
|
|
319
|
-
-
|
|
320
|
-
- **--no-wait
|
|
321
|
-
-
|
|
318
|
+
### 2. 等待策略
|
|
319
|
+
- **默认(wait)**:推荐用于交互式工作流,显示实时进度
|
|
320
|
+
- **--no-wait**:用于提交多个任务、批处理或耗时操作
|
|
321
|
+
- 使用 `--no-wait` 后,用 `comfy workflow get <prompt_id>` 检查完成状态
|
|
322
322
|
|
|
323
|
-
### 3.
|
|
324
|
-
-
|
|
325
|
-
-
|
|
326
|
-
1. ComfyUI
|
|
327
|
-
2.
|
|
328
|
-
3.
|
|
323
|
+
### 3. 错误处理
|
|
324
|
+
- 始终检查 JSON 响应中的 `success` 字段
|
|
325
|
+
- 如果发生错误,检查:
|
|
326
|
+
1. ComfyUI 服务器是否运行:`comfy system stats`
|
|
327
|
+
2. 服务器地址是否正确:`comfy config list`
|
|
328
|
+
3. 队列是否卡住:`comfy queue status`
|
|
329
329
|
|
|
330
|
-
### 4.
|
|
331
|
-
-
|
|
332
|
-
-
|
|
333
|
-
-
|
|
330
|
+
### 4. 性能优化
|
|
331
|
+
- 使用适当的图像尺寸(SD 用 1024x1024,视频用 512x512)
|
|
332
|
+
- 批量操作时考虑使用 `--no-wait`
|
|
333
|
+
- 大型生成前检查系统资源:`comfy system stats`
|
|
334
334
|
|
|
335
|
-
### 5.
|
|
336
|
-
|
|
335
|
+
### 5. 首次设置
|
|
336
|
+
首次使用前务必配置服务器地址:
|
|
337
337
|
```bash
|
|
338
338
|
comfy config set server http://localhost:8188
|
|
339
339
|
```
|
|
340
340
|
|
|
341
|
-
##
|
|
341
|
+
## 常用模式
|
|
342
342
|
|
|
343
|
-
###
|
|
343
|
+
### 模式 1:生成并下载
|
|
344
344
|
```bash
|
|
345
|
-
#
|
|
345
|
+
# 生成图像
|
|
346
346
|
comfy generate "a cat" --no-wait
|
|
347
|
-
#
|
|
347
|
+
# 返回:{ "prompt_id": "abc123" }
|
|
348
348
|
|
|
349
|
-
#
|
|
349
|
+
# 稍后下载结果
|
|
350
350
|
comfy download abc123
|
|
351
351
|
```
|
|
352
352
|
|
|
353
|
-
###
|
|
353
|
+
### 模式 2:迭代编辑
|
|
354
354
|
```bash
|
|
355
|
-
#
|
|
355
|
+
# 从基础图像开始
|
|
356
356
|
comfy generate "a portrait"
|
|
357
357
|
|
|
358
|
-
#
|
|
358
|
+
# 编辑步骤 1
|
|
359
359
|
comfy edit output_001.png "add dramatic lighting"
|
|
360
360
|
|
|
361
|
-
#
|
|
361
|
+
# 编辑步骤 2
|
|
362
362
|
comfy edit output_002.png "increase contrast"
|
|
363
363
|
```
|
|
364
364
|
|
|
365
|
-
###
|
|
365
|
+
### 模式 3:队列管理
|
|
366
366
|
```bash
|
|
367
|
-
#
|
|
367
|
+
# 提交多个任务
|
|
368
368
|
comfy generate "cat" --no-wait
|
|
369
369
|
comfy generate "dog" --no-wait
|
|
370
370
|
comfy generate "bird" --no-wait
|
|
371
371
|
|
|
372
|
-
#
|
|
372
|
+
# 检查队列
|
|
373
373
|
comfy queue status
|
|
374
374
|
|
|
375
|
-
#
|
|
375
|
+
# 如需要,清空队列
|
|
376
376
|
comfy queue clear --confirm
|
|
377
377
|
```
|
|
378
378
|
|
|
379
|
-
##
|
|
379
|
+
## 提示
|
|
380
380
|
|
|
381
|
-
|
|
382
|
-
-
|
|
383
|
-
-
|
|
384
|
-
-
|
|
381
|
+
**服务器连接:**
|
|
382
|
+
- 默认服务器:`http://localhost:8188`
|
|
383
|
+
- 远程服务器:`comfy config set server http://remote-ip:8188`
|
|
384
|
+
- 检查连接:`comfy system stats`
|
|
385
385
|
|
|
386
|
-
|
|
387
|
-
- ComfyUI
|
|
388
|
-
-
|
|
389
|
-
-
|
|
386
|
+
**模型选择:**
|
|
387
|
+
- ComfyUI 自动使用默认检查点模型
|
|
388
|
+
- 检查可用模型:`comfy model list --type checkpoints`
|
|
389
|
+
- 自定义工作流:`comfy workflow submit custom.json`
|
|
390
390
|
|
|
391
|
-
|
|
392
|
-
-
|
|
393
|
-
-
|
|
394
|
-
-
|
|
391
|
+
**输出文件:**
|
|
392
|
+
- 默认输出目录:`./comfy-output/`
|
|
393
|
+
- 修改:`comfy config set outputDir ./my-outputs`
|
|
394
|
+
- 下载的文件保留原始 ComfyUI 文件名
|
|
395
395
|
|
|
396
|
-
|
|
397
|
-
-
|
|
398
|
-
-
|
|
399
|
-
-
|
|
396
|
+
**实时进度:**
|
|
397
|
+
- 默认等待模式通过 WebSocket 显示进度
|
|
398
|
+
- 进度包括:节点执行、当前步骤、百分比
|
|
399
|
+
- 使用 `--no-wait` 跳过进度监控
|
|
400
400
|
|
|
401
|
-
|
|
402
|
-
-
|
|
403
|
-
-
|
|
401
|
+
**中断:**
|
|
402
|
+
- 停止当前生成:`comfy interrupt`
|
|
403
|
+
- 清空待处理任务:`comfy queue clear --confirm`
|
|
404
404
|
|
|
405
|
-
**JSON
|
|
406
|
-
-
|
|
407
|
-
-
|
|
408
|
-
-
|
|
409
|
-
-
|
|
405
|
+
**JSON 解析:**
|
|
406
|
+
- 所有 JSON 响应遵循一致的结构
|
|
407
|
+
- 首先检查 `success` 字段
|
|
408
|
+
- 通过 `data` 字段访问数据
|
|
409
|
+
- 错误包含带详细信息的 `error` 字段
|
|
410
410
|
|
|
411
|
-
##
|
|
411
|
+
## 配置
|
|
412
412
|
|
|
413
|
-
|
|
413
|
+
配置文件位置:`~/.comfy-cli/config.json`
|
|
414
414
|
|
|
415
|
-
|
|
416
|
-
- `server`: ComfyUI
|
|
417
|
-
- `timeout`:
|
|
418
|
-
- `autoConnect`:
|
|
419
|
-
- `outputDir`:
|
|
415
|
+
**可用设置:**
|
|
416
|
+
- `server`: ComfyUI 服务器地址(必需)
|
|
417
|
+
- `timeout`: 请求超时时间(毫秒,默认:30000)
|
|
418
|
+
- `autoConnect`: 自动连接到 WebSocket(默认:true)
|
|
419
|
+
- `outputDir`: 默认输出目录(默认:`./comfy-output`)
|
|
420
420
|
|
|
421
|
-
##
|
|
421
|
+
## 故障排除
|
|
422
422
|
|
|
423
|
-
**"Connection refused"
|
|
424
|
-
-
|
|
425
|
-
-
|
|
426
|
-
-
|
|
423
|
+
**"Connection refused" 错误:**
|
|
424
|
+
- 确保 ComfyUI 正在运行:在浏览器检查 http://localhost:8188
|
|
425
|
+
- 验证服务器地址:`comfy config list`
|
|
426
|
+
- 测试连接:`comfy system stats`
|
|
427
427
|
|
|
428
|
-
**"Workflow failed"
|
|
429
|
-
-
|
|
430
|
-
-
|
|
431
|
-
-
|
|
428
|
+
**"Workflow failed" 错误:**
|
|
429
|
+
- 检查 JSON 响应中的错误详情
|
|
430
|
+
- 验证模型文件可用:`comfy model list`
|
|
431
|
+
- 检查 ComfyUI 控制台日志
|
|
432
432
|
|
|
433
|
-
|
|
434
|
-
-
|
|
435
|
-
-
|
|
436
|
-
-
|
|
433
|
+
**生成缓慢:**
|
|
434
|
+
- 检查 GPU 可用性:`comfy system stats`
|
|
435
|
+
- 降低图像分辨率
|
|
436
|
+
- 检查队列:`comfy queue status`
|
|
437
437
|
|
|
438
|
-
|
|
439
|
-
-
|
|
440
|
-
-
|
|
441
|
-
-
|
|
438
|
+
**输出文件丢失:**
|
|
439
|
+
- 检查输出目录:`comfy config list`
|
|
440
|
+
- 验证生成已完成:`comfy workflow get <prompt_id>`
|
|
441
|
+
- 使用 `comfy download <prompt_id>` 重新下载
|