API 参考
图生视频
使用 Seedance 2.0 Open API 基于图片和参考素材生成视频。
图生视频
使用 Seedance 2.0 Open API 基于参考素材生成视频。在这种模式下,你需要通过 mediaUrls 传入一个或多个公开可访问的素材地址,并配合提示词一起提交。
这个接口支持首帧驱动、首尾帧控制,以及更丰富的参考素材工作流。系统会根据你传入素材的数量和类型自动判断生成模式。
接口地址
POST /api/open/v1/video/generations支持的参考素材类型
| 类型 | 常见格式 | 常见用途 |
|---|---|---|
| 图片 | .jpg, .jpeg, .png, .webp, .gif, .bmp | 首帧、尾帧、风格参考 |
| 视频 | .mp4, .mov, .m4v | 动作、镜头运动参考 |
| 音频 | .mp3, .wav | 节奏或时序参考 |
mediaUrls最多可传5个素材地址。- 请使用公开可访问的 HTTPS 链接。
- 为了提升稳定性,建议参考素材尽量清晰、直接,并与提示词目标高度一致。
首帧示例
curl --request POST \
--url https://www.seedance2.ink/api/open/v1/video/generations \
--header 'Authorization: Bearer sd2_live_your_api_key' \
--header 'Content-Type: application/json' \
--data '{
"model": "seedance-2.0",
"prompt": "A young woman blows out birthday candles, warm indoor lighting, shallow depth of field",
"mediaUrls": [
"https://example.com/photo.jpg"
],
"aspectRatio": "16:9",
"duration": 5,
"resolution": "720p"
}'首尾帧示例
curl --request POST \
--url https://www.seedance2.ink/api/open/v1/video/generations \
--header 'Authorization: Bearer sd2_live_your_api_key' \
--header 'Content-Type: application/json' \
--data '{
"model": "seedance-2.0",
"prompt": "A cinematic transition from sunrise over the ocean to a glowing night skyline",
"mediaUrls": [
"https://example.com/first-frame.jpg",
"https://example.com/last-frame.jpg"
],
"aspectRatio": "16:9",
"duration": 6,
"resolution": "1080p"
}'多模态参考示例
curl --request POST \
--url https://www.seedance2.ink/api/open/v1/video/generations \
--header 'Authorization: Bearer sd2_live_your_api_key' \
--header 'Content-Type: application/json' \
--data '{
"model": "seedance-2.0-fast",
"prompt": "A fashion film with energetic camera motion synced to the beat",
"mediaUrls": [
"https://example.com/reference-image.jpg",
"https://example.com/reference-audio.mp3"
],
"aspectRatio": "9:16",
"duration": 8,
"resolution": "720p",
"webhookUrl": "https://your-app.com/webhooks/seedance"
}'成功响应
{
"success": true,
"requestId": "req_1234567890",
"status": "queued",
"creditsCharged": 64
}请求体参数
| 字段 | 类型 | 必填 | 说明 |
|---|---|---|---|
model | string | 是 | 可选值:seedance-2.0、seedance-2.0-fast、seedance-1.5-pro。 |
prompt | string | 是 | 描述目标视频效果的文本指令。 |
mediaUrls | string[] | 是 | 一到五个公开可访问的参考素材地址。 |
aspectRatio | string | 否 | 可选值:16:9、9:16、1:1。 |
duration | integer | 否 | seedance-2.0 和 seedance-2.0-fast 支持 4-15 秒;seedance-1.5-pro 仅支持 5 或 10 秒。 |
resolution | string | 否 | 可选值:480p、720p、1080p。 |
webhookUrl | string | 否 | 任务完成后接收结果回调的地址。 |
metadata | object | 否 | 与本次请求一起保存的自定义元数据。 |
查询结果
通过提交接口返回的任务 ID 查询生成结果:
curl https://www.seedance2.ink/api/open/v1/video/generations/req_1234567890 \
--header 'Authorization: Bearer sd2_live_your_api_key'{
"success": true,
"requestId": "req_1234567890",
"status": "succeeded",
"model": "seedance-2.0",
"prompt": "A young woman blows out birthday candles, warm indoor lighting, shallow depth of field",
"duration": 5,
"aspectRatio": "16:9",
"output": {
"type": "video",
"url": "https://pub-your-bucket.r2.dev/open-api-results/req_1234567890.mp4"
},
"error": null
}只有当任务状态变为 succeeded 时,响应中才会返回输出视频地址。
取消任务
curl --request POST \
--url https://www.seedance2.ink/api/open/v1/video/generations/req_1234567890/cancel \
--header 'Authorization: Bearer sd2_live_your_api_key'{
"success": true,
"requestId": "req_1234567890",
"status": "cancelled"
}说明
- 更丰富的多模态参考场景建议使用
seedance-2.0或seedance-2.0-fast。 seedance-1.5-pro更适合较简单的图片驱动生成任务。- 如果你不需要参考素材,请直接使用 文生视频。