@optima-chat/optima-agent 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/.claude/skills/comfy/SKILL.md +102 -122
- package/dist/bin/bi-cli.js +0 -0
- package/dist/bin/comfy.js +0 -0
- package/dist/bin/commerce.js +0 -0
- package/dist/bin/google-ads.js +0 -0
- package/dist/bin/optima.js +0 -0
- package/dist/bin/scout.js +0 -0
- package/package.json +1 -1
|
@@ -1,189 +1,169 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: comfy
|
|
3
|
-
description: "
|
|
3
|
+
description: "生成和编辑图片/视频。使用场景:生成图片(generate images/生成图片/画图)、编辑图片(edit images/编辑图片/图生图/风格转换)、生成视频(create videos/图生视频)。"
|
|
4
4
|
---
|
|
5
5
|
|
|
6
|
-
#
|
|
6
|
+
# 图像视频生成工具
|
|
7
7
|
|
|
8
8
|
## 标准工作流程
|
|
9
9
|
|
|
10
10
|
```bash
|
|
11
|
-
#
|
|
12
|
-
comfy
|
|
11
|
+
# 文生图
|
|
12
|
+
comfy image "提示词" -o /工作目录/result.png
|
|
13
13
|
|
|
14
|
-
#
|
|
15
|
-
comfy
|
|
14
|
+
# 图片编辑/风格转换
|
|
15
|
+
comfy image "转成水彩风格" -i photo.png -o /工作目录/result.png
|
|
16
16
|
|
|
17
|
-
#
|
|
18
|
-
Read
|
|
17
|
+
# 读取并描述结果
|
|
18
|
+
Read /工作目录/result.png
|
|
19
19
|
```
|
|
20
20
|
|
|
21
|
-
##
|
|
21
|
+
## comfy image 命令
|
|
22
22
|
|
|
23
|
-
|
|
24
|
-
1. 使用 `comfy generate "提示词"` - 命令会自动等待,不要手动检查状态
|
|
25
|
-
2. 下载结果:`comfy download <prompt_id> -o <完整文件路径含文件名>`
|
|
26
|
-
3. 使用 Read 工具读取下载的图片
|
|
27
|
-
4. 向用户描述图片内容(颜色、风格、构图、元素)
|
|
23
|
+
统一的图像生成/编辑命令。
|
|
28
24
|
|
|
29
|
-
### 下载文件时
|
|
30
|
-
- 必须指定完整文件路径,包含文件名
|
|
31
|
-
- 必须使用用户的工作目录
|
|
32
|
-
- 不能只指定目录(会导致 EISDIR 错误)
|
|
33
|
-
|
|
34
|
-
示例:
|
|
35
25
|
```bash
|
|
36
|
-
|
|
37
|
-
comfy download abc123 -o /Users/john/project/result.png
|
|
38
|
-
|
|
39
|
-
# 错误 - 会失败
|
|
40
|
-
comfy download abc123 -o /Users/john/project
|
|
26
|
+
comfy image <prompt> [options]
|
|
41
27
|
```
|
|
42
28
|
|
|
43
|
-
###
|
|
44
|
-
- 始终使用 Read 工具查看生成的图片
|
|
45
|
-
- 向用户描述图片内容
|
|
46
|
-
- 验证是否符合用户要求
|
|
47
|
-
- 如需改进,提供优化建议
|
|
29
|
+
### 参数
|
|
48
30
|
|
|
49
|
-
|
|
31
|
+
| 参数 | 说明 |
|
|
32
|
+
|------|------|
|
|
33
|
+
| `-i, --input <path>` | 输入图像(可多次使用,最多 8 张) |
|
|
34
|
+
| `-w, --width <px>` | 输出宽度(默认 1024,必须是 16 的倍数) |
|
|
35
|
+
| `-h, --height <px>` | 输出高度(默认 1024,必须是 16 的倍数) |
|
|
36
|
+
| `-o, --output <path>` | 输出目录或完整路径 |
|
|
37
|
+
| `-s, --seed <number>` | 随机种子(可复现结果) |
|
|
38
|
+
| `-f, --format <fmt>` | 输出格式:jpeg \| png |
|
|
50
39
|
|
|
51
|
-
|
|
52
|
-
```bash
|
|
53
|
-
comfy generate "提示词" [--width 1024] [--height 1024]
|
|
54
|
-
```
|
|
55
|
-
- 从文本提示词生成图片
|
|
56
|
-
- 默认尺寸:1024x1024
|
|
57
|
-
- 自动等待完成
|
|
58
|
-
- 返回 prompt_id 用于下载
|
|
40
|
+
## 工作流示例
|
|
59
41
|
|
|
60
|
-
###
|
|
61
|
-
```bash
|
|
62
|
-
comfy edit <图片路径> "编辑描述"
|
|
63
|
-
```
|
|
64
|
-
- 根据文本提示词修改现有图片
|
|
65
|
-
- 可以改变风格、添加元素、调整光线
|
|
66
|
-
- 自动等待完成
|
|
42
|
+
### 文生图
|
|
67
43
|
|
|
68
|
-
### 生成视频
|
|
69
44
|
```bash
|
|
70
|
-
comfy
|
|
45
|
+
comfy image "a cute fluffy cat sitting on a windowsill, natural lighting" -o /Users/john/project/cat.png
|
|
46
|
+
Read /Users/john/project/cat.png
|
|
71
47
|
```
|
|
72
|
-
- 从静态图片生成视频
|
|
73
|
-
- 推荐分辨率:512x512
|
|
74
|
-
- 可选:运动提示词和负向提示词
|
|
75
|
-
- 自动等待完成
|
|
76
48
|
|
|
77
|
-
###
|
|
49
|
+
### 图片风格转换
|
|
50
|
+
|
|
78
51
|
```bash
|
|
79
|
-
comfy
|
|
52
|
+
comfy image "watercolor painting style, artistic brushstrokes" -i photo.jpg -o /Users/john/project/watercolor.png
|
|
53
|
+
Read /Users/john/project/watercolor.png
|
|
80
54
|
```
|
|
81
|
-
- 下载生成的文件到指定路径
|
|
82
|
-
- 路径必须包含文件名和扩展名
|
|
83
|
-
- 必须在用户的工作目录下
|
|
84
55
|
|
|
85
|
-
|
|
56
|
+
### 多图风格融合
|
|
86
57
|
|
|
87
|
-
|
|
88
|
-
用户:"生成一张猫的图片"
|
|
58
|
+
将第一张图的风格应用到第二张图的内容上:
|
|
89
59
|
|
|
90
60
|
```bash
|
|
91
|
-
comfy
|
|
92
|
-
|
|
93
|
-
Read /Users/john/project/cat.png
|
|
61
|
+
comfy image "apply the artistic style from image 1 to the content of image 2" -i style.png -i content.png -o /Users/john/project/fusion.png
|
|
62
|
+
Read /Users/john/project/fusion.png
|
|
94
63
|
```
|
|
95
|
-
然后描述:"我生成了一张猫的图片。图片展示了一只蓬松的小猫坐在窗台上,自然光线下。猫咪有【描述颜色、表情、细节】。"
|
|
96
64
|
|
|
97
|
-
###
|
|
98
|
-
|
|
65
|
+
### 多图元素组合
|
|
66
|
+
|
|
67
|
+
从多张图中提取元素组合成新图:
|
|
99
68
|
|
|
100
69
|
```bash
|
|
101
|
-
comfy
|
|
102
|
-
comfy download def456 -o /Users/john/project/poster.png
|
|
103
|
-
Read /Users/john/project/poster.png
|
|
70
|
+
comfy image "The person from image 1 is petting the cat from image 2, in a cozy living room" -i person.jpg -i cat.jpg -o /Users/john/project/combined.png
|
|
104
71
|
```
|
|
105
|
-
然后描述海报的风格、颜色、角色、构图。
|
|
106
72
|
|
|
107
|
-
###
|
|
108
|
-
|
|
73
|
+
### 精确颜色控制
|
|
74
|
+
|
|
75
|
+
使用 hex code 指定精确颜色:
|
|
109
76
|
|
|
110
77
|
```bash
|
|
111
|
-
comfy
|
|
112
|
-
comfy download ghi789 -o /Users/john/project/portrait-anime.png
|
|
113
|
-
Read /Users/john/project/portrait-anime.png
|
|
78
|
+
comfy image "a modern logo with brand color #02eb3c as the primary accent" -o /Users/john/project/logo.png
|
|
114
79
|
```
|
|
115
|
-
然后描述动漫风格转换的效果。
|
|
116
80
|
|
|
117
|
-
###
|
|
118
|
-
用户:"把这张人像做成视频"
|
|
81
|
+
### 产品海报
|
|
119
82
|
|
|
120
83
|
```bash
|
|
121
|
-
comfy
|
|
122
|
-
comfy download jkl012 -o /Users/john/project/portrait-video.mp4
|
|
84
|
+
comfy image "Disney Pixar style 3D poster, [产品描述], cute character, vibrant gradient background, professional studio lighting" -w 1024 -h 1024 -o /Users/john/project/poster.png
|
|
123
85
|
```
|
|
124
|
-
视频文件无需读取,直接告知用户文件路径即可。
|
|
125
86
|
|
|
126
|
-
##
|
|
87
|
+
## 提示词指南(FLUX.2)
|
|
127
88
|
|
|
128
89
|
### 结构
|
|
129
|
-
- 具体明确:"a golden retriever puppy playing in a garden" 而非 "a dog"
|
|
130
|
-
- 包含风格:"photorealistic"、"anime style"、"oil painting"、"Disney Pixar style"
|
|
131
|
-
- 添加细节:材质、光线、背景、氛围
|
|
132
|
-
- 使用英文以获得最佳效果(FLUX 模型对英文效果更好)
|
|
133
90
|
|
|
134
|
-
|
|
91
|
+
**Subject + Action + Style + Context**
|
|
92
|
+
|
|
93
|
+
词序很重要,靠前的元素优先级更高。
|
|
94
|
+
|
|
95
|
+
### 长度建议
|
|
96
|
+
|
|
97
|
+
| 长度 | 词数 | 适用场景 |
|
|
98
|
+
|------|------|----------|
|
|
99
|
+
| 短 | 10-30 | 快速概念探索 |
|
|
100
|
+
| 中 | 30-80 | 大多数项目(推荐) |
|
|
101
|
+
| 长 | 80+ | 复杂场景 |
|
|
102
|
+
|
|
103
|
+
### 最佳实践
|
|
104
|
+
|
|
105
|
+
| 技巧 | 说明 | 示例 |
|
|
106
|
+
|------|------|------|
|
|
107
|
+
| 描述想要的 | 不支持负向提示词 | "sharp focus" 而非 "no blur" |
|
|
108
|
+
| 精确颜色 | 使用 hex code | `"brand color #1a1a2e"` |
|
|
109
|
+
| 文字渲染 | 用引号包裹文字 | `"The text 'OPEN' in red neon"` |
|
|
110
|
+
| 摄影风格 | 指定相机/镜头 | `"shot on Fujifilm X-T5, 35mm f/1.4"` |
|
|
111
|
+
| 多语言 | 用原生语言更地道 | 法语描述巴黎场景 |
|
|
112
|
+
|
|
113
|
+
### 示例对比
|
|
114
|
+
|
|
135
115
|
```bash
|
|
136
|
-
#
|
|
137
|
-
comfy
|
|
116
|
+
# 简单
|
|
117
|
+
comfy image "a robot"
|
|
138
118
|
|
|
139
|
-
#
|
|
140
|
-
comfy
|
|
119
|
+
# 添加风格
|
|
120
|
+
comfy image "a friendly AI robot, cute cartoon style, bright colors, 3D render"
|
|
141
121
|
|
|
142
|
-
#
|
|
143
|
-
comfy
|
|
122
|
+
# 完整描述
|
|
123
|
+
comfy image "Disney Pixar style 3D animated robot character, friendly cheerful expression, wearing headset, surrounded by floating icons, gradient purple-blue background, professional studio lighting, vibrant colors"
|
|
144
124
|
```
|
|
145
125
|
|
|
146
126
|
## 分辨率选择
|
|
147
127
|
|
|
128
|
+
尺寸必须是 **16 的倍数**,最大支持 4MP(推荐 2MP 内)。
|
|
129
|
+
|
|
148
130
|
| 用途 | 分辨率 |
|
|
149
131
|
|------|--------|
|
|
150
|
-
|
|
|
151
|
-
| 宽屏壁纸 |
|
|
132
|
+
| 社交媒体 | 1024x1024 |
|
|
133
|
+
| 宽屏壁纸 | 1920x1088 |
|
|
152
134
|
| 竖屏海报 | 768x1280 |
|
|
153
|
-
|
|
|
154
|
-
|
|
155
|
-
## 错误预防
|
|
156
|
-
|
|
157
|
-
### 不要做:
|
|
158
|
-
- 生成后立即检查状态(还未入队)
|
|
159
|
-
- 使用 sleep + 检查状态循环(命令会自动等待)
|
|
160
|
-
- 下载时只指定目录(必须包含文件名)
|
|
161
|
-
- 跳过读取生成的图片(用户需要看到描述)
|
|
162
|
-
|
|
163
|
-
### 必须做:
|
|
164
|
-
- 使用默认等待行为(不要添加 --no-wait)
|
|
165
|
-
- 下载时指定完整文件路径
|
|
166
|
-
- 读取生成的图片并描述给用户
|
|
167
|
-
- 使用英文提示词以获得更好效果
|
|
168
|
-
- 生成视频时使用 512x512 分辨率
|
|
135
|
+
| 视频输入 | 512x512 |
|
|
169
136
|
|
|
170
|
-
##
|
|
137
|
+
## 视频生成
|
|
171
138
|
|
|
172
139
|
```bash
|
|
173
|
-
comfy
|
|
174
|
-
comfy queue clear --confirm # 清空队列
|
|
175
|
-
comfy interrupt # 中断当前任务
|
|
140
|
+
comfy video <图片路径> --prompt "运动描述" --width 512 --height 512
|
|
176
141
|
```
|
|
177
142
|
|
|
178
|
-
|
|
143
|
+
从静态图片生成视频,推荐分辨率 512x512。
|
|
179
144
|
|
|
180
145
|
```bash
|
|
181
|
-
comfy
|
|
182
|
-
comfy
|
|
146
|
+
comfy video /Users/john/portrait.png --prompt "natural facial expression, subtle head movement" --width 512 --height 512
|
|
147
|
+
comfy download <prompt_id> -o /Users/john/project/video.mp4
|
|
183
148
|
```
|
|
184
149
|
|
|
185
|
-
##
|
|
150
|
+
## 必须遵守的规则
|
|
151
|
+
|
|
152
|
+
### 生成后
|
|
153
|
+
- 使用 Read 工具查看生成的图片
|
|
154
|
+
- 向用户描述图片内容(颜色、风格、构图、元素)
|
|
155
|
+
- 验证是否符合用户要求
|
|
156
|
+
|
|
157
|
+
### 尺寸要求
|
|
158
|
+
- 宽高必须是 16 的倍数
|
|
159
|
+
- 最大 4MP,推荐 2MP 内
|
|
186
160
|
|
|
187
|
-
|
|
188
|
-
-
|
|
189
|
-
|
|
161
|
+
### 多图参考
|
|
162
|
+
- 最多 8 张输入图
|
|
163
|
+
|
|
164
|
+
## 系统命令
|
|
165
|
+
|
|
166
|
+
```bash
|
|
167
|
+
comfy queue status # 队列状态
|
|
168
|
+
comfy interrupt # 中断任务
|
|
169
|
+
```
|
package/dist/bin/bi-cli.js
CHANGED
|
File without changes
|
package/dist/bin/comfy.js
CHANGED
|
File without changes
|
package/dist/bin/commerce.js
CHANGED
|
File without changes
|
package/dist/bin/google-ads.js
CHANGED
|
File without changes
|
package/dist/bin/optima.js
CHANGED
|
File without changes
|
package/dist/bin/scout.js
CHANGED
|
File without changes
|