@optima-chat/optima-agent 0.9.13 → 0.9.15
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/.kb-skills-managed.json +9 -9
- package/.claude/skills/ads/SKILL.md +244 -244
- package/.claude/skills/ads/template/campaign/CREATIVES.md +18 -18
- package/.claude/skills/ads/template/campaign/NOTES.md +10 -10
- package/.claude/skills/ads/template/campaign/STRATEGY.md +29 -29
- package/.claude/skills/ads/template/user/ADS.md +29 -29
- package/.claude/skills/ads/template/user/LEARNINGS.md +15 -15
- package/.claude/skills/ads/template/user/PROGRESS.md +20 -20
- package/.claude/skills/ads/template/user/README.md +25 -25
- package/.claude/skills/ads/template/user/assets/.gitignore +2 -2
- package/.claude/skills/bi/SKILL.md +131 -131
- package/.claude/skills/browser/SKILL.md +201 -201
- package/.claude/skills/channels/SKILL.md +188 -188
- package/.claude/skills/collection/SKILL.md +88 -88
- package/.claude/skills/douyin/SKILL.md +408 -408
- package/.claude/skills/ffmpeg/SKILL.md +164 -164
- package/.claude/skills/gen/SKILL.md +327 -279
- package/.claude/skills/growth/SKILL.md +90 -90
- package/.claude/skills/growth/template/ACCOUNTS.md +14 -14
- package/.claude/skills/growth/template/CALENDAR.md +7 -7
- package/.claude/skills/growth/template/COMMENTS.md +7 -7
- package/.claude/skills/growth/template/GROWTH.md +37 -37
- package/.claude/skills/growth/template/PROGRESS.md +4 -4
- package/.claude/skills/growth/template/README.md +20 -20
- package/.claude/skills/growth/template/TOPICS.md +7 -7
- package/.claude/skills/homepage/SKILL.md +177 -177
- package/.claude/skills/i18n/SKILL.md +517 -517
- package/.claude/skills/ingesting-sources/SKILL.md +94 -94
- package/.claude/skills/initializing-kb/SKILL.md +117 -117
- package/.claude/skills/instagram/SKILL.md +321 -321
- package/.claude/skills/inventory/SKILL.md +328 -328
- package/.claude/skills/kol-outreach/SKILL.md +232 -232
- package/.claude/skills/kol-outreach/template/campaign/CONFIG.md +60 -60
- package/.claude/skills/kol-outreach/template/campaign/KOLS.md +6 -6
- package/.claude/skills/kol-outreach/template/campaign/PROGRESS.md +3 -3
- package/.claude/skills/kol-outreach/template/campaign/TEMPLATES.md +88 -88
- package/.claude/skills/kol-outreach/template/merchant/BRAND.md +36 -36
- package/.claude/skills/kol-outreach/template/merchant/CAMPAIGNS.md +6 -6
- package/.claude/skills/kol-outreach/template/merchant/MERCHANT_LIMITS.md +16 -16
- package/.claude/skills/kol-outreach/template/merchant/PROGRESS.md +4 -4
- package/.claude/skills/kol-outreach/template/merchant/README.md +20 -20
- package/.claude/skills/linting-the-wiki/SKILL.md +68 -68
- package/.claude/skills/logistics/SKILL.md +180 -180
- package/.claude/skills/markdown-pdf/SKILL.md +72 -72
- package/.claude/skills/merchant/SKILL.md +110 -110
- package/.claude/skills/multigrid-poster/SKILL.md +192 -192
- package/.claude/skills/multigrid-poster/layouts/2x2.json +34 -34
- package/.claude/skills/multigrid-poster/layouts/3x3.json +43 -43
- package/.claude/skills/multigrid-poster/scripts/compose.py +116 -116
- package/.claude/skills/order/SKILL.md +452 -452
- package/.claude/skills/product/SKILL.md +379 -379
- package/.claude/skills/product-page/SKILL.md +106 -106
- package/.claude/skills/querying-the-wiki/SKILL.md +59 -59
- package/.claude/skills/reddit/SKILL.md +277 -277
- package/.claude/skills/review/SKILL.md +321 -321
- package/.claude/skills/scout/SKILL.md +575 -575
- package/.claude/skills/sentinel/SKILL.md +281 -281
- package/.claude/skills/shein/SKILL.md +246 -246
- package/.claude/skills/shipping/SKILL.md +200 -200
- package/.claude/skills/shop-content/SKILL.md +101 -101
- package/.claude/skills/shopify/SKILL.md +282 -282
- package/.claude/skills/skillify/SKILL.md +114 -114
- package/.claude/skills/taobao/SKILL.md +238 -238
- package/.claude/skills/tiktok/SKILL.md +381 -381
- package/.claude/skills/twitter/SKILL.md +302 -302
- package/.claude/skills/updating-related-pages/SKILL.md +65 -65
- package/.claude/skills/video-edit/SKILL.md +123 -138
- package/.claude/skills/video-gen/SKILL.md +720 -720
- package/.claude/skills/video-gen/templates/INDEX.md +78 -78
- package/.claude/skills/video-gen/templates/before-after-beauty.md +183 -183
- package/.claude/skills/video-gen/templates/drama-fmcg.md +183 -183
- package/.claude/skills/video-gen/templates/kol-reaction-food.md +193 -193
- package/.claude/skills/video-gen/templates/multi-point-apparel.md +185 -185
- package/.claude/skills/video-gen/templates/pain-solution-home.md +184 -184
- package/.claude/skills/video-gen/templates/pdp-360-showcase.md +189 -189
- package/.claude/skills/video-gen/templates/pdp-feature-highlight.md +182 -182
- package/.claude/skills/video-gen/templates/scene-digital.md +183 -183
- package/.claude/skills/wechat/SKILL.md +174 -174
- package/.claude/skills/xhs/SKILL.md +170 -170
- package/README.md +276 -276
- package/dist/bin/optima.js +26 -26
- package/dist/bin/serve.js +23 -23
- package/dist/src/agent.d.ts +1 -1
- package/dist/src/agent.js +4 -4
- package/dist/src/system-prompt.js +175 -175
- package/dist/src/tools/memory.js +10 -10
- package/dist/src/ui/headless.js +7 -7
- package/package.json +79 -79
- package/dist/bin/video-edit.d.ts +0 -3
- package/dist/bin/video-edit.d.ts.map +0 -1
- package/dist/bin/video-edit.js +0 -153
- package/dist/bin/video-edit.js.map +0 -1
|
@@ -1,279 +1,327 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: gen
|
|
3
|
-
description: "生成和编辑图片/语音/虚拟试穿。使用场景:生成图片(generate images/生成图片/画图)、编辑图片(edit images/编辑图片/图生图/风格转换)、文本转语音(TTS/语音合成/朗读)、语音识别(ASR/语音转文字/转录)、虚拟试穿(virtual try-on/试穿/换装/试衣)。视频生成请使用 video-gen skill。"
|
|
4
|
-
---
|
|
5
|
-
|
|
6
|
-
# AI 内容生成工具
|
|
7
|
-
|
|
8
|
-
## 图片生成
|
|
9
|
-
|
|
10
|
-
### 标准工作流程
|
|
11
|
-
|
|
12
|
-
```bash
|
|
13
|
-
# 文生图
|
|
14
|
-
gen image "提示词" -o /home/aiuser/project/result.png
|
|
15
|
-
|
|
16
|
-
# 图片编辑/风格转换
|
|
17
|
-
gen image "转成水彩风格" -i photo.png -o /home/aiuser/project/result.png
|
|
18
|
-
|
|
19
|
-
# 读取并描述结果
|
|
20
|
-
Read /home/aiuser/project/result.png
|
|
21
|
-
```
|
|
22
|
-
|
|
23
|
-
### gen image 命令
|
|
24
|
-
|
|
25
|
-
统一的图像生成/编辑命令。
|
|
26
|
-
|
|
27
|
-
```bash
|
|
28
|
-
gen image <prompt> [options]
|
|
29
|
-
```
|
|
30
|
-
|
|
31
|
-
#### 参数
|
|
32
|
-
|
|
33
|
-
| 参数 | 说明 |
|
|
34
|
-
|------|------|
|
|
35
|
-
| `-i, --input <path>` | 输入图像(可多次使用,最多 8 张) |
|
|
36
|
-
| `-W, --width <px>` | 输出宽度(默认 1024,最大 2048) |
|
|
37
|
-
| `-H, --height <px>` | 输出高度(默认 1024,最大 2048) |
|
|
38
|
-
| `-o, --output <path>` | 输出目录或完整路径 |
|
|
39
|
-
| `-s, --seed <number>` | 随机种子(可复现结果) |
|
|
40
|
-
| `-f, --format <fmt>` | 输出格式:jpeg \| png |
|
|
41
|
-
| `--provider <name>` | 供应商:grsai(默认) \| bfl |
|
|
42
|
-
| `-m, --model <model>` | 模型:gpt-image-2(默认) \| nano-banana-fast \| nano-banana-pro \| flux-kontext-pro \| flux-kontext-max 等 |
|
|
43
|
-
| `--aspect-ratio <ratio>` | 宽高比:1:1 \| 16:9 \| 9:16 \| 4:3 等 |
|
|
44
|
-
| `--image-size <size>` | nano-banana-pro 输出尺寸:1K \| 2K \| 4K |
|
|
45
|
-
|
|
46
|
-
### 工作流示例
|
|
47
|
-
|
|
48
|
-
#### 文生图
|
|
49
|
-
|
|
50
|
-
```bash
|
|
51
|
-
gen image "a cute fluffy cat sitting on a windowsill, natural lighting" -o /home/aiuser/project/cat.png
|
|
52
|
-
Read /home/aiuser/project/cat.png
|
|
53
|
-
```
|
|
54
|
-
|
|
55
|
-
#### 图片风格转换
|
|
56
|
-
|
|
57
|
-
```bash
|
|
58
|
-
gen image "watercolor painting style, artistic brushstrokes" -i photo.jpg -o /home/aiuser/project/watercolor.png
|
|
59
|
-
Read /home/aiuser/project/watercolor.png
|
|
60
|
-
```
|
|
61
|
-
|
|
62
|
-
#### 多图风格融合
|
|
63
|
-
|
|
64
|
-
将第一张图的风格应用到第二张图的内容上:
|
|
65
|
-
|
|
66
|
-
```bash
|
|
67
|
-
gen image "apply the artistic style from image 1 to the content of image 2" -i style.png -i content.png -o /home/aiuser/project/fusion.png
|
|
68
|
-
Read /home/aiuser/project/fusion.png
|
|
69
|
-
```
|
|
70
|
-
|
|
71
|
-
#### 多图元素组合
|
|
72
|
-
|
|
73
|
-
从多张图中提取元素组合成新图:
|
|
74
|
-
|
|
75
|
-
```bash
|
|
76
|
-
gen 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 /home/aiuser/project/combined.png
|
|
77
|
-
```
|
|
78
|
-
|
|
79
|
-
#### 精确颜色控制
|
|
80
|
-
|
|
81
|
-
使用 hex code 指定精确颜色:
|
|
82
|
-
|
|
83
|
-
```bash
|
|
84
|
-
gen image "a modern logo with brand color #02eb3c as the primary accent" -o /home/aiuser/project/logo.png
|
|
85
|
-
```
|
|
86
|
-
|
|
87
|
-
#### 产品海报
|
|
88
|
-
|
|
89
|
-
```bash
|
|
90
|
-
gen image "Disney Pixar style 3D poster, [产品描述], cute character, vibrant gradient background, professional studio lighting" -W 1024 -H 1024 -o /home/aiuser/project/poster.png
|
|
91
|
-
```
|
|
92
|
-
|
|
93
|
-
### 提示词指南
|
|
94
|
-
|
|
95
|
-
#### 结构
|
|
96
|
-
|
|
97
|
-
**Subject + Action + Style + Context**
|
|
98
|
-
|
|
99
|
-
词序很重要,靠前的元素优先级更高。
|
|
100
|
-
|
|
101
|
-
#### 长度建议
|
|
102
|
-
|
|
103
|
-
| 长度 | 词数 | 适用场景 |
|
|
104
|
-
|------|------|----------|
|
|
105
|
-
| 短 | 10-30 | 快速概念探索 |
|
|
106
|
-
| 中 | 30-80 | 大多数项目(推荐) |
|
|
107
|
-
| 长 | 80+ | 复杂场景 |
|
|
108
|
-
|
|
109
|
-
#### 最佳实践
|
|
110
|
-
|
|
111
|
-
| 技巧 | 说明 | 示例 |
|
|
112
|
-
|------|------|------|
|
|
113
|
-
| 描述想要的 | 不支持负向提示词 | "sharp focus" 而非 "no blur" |
|
|
114
|
-
| 精确颜色 | 使用 hex code | `"brand color #1a1a2e"` |
|
|
115
|
-
| 文字渲染 | 用引号包裹文字 | `"The text 'OPEN' in red neon"` |
|
|
116
|
-
| 摄影风格 | 指定相机/镜头 | `"shot on Fujifilm X-T5, 35mm f/1.4"` |
|
|
117
|
-
| 多语言 | 用原生语言更地道 | 法语描述巴黎场景 |
|
|
118
|
-
|
|
119
|
-
#### 示例对比
|
|
120
|
-
|
|
121
|
-
```bash
|
|
122
|
-
# 简单
|
|
123
|
-
gen image "a robot"
|
|
124
|
-
|
|
125
|
-
# 添加风格
|
|
126
|
-
gen image "a friendly AI robot, cute cartoon style, bright colors, 3D render"
|
|
127
|
-
|
|
128
|
-
# 完整描述
|
|
129
|
-
gen 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"
|
|
130
|
-
```
|
|
131
|
-
|
|
132
|
-
### 分辨率选择
|
|
133
|
-
|
|
134
|
-
最大 2048x2048。
|
|
135
|
-
|
|
136
|
-
| 用途 | 分辨率 |
|
|
137
|
-
|------|--------|
|
|
138
|
-
| 社交媒体 | 1024x1024 |
|
|
139
|
-
| 宽屏壁纸 | 1920x1088 |
|
|
140
|
-
| 竖屏海报 | 768x1280 |
|
|
141
|
-
|
|
142
|
-
### 生成规则
|
|
143
|
-
|
|
144
|
-
#### 生成后
|
|
145
|
-
- 使用 Read 工具查看生成的图片
|
|
146
|
-
- 向用户描述图片内容(颜色、风格、构图、元素)
|
|
147
|
-
- 验证是否符合用户要求
|
|
148
|
-
|
|
149
|
-
#### 多图参考
|
|
150
|
-
- 最多 8 张输入图
|
|
151
|
-
|
|
152
|
-
## 虚拟试穿 (Virtual Try-On)
|
|
153
|
-
|
|
154
|
-
使用 FASHN AI tryon-v1.6 将服装穿到人物照片上。
|
|
155
|
-
|
|
156
|
-
```bash
|
|
157
|
-
gen tryon <人物照片> <服装照片> [options]
|
|
158
|
-
```
|
|
159
|
-
|
|
160
|
-
### 参数
|
|
161
|
-
|
|
162
|
-
| 参数 | 说明 | 默认值 |
|
|
163
|
-
|------|------|--------|
|
|
164
|
-
| `-o, --output <path>` | 输出文件路径 | `./gen-output/tryon_{timestamp}.png` |
|
|
165
|
-
| `-c, --category <type>` | 服装类别:auto \| tops \| bottoms \| one-pieces | auto |
|
|
166
|
-
| `-m, --mode <mode>` | 生成模式:performance \| balanced \| quality | quality |
|
|
167
|
-
| `--garment-type <type>` | 服装照片类型:auto \| flat-lay \| model | auto |
|
|
168
|
-
| `-n, --num-samples <n>` | 生成数量 (1-4) | 1 |
|
|
169
|
-
| `--format <fmt>` | 输出格式:png \| jpeg | png |
|
|
170
|
-
| `--seed <n>` | 随机种子(可复现) | - |
|
|
171
|
-
|
|
172
|
-
### 示例
|
|
173
|
-
|
|
174
|
-
```bash
|
|
175
|
-
# 基本用法
|
|
176
|
-
gen tryon person.jpg garment.jpg -o /home/aiuser/project/result.png
|
|
177
|
-
Read /home/aiuser/project/result.png
|
|
178
|
-
|
|
179
|
-
# 使用 URL 图片
|
|
180
|
-
gen tryon https://example.com/model.jpg https://example.com/dress.jpg -o /home/aiuser/project/result.png
|
|
181
|
-
|
|
182
|
-
# 指定服装类别和快速模式
|
|
183
|
-
gen tryon person.jpg top.jpg -c tops -m performance -o /home/aiuser/project/result.png
|
|
184
|
-
|
|
185
|
-
# 生成多张结果
|
|
186
|
-
gen tryon person.jpg dress.jpg -n 4 -c one-pieces -o /home/aiuser/project/result.png
|
|
187
|
-
```
|
|
188
|
-
|
|
189
|
-
### 注意事项
|
|
190
|
-
|
|
191
|
-
- 支持本地图片路径和 URL
|
|
192
|
-
- 服装类别:auto (自动检测), tops (上装), bottoms (下装), one-pieces (连体)
|
|
193
|
-
- 三种模式:performance (~7s), balanced (~9s), quality (~13s)
|
|
194
|
-
- 默认保存到 `./gen-output/`
|
|
195
|
-
|
|
196
|
-
## 语音合成 (TTS)
|
|
197
|
-
|
|
198
|
-
使用 DashScope qwen3-tts-flash 将文本转为语音。
|
|
199
|
-
|
|
200
|
-
```bash
|
|
201
|
-
gen tts <文本> [options]
|
|
202
|
-
```
|
|
203
|
-
|
|
204
|
-
### 参数
|
|
205
|
-
|
|
206
|
-
| 参数 | 说明 | 默认值 |
|
|
207
|
-
|------|------|--------|
|
|
208
|
-
| `-o, --output <path>` | 输出文件路径 | `./gen-output/tts_{timestamp}.wav` |
|
|
209
|
-
| `--voice <name>` | 声音名称 | Cherry |
|
|
210
|
-
| `--voices` | 列出可用声音 | - |
|
|
211
|
-
| `--play` | 生成后自动播放 | - |
|
|
212
|
-
|
|
213
|
-
### 可用声音
|
|
214
|
-
|
|
215
|
-
- 女声:Cherry, Serena, Chelsie, Aria, Bella, Vivian, Jennifer, Katerina, Breeze, Maple, Sakura
|
|
216
|
-
- 男声:Ethan, Aiden, Brandon, Ryan, Luke, Leo
|
|
217
|
-
|
|
218
|
-
### 示例
|
|
219
|
-
|
|
220
|
-
```bash
|
|
221
|
-
# 中文语音合成
|
|
222
|
-
gen tts "你好,欢迎使用语音合成功能" -o /home/aiuser/project/hello.wav
|
|
223
|
-
|
|
224
|
-
# 指定男声
|
|
225
|
-
gen tts "Hello, welcome!" --voice Ethan -o /home/aiuser/project/greeting.wav
|
|
226
|
-
|
|
227
|
-
# 生成后播放
|
|
228
|
-
gen tts "测试语音" --play -o /home/aiuser/project/test.wav
|
|
229
|
-
```
|
|
230
|
-
|
|
231
|
-
### 注意事项
|
|
232
|
-
|
|
233
|
-
- 输出格式为 WAV
|
|
234
|
-
- 最大 5000 字符
|
|
235
|
-
- 支持中、英、日、韩、法、德等 10 种语言(自动检测)
|
|
236
|
-
- 默认保存到 `./gen-output/`
|
|
237
|
-
|
|
238
|
-
## 语音识别 (ASR)
|
|
239
|
-
|
|
240
|
-
使用 Groq Whisper 将语音转为文字。
|
|
241
|
-
|
|
242
|
-
```bash
|
|
243
|
-
gen asr <音频文件> [options]
|
|
244
|
-
```
|
|
245
|
-
|
|
246
|
-
### 参数
|
|
247
|
-
|
|
248
|
-
| 参数 | 说明 | 默认值 |
|
|
249
|
-
|------|------|--------|
|
|
250
|
-
| `--language <lang>` | 语言提示:zh \| en \| ja \| ko 等 | 自动检测 |
|
|
251
|
-
| `--model <name>` | Whisper 模型 | whisper-large-v3-turbo |
|
|
252
|
-
|
|
253
|
-
### 示例
|
|
254
|
-
|
|
255
|
-
```bash
|
|
256
|
-
# 自动检测语言
|
|
257
|
-
gen asr /home/aiuser/project/recording.mp3
|
|
258
|
-
|
|
259
|
-
# 指定语言提示(提高准确率)
|
|
260
|
-
gen asr /home/aiuser/project/recording.wav --language zh
|
|
261
|
-
```
|
|
262
|
-
|
|
263
|
-
### 注意事项
|
|
264
|
-
|
|
265
|
-
- 支持 mp3, wav, m4a, ogg, webm 格式
|
|
266
|
-
- 文件大小限制 25MB
|
|
267
|
-
|
|
268
|
-
## 任务管理
|
|
269
|
-
|
|
270
|
-
所有生成命令会自动等待完成。如需查看历史或管理任务:
|
|
271
|
-
|
|
272
|
-
```bash
|
|
273
|
-
gen task list # 查看所有任务
|
|
274
|
-
gen task list --type image # 按类型过滤
|
|
275
|
-
gen task list --status failed # 按状态过滤
|
|
276
|
-
gen task get <task_id> # 查看任务详情
|
|
277
|
-
gen task cancel <task_id> # 取消任务
|
|
278
|
-
gen task retry <task_id> # 重试失败的任务
|
|
279
|
-
```
|
|
1
|
+
---
|
|
2
|
+
name: gen
|
|
3
|
+
description: "生成和编辑图片/语音/虚拟试穿。使用场景:生成图片(generate images/生成图片/画图)、编辑图片(edit images/编辑图片/图生图/风格转换)、文本转语音(TTS/语音合成/朗读)、语音识别(ASR/语音转文字/转录)、虚拟试穿(virtual try-on/试穿/换装/试衣)。视频生成请使用 video-gen skill。"
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# AI 内容生成工具
|
|
7
|
+
|
|
8
|
+
## 图片生成
|
|
9
|
+
|
|
10
|
+
### 标准工作流程
|
|
11
|
+
|
|
12
|
+
```bash
|
|
13
|
+
# 文生图
|
|
14
|
+
gen image "提示词" -o /home/aiuser/project/result.png
|
|
15
|
+
|
|
16
|
+
# 图片编辑/风格转换
|
|
17
|
+
gen image "转成水彩风格" -i photo.png -o /home/aiuser/project/result.png
|
|
18
|
+
|
|
19
|
+
# 读取并描述结果
|
|
20
|
+
Read /home/aiuser/project/result.png
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
### gen image 命令
|
|
24
|
+
|
|
25
|
+
统一的图像生成/编辑命令。
|
|
26
|
+
|
|
27
|
+
```bash
|
|
28
|
+
gen image <prompt> [options]
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
#### 参数
|
|
32
|
+
|
|
33
|
+
| 参数 | 说明 |
|
|
34
|
+
|------|------|
|
|
35
|
+
| `-i, --input <path>` | 输入图像(可多次使用,最多 8 张) |
|
|
36
|
+
| `-W, --width <px>` | 输出宽度(默认 1024,最大 2048) |
|
|
37
|
+
| `-H, --height <px>` | 输出高度(默认 1024,最大 2048) |
|
|
38
|
+
| `-o, --output <path>` | 输出目录或完整路径 |
|
|
39
|
+
| `-s, --seed <number>` | 随机种子(可复现结果) |
|
|
40
|
+
| `-f, --format <fmt>` | 输出格式:jpeg \| png |
|
|
41
|
+
| `--provider <name>` | 供应商:grsai(默认) \| bfl |
|
|
42
|
+
| `-m, --model <model>` | 模型:gpt-image-2(默认) \| nano-banana-fast \| nano-banana-pro \| flux-kontext-pro \| flux-kontext-max 等 |
|
|
43
|
+
| `--aspect-ratio <ratio>` | 宽高比:1:1 \| 16:9 \| 9:16 \| 4:3 等 |
|
|
44
|
+
| `--image-size <size>` | nano-banana-pro 输出尺寸:1K \| 2K \| 4K |
|
|
45
|
+
|
|
46
|
+
### 工作流示例
|
|
47
|
+
|
|
48
|
+
#### 文生图
|
|
49
|
+
|
|
50
|
+
```bash
|
|
51
|
+
gen image "a cute fluffy cat sitting on a windowsill, natural lighting" -o /home/aiuser/project/cat.png
|
|
52
|
+
Read /home/aiuser/project/cat.png
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
#### 图片风格转换
|
|
56
|
+
|
|
57
|
+
```bash
|
|
58
|
+
gen image "watercolor painting style, artistic brushstrokes" -i photo.jpg -o /home/aiuser/project/watercolor.png
|
|
59
|
+
Read /home/aiuser/project/watercolor.png
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
#### 多图风格融合
|
|
63
|
+
|
|
64
|
+
将第一张图的风格应用到第二张图的内容上:
|
|
65
|
+
|
|
66
|
+
```bash
|
|
67
|
+
gen image "apply the artistic style from image 1 to the content of image 2" -i style.png -i content.png -o /home/aiuser/project/fusion.png
|
|
68
|
+
Read /home/aiuser/project/fusion.png
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
#### 多图元素组合
|
|
72
|
+
|
|
73
|
+
从多张图中提取元素组合成新图:
|
|
74
|
+
|
|
75
|
+
```bash
|
|
76
|
+
gen 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 /home/aiuser/project/combined.png
|
|
77
|
+
```
|
|
78
|
+
|
|
79
|
+
#### 精确颜色控制
|
|
80
|
+
|
|
81
|
+
使用 hex code 指定精确颜色:
|
|
82
|
+
|
|
83
|
+
```bash
|
|
84
|
+
gen image "a modern logo with brand color #02eb3c as the primary accent" -o /home/aiuser/project/logo.png
|
|
85
|
+
```
|
|
86
|
+
|
|
87
|
+
#### 产品海报
|
|
88
|
+
|
|
89
|
+
```bash
|
|
90
|
+
gen image "Disney Pixar style 3D poster, [产品描述], cute character, vibrant gradient background, professional studio lighting" -W 1024 -H 1024 -o /home/aiuser/project/poster.png
|
|
91
|
+
```
|
|
92
|
+
|
|
93
|
+
### 提示词指南
|
|
94
|
+
|
|
95
|
+
#### 结构
|
|
96
|
+
|
|
97
|
+
**Subject + Action + Style + Context**
|
|
98
|
+
|
|
99
|
+
词序很重要,靠前的元素优先级更高。
|
|
100
|
+
|
|
101
|
+
#### 长度建议
|
|
102
|
+
|
|
103
|
+
| 长度 | 词数 | 适用场景 |
|
|
104
|
+
|------|------|----------|
|
|
105
|
+
| 短 | 10-30 | 快速概念探索 |
|
|
106
|
+
| 中 | 30-80 | 大多数项目(推荐) |
|
|
107
|
+
| 长 | 80+ | 复杂场景 |
|
|
108
|
+
|
|
109
|
+
#### 最佳实践
|
|
110
|
+
|
|
111
|
+
| 技巧 | 说明 | 示例 |
|
|
112
|
+
|------|------|------|
|
|
113
|
+
| 描述想要的 | 不支持负向提示词 | "sharp focus" 而非 "no blur" |
|
|
114
|
+
| 精确颜色 | 使用 hex code | `"brand color #1a1a2e"` |
|
|
115
|
+
| 文字渲染 | 用引号包裹文字 | `"The text 'OPEN' in red neon"` |
|
|
116
|
+
| 摄影风格 | 指定相机/镜头 | `"shot on Fujifilm X-T5, 35mm f/1.4"` |
|
|
117
|
+
| 多语言 | 用原生语言更地道 | 法语描述巴黎场景 |
|
|
118
|
+
|
|
119
|
+
#### 示例对比
|
|
120
|
+
|
|
121
|
+
```bash
|
|
122
|
+
# 简单
|
|
123
|
+
gen image "a robot"
|
|
124
|
+
|
|
125
|
+
# 添加风格
|
|
126
|
+
gen image "a friendly AI robot, cute cartoon style, bright colors, 3D render"
|
|
127
|
+
|
|
128
|
+
# 完整描述
|
|
129
|
+
gen 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"
|
|
130
|
+
```
|
|
131
|
+
|
|
132
|
+
### 分辨率选择
|
|
133
|
+
|
|
134
|
+
最大 2048x2048。
|
|
135
|
+
|
|
136
|
+
| 用途 | 分辨率 |
|
|
137
|
+
|------|--------|
|
|
138
|
+
| 社交媒体 | 1024x1024 |
|
|
139
|
+
| 宽屏壁纸 | 1920x1088 |
|
|
140
|
+
| 竖屏海报 | 768x1280 |
|
|
141
|
+
|
|
142
|
+
### 生成规则
|
|
143
|
+
|
|
144
|
+
#### 生成后
|
|
145
|
+
- 使用 Read 工具查看生成的图片
|
|
146
|
+
- 向用户描述图片内容(颜色、风格、构图、元素)
|
|
147
|
+
- 验证是否符合用户要求
|
|
148
|
+
|
|
149
|
+
#### 多图参考
|
|
150
|
+
- 最多 8 张输入图
|
|
151
|
+
|
|
152
|
+
## 虚拟试穿 (Virtual Try-On)
|
|
153
|
+
|
|
154
|
+
使用 FASHN AI tryon-v1.6 将服装穿到人物照片上。
|
|
155
|
+
|
|
156
|
+
```bash
|
|
157
|
+
gen tryon <人物照片> <服装照片> [options]
|
|
158
|
+
```
|
|
159
|
+
|
|
160
|
+
### 参数
|
|
161
|
+
|
|
162
|
+
| 参数 | 说明 | 默认值 |
|
|
163
|
+
|------|------|--------|
|
|
164
|
+
| `-o, --output <path>` | 输出文件路径 | `./gen-output/tryon_{timestamp}.png` |
|
|
165
|
+
| `-c, --category <type>` | 服装类别:auto \| tops \| bottoms \| one-pieces | auto |
|
|
166
|
+
| `-m, --mode <mode>` | 生成模式:performance \| balanced \| quality | quality |
|
|
167
|
+
| `--garment-type <type>` | 服装照片类型:auto \| flat-lay \| model | auto |
|
|
168
|
+
| `-n, --num-samples <n>` | 生成数量 (1-4) | 1 |
|
|
169
|
+
| `--format <fmt>` | 输出格式:png \| jpeg | png |
|
|
170
|
+
| `--seed <n>` | 随机种子(可复现) | - |
|
|
171
|
+
|
|
172
|
+
### 示例
|
|
173
|
+
|
|
174
|
+
```bash
|
|
175
|
+
# 基本用法
|
|
176
|
+
gen tryon person.jpg garment.jpg -o /home/aiuser/project/result.png
|
|
177
|
+
Read /home/aiuser/project/result.png
|
|
178
|
+
|
|
179
|
+
# 使用 URL 图片
|
|
180
|
+
gen tryon https://example.com/model.jpg https://example.com/dress.jpg -o /home/aiuser/project/result.png
|
|
181
|
+
|
|
182
|
+
# 指定服装类别和快速模式
|
|
183
|
+
gen tryon person.jpg top.jpg -c tops -m performance -o /home/aiuser/project/result.png
|
|
184
|
+
|
|
185
|
+
# 生成多张结果
|
|
186
|
+
gen tryon person.jpg dress.jpg -n 4 -c one-pieces -o /home/aiuser/project/result.png
|
|
187
|
+
```
|
|
188
|
+
|
|
189
|
+
### 注意事项
|
|
190
|
+
|
|
191
|
+
- 支持本地图片路径和 URL
|
|
192
|
+
- 服装类别:auto (自动检测), tops (上装), bottoms (下装), one-pieces (连体)
|
|
193
|
+
- 三种模式:performance (~7s), balanced (~9s), quality (~13s)
|
|
194
|
+
- 默认保存到 `./gen-output/`
|
|
195
|
+
|
|
196
|
+
## 语音合成 (TTS)
|
|
197
|
+
|
|
198
|
+
使用 DashScope qwen3-tts-flash 将文本转为语音。
|
|
199
|
+
|
|
200
|
+
```bash
|
|
201
|
+
gen tts <文本> [options]
|
|
202
|
+
```
|
|
203
|
+
|
|
204
|
+
### 参数
|
|
205
|
+
|
|
206
|
+
| 参数 | 说明 | 默认值 |
|
|
207
|
+
|------|------|--------|
|
|
208
|
+
| `-o, --output <path>` | 输出文件路径 | `./gen-output/tts_{timestamp}.wav` |
|
|
209
|
+
| `--voice <name>` | 声音名称 | Cherry |
|
|
210
|
+
| `--voices` | 列出可用声音 | - |
|
|
211
|
+
| `--play` | 生成后自动播放 | - |
|
|
212
|
+
|
|
213
|
+
### 可用声音
|
|
214
|
+
|
|
215
|
+
- 女声:Cherry, Serena, Chelsie, Aria, Bella, Vivian, Jennifer, Katerina, Breeze, Maple, Sakura
|
|
216
|
+
- 男声:Ethan, Aiden, Brandon, Ryan, Luke, Leo
|
|
217
|
+
|
|
218
|
+
### 示例
|
|
219
|
+
|
|
220
|
+
```bash
|
|
221
|
+
# 中文语音合成
|
|
222
|
+
gen tts "你好,欢迎使用语音合成功能" -o /home/aiuser/project/hello.wav
|
|
223
|
+
|
|
224
|
+
# 指定男声
|
|
225
|
+
gen tts "Hello, welcome!" --voice Ethan -o /home/aiuser/project/greeting.wav
|
|
226
|
+
|
|
227
|
+
# 生成后播放
|
|
228
|
+
gen tts "测试语音" --play -o /home/aiuser/project/test.wav
|
|
229
|
+
```
|
|
230
|
+
|
|
231
|
+
### 注意事项
|
|
232
|
+
|
|
233
|
+
- 输出格式为 WAV
|
|
234
|
+
- 最大 5000 字符
|
|
235
|
+
- 支持中、英、日、韩、法、德等 10 种语言(自动检测)
|
|
236
|
+
- 默认保存到 `./gen-output/`
|
|
237
|
+
|
|
238
|
+
## 语音识别 (ASR)
|
|
239
|
+
|
|
240
|
+
使用 Groq Whisper 将语音转为文字。
|
|
241
|
+
|
|
242
|
+
```bash
|
|
243
|
+
gen asr <音频文件> [options]
|
|
244
|
+
```
|
|
245
|
+
|
|
246
|
+
### 参数
|
|
247
|
+
|
|
248
|
+
| 参数 | 说明 | 默认值 |
|
|
249
|
+
|------|------|--------|
|
|
250
|
+
| `--language <lang>` | 语言提示:zh \| en \| ja \| ko 等 | 自动检测 |
|
|
251
|
+
| `--model <name>` | Whisper 模型 | whisper-large-v3-turbo |
|
|
252
|
+
|
|
253
|
+
### 示例
|
|
254
|
+
|
|
255
|
+
```bash
|
|
256
|
+
# 自动检测语言
|
|
257
|
+
gen asr /home/aiuser/project/recording.mp3
|
|
258
|
+
|
|
259
|
+
# 指定语言提示(提高准确率)
|
|
260
|
+
gen asr /home/aiuser/project/recording.wav --language zh
|
|
261
|
+
```
|
|
262
|
+
|
|
263
|
+
### 注意事项
|
|
264
|
+
|
|
265
|
+
- 支持 mp3, wav, m4a, ogg, webm 格式
|
|
266
|
+
- 文件大小限制 25MB
|
|
267
|
+
|
|
268
|
+
## 任务管理
|
|
269
|
+
|
|
270
|
+
所有生成命令会自动等待完成。如需查看历史或管理任务:
|
|
271
|
+
|
|
272
|
+
```bash
|
|
273
|
+
gen task list # 查看所有任务
|
|
274
|
+
gen task list --type image # 按类型过滤
|
|
275
|
+
gen task list --status failed # 按状态过滤
|
|
276
|
+
gen task get <task_id> # 查看任务详情
|
|
277
|
+
gen task cancel <task_id> # 取消任务
|
|
278
|
+
gen task retry <task_id> # 重试失败的任务
|
|
279
|
+
```
|
|
280
|
+
|
|
281
|
+
## 错误处理(重要)
|
|
282
|
+
|
|
283
|
+
所有 `gen` 命令在失败时会返回结构化错误。**不要把原始 `error_message`(可能是中文报错)直接抛给用户**——根据 `error_code` 字段决定应对策略。
|
|
284
|
+
|
|
285
|
+
### 失败响应示例
|
|
286
|
+
|
|
287
|
+
```json
|
|
288
|
+
{
|
|
289
|
+
"success": true,
|
|
290
|
+
"data": {
|
|
291
|
+
"task_id": "abc-123",
|
|
292
|
+
"status": "failed",
|
|
293
|
+
"error_code": "UPSTREAM_MAINTENANCE",
|
|
294
|
+
"retryable": true,
|
|
295
|
+
"error_message": "上游生成服务正在维护中,请稍后再试"
|
|
296
|
+
}
|
|
297
|
+
}
|
|
298
|
+
```
|
|
299
|
+
|
|
300
|
+
注意:`success: true` + `status: "failed"` 是任务执行完成但生成失败;`success: false` 才是 CLI 调用本身失败。两者都要按 `error_code` 处理。
|
|
301
|
+
|
|
302
|
+
### 处理对照表
|
|
303
|
+
|
|
304
|
+
| `error_code` | 你应该做的 | 给用户的话术(参考) |
|
|
305
|
+
|---|---|---|
|
|
306
|
+
| `UPSTREAM_MAINTENANCE` | **不立即重试**。告知用户服务维护中,建议 5-10 分钟后再试 | "图片生成服务正在维护,建议 5-10 分钟后我再帮您试一次" |
|
|
307
|
+
| `CONTENT_POLICY_VIOLATION` | **改写 prompt** 去掉敏感/违规元素,自动重试**最多 1 次**。仍失败再交给用户 | "您的描述触发了内容审核,我换个说法重试:……" |
|
|
308
|
+
| `UPSTREAM_TIMEOUT` | 立即重试 1 次(静默) | (重试成功就别提;连续失败再说) |
|
|
309
|
+
| `UPSTREAM_RATE_LIMITED` | 等 30 秒后重试 1 次 | "请求频率过高,稍等几十秒再试" |
|
|
310
|
+
| `UPSTREAM_NETWORK` | 立即重试 1 次(静默) | (同 timeout) |
|
|
311
|
+
| `PROVIDER_INSUFFICIENT_CREDITS` | **不重试**。明确告诉用户问题不在他、不在他的余额 | "生成服务后端额度不足(与您账户余额无关),已记录" |
|
|
312
|
+
| `UPSTREAM_UNKNOWN` 或字段缺失 | **不重试**。把 `error_message` 透传给用户 | "图片生成失败:{error_message}" |
|
|
313
|
+
|
|
314
|
+
### 通用规则
|
|
315
|
+
|
|
316
|
+
1. **`retryable: true`** 的失败:自动重试**最多 1 次**,不要循环
|
|
317
|
+
2. **`retryable: false`**:永远不重试,立即给用户结果
|
|
318
|
+
3. 改写 prompt 重试时,**告诉用户你做了什么改动**(透明)
|
|
319
|
+
4. `success: false`(CLI 本身报错)直接报给用户,不重试
|
|
320
|
+
5. 没有 `error_code` 字段的旧版响应:当作 `UPSTREAM_UNKNOWN` 处理
|
|
321
|
+
|
|
322
|
+
### 反面示例(不要这样做)
|
|
323
|
+
|
|
324
|
+
❌ 把 `"维护中"` 三个字直接砸给用户
|
|
325
|
+
❌ 任何失败都自动 retry 三五次造成账单浪费
|
|
326
|
+
❌ `CONTENT_POLICY_VIOLATION` 时换汤不换药地原 prompt 重试
|
|
327
|
+
❌ `PROVIDER_INSUFFICIENT_CREDITS` 时让用户去充值(这跟用户余额无关)
|