创建视频任务
创建 Seedance 视频生成任务,基于传入的图片、视频、音频及文本提示词生成视频。任务为异步流程,返回任务 ID 后通过查询接口轮询结果。
三种生成模式
接口支持三种生成模式,通过 content 数组中传入的内容类型和 role 区分。三种模式互斥,单次请求只能选择其一,不可混用。
| 模式 | 输入 | 说明 |
|---|---|---|
| 文生视频 | 仅文本提示词 | 从文字描述生成全新视频 |
| 图生视频 | 1~2 张图片 + 文本(可选) | 首帧(first_frame)或首尾帧(first_frame + last_frame)引导生成 |
| 多模态参考生视频 | 参考图(0~9)+ 参考视频(0~3)+ 参考音频(0~3)+ 文本(可选) | 至少含 1 个图片或视频,支持生成全新视频、编辑视频、延长视频 |
三种模式互斥:例如不能在同一个请求里既用
first_frame/last_frame(图生视频)又用reference_image/reference_video(多模态参考)。
文生视频
仅传入文本提示词:
{
"model": "doubao-seedance-2-0-fast",
"content": [
{ "type": "text", "text": "一只橘猫在阳光下的窗台上伸懒腰,镜头缓慢推进" }
],
"resolution": "720p",
"ratio": "16:9",
"duration": 5
}图生视频
首帧:传入 1 张图片,role 为 first_frame(或不填):
{
"model": "doubao-seedance-2-0",
"content": [
{ "type": "text", "text": "镜头缓缓拉远,画面中的人物转身微笑" },
{ "type": "image_url", "image_url": { "url": "https://example.com/first.jpg" }, "role": "first_frame" }
]
}首尾帧:传入 2 张图片,role 分别为 first_frame 和 last_frame(均必填):
{
"model": "doubao-seedance-2-0",
"content": [
{ "type": "text", "text": "花朵从含苞到盛开" },
{ "type": "image_url", "image_url": { "url": "https://example.com/start.jpg" }, "role": "first_frame" },
{ "type": "image_url", "image_url": { "url": "https://example.com/end.jpg" }, "role": "last_frame" }
]
}多模态参考生视频
传入参考图、参考视频、参考音频(带 reference_* 角色),不可单独输入音频:
{
"model": "doubao-seedance-2-0",
"content": [
{ "type": "text", "text": "这个人在唱歌,口型与音频同步" },
{ "type": "image_url", "image_url": { "url": "asset://asset-xxxx" }, "role": "reference_image" },
{ "type": "audio_url", "audio_url": { "url": "https://example.com/voice.mp3" }, "role": "reference_audio" }
],
"generate_audio": true
}Authorization
BearerAuth Authorization: Bearer <你的 API 密钥>
In: header
Request Body
application/json
TypeScript Definitions
Use the request body type in TypeScript.
Response Body
application/json
curl -X POST "https://api.3hei.com/v1/videos" \ -H "Content-Type: application/json" \ -d '{ "model": "doubao-seedance-2-0", "content": [ { "type": "text" } ] }'{
"id": "cgt-20250615xxxxxxxx"
}