Generate or edit images via 火山方舟 (Volcengine Ark) Seedream API. Text-to-image default model doubao-seedream-4.5(fallback doubao-seedream-5.0-lite); image-edit supported via 1-3 reference images. Uses user's AWK_API_KEY (client-side only, never sent to server).
65
80%
Does it follow best practices?
Run evals on this skill
Adds up to 20 points to the overall score
View guide
Passed
No findings from the security scan
Fix and improve this skill with Tessl
tessl review fix ./skills/siliconflow-img-gen/SKILL.md凭据:用户自带
AWK_API_KEY(纯客户端,不入 server)。
Generate or edit images using 火山方舟 (Volcengine Ark) Seedream API.
Endpoint: POST https://ark.cn-beijing.volces.com/api/v3/images/generations
Two modes:
doubao-seedream-4.5(主力不可用时自动 fallback 到 doubao-seedream-5.0-lite)--image 触发;4.5+ 支持多图参考(1-3 张)参考文档:https://www.volcengine.com/docs/82379/1541523
Note: Image generation can take 10–60 seconds. Set a higher timeout when invoking via exec (e.g., exec timeout=120).
Do NOT set env vars inline (e.g., AWK_API_KEY=... python3 ...). The env var is already in the system environment; inline assignments break the exec permission check.
通过 PATH 调用 wrapper,无需拼接脚本路径。
# Text-to-image (default model: doubao-seedream-4.5,失败自动 fallback doubao-seedream-5.0-lite)
siliconflow-img-gen --prompt "your prompt here"
# 指定其他 model(显式指定时不 fallback)
siliconflow-img-gen --prompt "your prompt" --model "doubao-seedream-5.0-lite"
siliconflow-img-gen --prompt "your prompt" --model "doubao-seedream-3-0-t2i-250415"
# Image-edit(1-3 张参考图)
siliconflow-img-gen --prompt "add a lighthouse" --image "https://example.com/source.jpg"
siliconflow-img-gen --prompt "blend" \
--image "https://example.com/a.jpg" \
--image2 "https://example.com/b.jpg" \
--image3 "https://example.com/c.jpg"# Square 2K (default)
siliconflow-img-gen --prompt "a futuristic city at dusk"
# Landscape 16:9
siliconflow-img-gen --prompt "mountain lake" --image-size 2848x1600
# Portrait 9:16
siliconflow-img-gen --prompt "mountain lake" --image-size 1600x2848
# Quality preset (火山的 2K / 3K / 4K 方式 1)
siliconflow-img-gen --prompt "4K 超清" --image-size 4K
# Save to specific directory
siliconflow-img-gen --prompt "sunset" --out-dir ./out/images# 单图生图
siliconflow-img-gen --prompt "make it night time" --image "https://example.com/photo.jpg"
# 多图融合(3 张)
siliconflow-img-gen --prompt "blend these photos" \
--image "https://example.com/a.jpg" \
--image2 "https://example.com/b.jpg" \
--image3 "https://example.com/c.jpg"| Flag | Default | Description |
|---|---|---|
--prompt | required | 图像描述(≤300 汉字 / 600 英文) |
--model | auto | Model ID;默认 doubao-seedream-4.5(主力不可用自动 fallback doubao-seedream-5.0-lite);显式指定时不 fallback |
--image-size | 2048x2048 | 文生图尺寸。方式 1: 2K/3K/4K;方式 2: WxH(如 2048x2048) |
--seed | — | 随机种子 |
--watermark | false | 是否加水印(xiaobei 默认不加,避免后续 image 工具处理) |
--response-format | url | url(链接 24h 有效)/ b64_json |
--image | — | 源图 URL 或 Base64(启用 image-edit 模式) |
--image2 | — | 第二张参考图(image-edit) |
--image3 | — | 第三张参考图(image-edit) |
--out-dir | ./tmp/awk-img-<ts> | 输出目录 |
--image-size values火山方舟图像生成 size 限制(参考 API 文档):
- 方式 1(quality 预设):
2K/3K/4K- 方式 2(WxH):总像素 ∈ [2560×1440=3686400, 4096×4096=16777216];宽高比 ∈ [1/16, 16]
无效值会被脚本拒绝并 exit 1,错误信息列出所有合法选项。
2K 推荐宽高像素值(默认 quality 档):
| Value | Ratio |
|---|---|
2048x2048 | 1:1 (default) |
2304x1728 | 4:3 |
1728x2304 | 3:4 |
2848x1600 | 16:9 |
1600x2848 | 9:16 |
2496x1664 | 3:2 |
1664x2496 | 2:3 |
3136x1344 | 21:9 |
*.jpg 图像(火山默认 jpeg 输出;URL 24h 有效,按脚本约定下载到本地)prompts.json 索引 → prompt + URL + fileindex.html 缩略图 gallery适用于图文混合素材(短视频封面、社媒海报、信息图配图等)——需要模型一次性渲染文字与画面,而不是后期合成。
| 参数 | 推荐值 | 原因 |
|---|---|---|
--model | doubao-seedream-4.5 | 4.5 在文字渲染 / 中文支持上稳定 |
--image-size | 2K 或 4K | 高分辨率给文字留细节空间 |
| 比例 | 9:16 / 16:9 / 1:1 按平台选 | 火山 way 2 任意合法比例 |
❌ 反例(泛泛描述):
"Generate an attractive short-video cover with a title about AI"
✅ 正例(按视觉布局分段写,明确写出要渲染的文字):
"A dramatic vertical 9:16 short-video cover. Background: bold red-to-black gradient. Top: glowing AI chip icons with text 'DeepSeek'. Middle: large bold Chinese text '前几周 DeepSeek 还是神一般的存在' in white and gold gradient with sharp shadows. Bottom: dramatic red glowing Chinese text '为什么热度消散得这么快?' with lightning effects. Style: high contrast, modern tech poster, dramatic lighting, professional Chinese typography, sharp text rendering, cinematic, no watermarks."
要点:
--watermark false 双保险)--watermark false:必加(xiaobei 默认)--seed N:需要可复现时设固定值--response-format b64_json:避免依赖 URL 24h 失效(脚本默认 url)image 工具分析图片,逐项确认:
--negative-prompt-like 描述重生成)--response-format b64_json + 后续转码siliconflow-img-gen \
--prompt "A dramatic vertical 9:16 short-video cover with bold red and black gradient background, glowing AI chip icons floating in the upper area, and large bold Chinese text '前几周 DeepSeek 还是神一般的存在' in the middle in white and gold gradient with sharp shadows. At the bottom, dramatic glowing red Chinese text '为什么热度消散得这么快?' with lightning-like effects. Visual style: high contrast, modern tech poster, dramatic lighting, professional Chinese typography, sharp text rendering, cinematic, no watermarks" \
--image-size 1600x2848 \
--watermark false \
--out-dir /path/to/output每张图生成后必须用 image 工具检查(不得跳过):
最多重试 3 次,仍异常则标记失败并继续后续任务。
| Model | 适用场景 | 备注 |
|---|---|---|
doubao-seedream-4.5 | 默认 / 通用(主力) | 文字渲染稳,多图融合支持;不可用时脚本自动 fallback |
doubao-seedream-5.0-lite | fallback / 组图 / 工具调用 | 主力失败时自动切换;5.0 lite 起支持 tools/web_search |
doubao-seedream-3-0-t2i-250415 | 纯文生图(无 image edit) | 3.0 旧版,仅 t2i,需 --model 显式指定 |
当 doubao-seedream-4.5(主力)与 doubao-seedream-5.0-lite(fallback)都无法使用时(典型表现:HTTP 400/403/404,或脚本 stderr 输出 [guide] 请到火山引擎后台开通视觉模型),说明用户的火山方舟账号尚未开通这两个视觉模型。Agent 应主动把下面的开通步骤反馈给用户,不要静默失败或反复重试。
doubao-seedream-4.5 和 doubao-seedream-5.0-lite 两项,分别点右侧「开通服务」目前火山方舟 CodePlan 有活动:在上述视觉模型开通页面上方可参加领取免费资源包活动。
| 模型 | 免费额度 |
|---|---|
doubao-seedream-4.5 | 送 200 张图 |
doubao-seedream-5.0-lite | 送 50 张图 |
重要提醒(必须告诉用户):
HTTPError 401AWK_API_KEY 环境变量是否设置;火山 Ark 控制台 (console.volcengine.com/ark) 验证 key 有效HTTPError 400 + 提示 size invalid2K / 3K / 4K 预设,或按 API 文档 调整 WxH(总像素 ≥ 2560x1440)response_format=url 且立刻下载到 --out-dir;如需长期保留,用 --response-format b64_json--watermark false;不要漏写bcef823
If you maintain this skill, you can claim it as your own. Once claimed, you can manage eval scenarios, bundle related skills, attach documentation or rules, and ensure cross-agent compatibility.