Seedance Video Generation
Generate AI videos using ByteDance Seedance models via the Volcengine Ark API.
Prerequisites
The user must set the ARK_API_KEY environment variable. You can set it by running:
CODEBLOCK0
Base URL: INLINECODE1
Supported Models
| Model | Model ID | Capabilities |
|---|
| Seedance 1.5 Pro | INLINECODE2 | Text-to-video, Image-to-video (first frame, first+last frame), Audio support, Draft mode |
| Seedance 1.0 Pro |
doubao-seedance-1-0-pro-250428 | Text-to-video, Image-to-video (first frame, first+last frame) |
| Seedance 1.0 Pro Fast |
doubao-seedance-1-0-pro-fast-250528 | Text-to-video, Image-to-video (first frame only) |
| Seedance 1.0 Lite T2V |
doubao-seedance-1-0-lite-t2v-250219 | Text-to-video only |
| Seedance 1.0 Lite I2V |
doubao-seedance-1-0-lite-i2v-250219 | Image-to-video (first frame, first+last frame, reference images 1-4) |
Default model: doubao-seedance-1-5-pro-251215 (latest, supports audio)
Execution (Recommended: Python CLI Tool)
A Python CLI tool is provided at ~/.claude/skills/seedance-video/seedance.py for robust execution with proper error handling, automatic retries, and local image base64 conversion. Prefer using this tool over raw curl commands.
Quick Examples with Python CLI
CODEBLOCK1
Alternative: Raw curl Commands
Step 1: Create Video Generation Task
Determine the generation mode based on user input, then call the API.
Mode A: Text-to-Video
CODEBLOCK2
Mode B: Image-to-Video (First Frame)
The user provides one image as the first frame. The image can be a URL or local file path (convert to base64).
With image URL:
CODEBLOCK3
With local image file (convert to base64):
CODEBLOCK4
Mode C: Image-to-Video (First + Last Frame)
Requires two images. Supported by: Seedance 1.5 Pro, 1.0 Pro, 1.0 Lite I2V.
CODEBLOCK5
Mode D: Reference Image-to-Video (Seedance 1.0 Lite I2V only)
Provide 1-4 reference images. Use [图1], [图2] in prompt to reference specific images.
CODEBLOCK6
Step 2: Poll for Task Completion
Video generation is asynchronous. Poll the task status until it completes.
CODEBLOCK7
Step 3: Download and Open Video
CODEBLOCK8
Optional Parameters Reference
| Parameter | Type | Default | Description |
|---|
| INLINECODE11 | string | INLINECODE12 | Model ID to use |
| INLINECODE13 |
string |
16:9 (text2vid) /
adaptive (img2vid) | Aspect ratio:
16:9,
4:3,
1:1,
3:4,
9:16,
21:9,
adaptive |
|
duration | integer |
5 | Video duration in seconds (4-12 for 1.5 Pro, 2-12 for others). Set
-1 for auto (1.5 Pro only) |
|
resolution | string |
720p | Resolution:
480p,
720p,
1080p |
|
seed | integer |
-1 | Random seed for reproducibility. -1 = random |
|
camera_fixed | boolean |
false | Fix camera position |
|
watermark | boolean |
false | Add watermark to video |
|
generate_audio | boolean |
true | Generate synchronized audio (Seedance 1.5 Pro only) |
|
draft | boolean |
false | Generate draft/preview video at lower cost (Seedance 1.5 Pro only, forces 480p) |
|
return_last_frame | boolean |
false | Return last frame image URL (for chaining consecutive videos) |
|
service_tier | string |
default |
default (online) or
flex (offline, 50% cheaper, slower) |
|
execution_expires_after | integer |
172800 | Task timeout in seconds (3600-259200) |
Additional Operations
Query Task Status
CODEBLOCK9
List Tasks
CODEBLOCK10
Cancel or Delete Task
CODEBLOCK11
Note: queued tasks will be cancelled; succeeded/failed/expired tasks will be deleted from history.
Generate Consecutive Videos (Using Last Frame)
Set return_last_frame: true on the first task, then use the returned last_frame_url as the first frame of the next task.
CODEBLOCK12
Draft Mode (Seedance 1.5 Pro)
Generate a cheap preview first, then produce the final video if satisfied:
CODEBLOCK13
Image Requirements
- - Formats: jpeg, png, webp, bmp, tiff, gif (1.5 Pro also supports heic, heif)
- Aspect ratio (width/height): between 0.4 and 2.5
- Dimensions: 300-6000 px per side
- Max file size: 30 MB
通过飞书发送视频文件(OpenClaw)
详见 howtosendvideoviafeishu_app.md
Rules
- 1. Always check that
ARK_API_KEY is set before making API calls: INLINECODE56 - Default to Seedance 1.5 Pro (
doubao-seedance-1-5-pro-251215) unless user requests a specific model. - Default to 720p, 16:9, 5 seconds, with audio for text-to-video.
- Default to adaptive ratio for image-to-video (auto-adapts to the input image).
- Poll interval: 15 seconds between status checks.
- Video URLs expire in 24 hours - always download immediately after generation.
- Task history is kept for 7 days only.
- For local image files, convert to base64 data URL format before sending.
- Always show the user the task ID so they can check status later.
- When generation fails, display the error message clearly and suggest possible fixes.
Seedance 视频生成
通过火山引擎方舟API使用字节跳动Seedance模型生成AI视频。
前置条件
用户必须设置 ARKAPIKEY 环境变量。可通过运行以下命令进行设置:
bash
export ARKAPIKEY=your-api-key-here
基础URL: https://ark.cn-beijing.volces.com/api/v3
支持的模型
| 模型 | 模型ID | 能力 |
|---|
| Seedance 1.5 Pro | doubao-seedance-1-5-pro-251215 | 文生视频、图生视频(首帧、首尾帧)、音频支持、草稿模式 |
| Seedance 1.0 Pro |
doubao-seedance-1-0-pro-250428 | 文生视频、图生视频(首帧、首尾帧) |
| Seedance 1.0 Pro Fast | doubao-seedance-1-0-pro-fast-250528 | 文生视频、图生视频(仅首帧) |
| Seedance 1.0 Lite T2V | doubao-seedance-1-0-lite-t2v-250219 | 仅文生视频 |
| Seedance 1.0 Lite I2V | doubao-seedance-1-0-lite-i2v-250219 | 图生视频(首帧、首尾帧、参考图1-4张) |
默认模型: doubao-seedance-1-5-pro-251215(最新版,支持音频)
执行方式(推荐:Python CLI工具)
在 ~/.claude/skills/seedance-video/seedance.py 提供了一个Python CLI工具,具备完善的错误处理、自动重试和本地图片base64转换功能。建议优先使用此工具而非原始curl命令。
Python CLI快速示例
bash
文生视频(创建+等待+下载)
python3 ~/.claude/skills/seedance-video/seedance.py create --prompt 小猫对着镜头打哈欠 --wait --download ~/Desktop
本地图片转视频
python3 ~/.claude/skills/seedance-video/seedance.py create --prompt 人物缓缓转头微笑 --image /path/to/photo.jpg --wait --download ~/Desktop
URL图片转视频
python3 ~/.claude/skills/seedance-video/seedance.py create --prompt 风景画面缓缓推进 --image https://example.com/image.jpg --wait --download ~/Desktop
首帧+尾帧
python3 ~/.claude/skills/seedance-video/seedance.py create --prompt 花朵从含苞到盛开 --image first.jpg --last-frame last.jpg --wait --download ~/Desktop
参考图(Lite I2V)
python3 ~/.claude/skills/seedance-video/seedance.py create --prompt [图1]的人物在跳舞 --ref-images ref1.jpg ref2.jpg --model doubao-seedance-1-0-lite-i2v-250219 --wait --download ~/Desktop
自定义参数
python3 ~/.claude/skills/seedance-video/seedance.py create --prompt 城市夜景延时摄影 --ratio 21:9 --duration 8 --resolution 1080p --generate-audio false --wait --download ~/Desktop
草稿模式(更便宜的预览)
python3 ~/.claude/skills/seedance-video/seedance.py create --prompt 海浪拍打沙滩 --draft true --wait --download ~/Desktop
从草稿生成最终视频
python3 ~/.claude/skills/seedance-video/seedance.py create --draft-task-id
TASKID> --resolution 720p --wait --download ~/Desktop
查询任务状态
python3 ~/.claude/skills/seedance-video/seedance.py status
等待现有任务完成
python3 ~/.claude/skills/seedance-video/seedance.py wait --download ~/Desktop
列出任务
python3 ~/.claude/skills/seedance-video/seedance.py list --status succeeded
删除/取消任务
python3 ~/.claude/skills/seedance-video/seedance.py delete
备选方案:原始curl命令
步骤1:创建视频生成任务
根据用户输入确定生成模式,然后调用API。
模式A:文生视频
bash
TASK_RESULT=$(curl -s -X POST https://ark.cn-beijing.volces.com/api/v3/contents/generations/tasks \
-H Content-Type: application/json \
-H Authorization: Bearer $ARKAPIKEY \
-d {
model: doubao-seedance-1-5-pro-251215,
content: [
{
type: text,
text: YOURPROMPTHERE
}
],
ratio: 16:9,
duration: 5,
resolution: 720p,
generate_audio: true
})
TASKID=$(echo $TASKRESULT | python3 -c import sys,json; print(json.load(sys.stdin)[id]))
echo 任务已创建: $TASK_ID
模式B:图生视频(首帧)
用户提供一张图片作为首帧。图片可以是URL或本地文件路径(需转换为base64)。
使用图片URL:
bash
TASK_RESULT=$(curl -s -X POST https://ark.cn-beijing.volces.com/api/v3/contents/generations/tasks \
-H Content-Type: application/json \
-H Authorization: Bearer $ARKAPIKEY \
-d {
model: doubao-seedance-1-5-pro-251215,
content: [
{
type: text,
text: YOURPROMPTHERE
},
{
type: image_url,
imageurl: { url: IMAGEURL_HERE },
role: first_frame
}
],
ratio: adaptive,
duration: 5,
resolution: 720p,
generate_audio: true
})
TASKID=$(echo $TASKRESULT | python3 -c import sys,json; print(json.load(sys.stdin)[id]))
echo 任务已创建: $TASK_ID
使用本地图片文件(转换为base64):
bash
IMG_PATH=/path/to/image.png
IMGEXT=${IMGPATH##*.}
IMGEXTLOWER=$(echo $IMG_EXT | tr [:upper:] [:lower:])
IMGBASE64=$(base64 < $IMGPATH | tr -d \n)
IMGDATAURL=data:image/${IMGEXTLOWER};base64,${IMG_BASE64}
TASK_RESULT=$(curl -s -X POST https://ark.cn-beijing.volces.com/api/v3/contents/generations/tasks \
-H Content-Type: application/json \
-H Authorization: Bearer $ARKAPIKEY \
-d {
model: doubao-seedance-1-5-pro-251215,
content: [
{
type: text,
text: YOURPROMPTHERE
},
{
type: image_url,
imageurl: { url: $IMGDATA_URL },
role: first_frame
}
],
ratio: adaptive,
duration: 5,
resolution: 720p,
generate_audio: true
})
TASKID=$(echo $TASKRESULT | python3 -c import sys,json; print(json.load(sys.stdin)[id]))
echo 任务已创建: $TASK_ID
模式C:图生视频(首帧+尾帧)
需要两张图片。支持的模型:Seedance 1.5 Pro、1.0 Pro、1.0 Lite I2V。
bash
TASK_RESULT=$(curl -s -X POST https://ark.cn-beijing.volces.com/api/v3/contents/generations/tasks \
-H Content-Type: application/json \
-H Authorization: Bearer $ARKAPIKEY \
-d {
model: doubao-seedance-1-5-pro-251215,
content: [
{
type: text,
text: YOURPROMPTHERE
},
{
type: image_url