简介
视频生成接口支持文生视频、图生视频、视频生视频等多种功能。通过统一的API接口,您可以调用Sora 2、Veo、阿里万相、豆包 Seedance 等多个主流视频生成模型。 重要提示:视频生成是异步任务,需要先提交任务获取任务ID,然后轮询查询任务状态直到成功。支持的模型及功能
| 模型系列 | 模型名称 | 支持功能 |
|---|---|---|
| Sora 2 | sora-2 | 文生视频、图生视频、视频生视频(Remix 模式) |
| 谷歌 Veo | veo-3.0-fast-generate-001 | 文生视频(首帧模式) |
veo-3.1-fast-generate-preview | 文生视频(首帧模式、首尾帧模式) | |
| Gemini Omni | gemini-omni-flash-preview | 文生视频、单图图生视频(含音频),详见 Gemini Omni Flash Preview |
| 阿里万相 | wan2.5-t2v-preview | 文生视频 |
wan2.5-i2v-preview | 图生视频(首帧模式) | |
| 豆包 Seedance | doubao-seedance-1-0-lite-t2v-250428 | 文生视频 |
doubao-seedance-1-0-lite-i2v-250428 | 图生视频(首帧模式、首尾帧模式、参考图模式) | |
doubao-seedance-1-0-pro-250528 | 文生视频(首帧模式) | |
doubao-seedance-1-5-pro-251215 | 文生视频、图生视频(首帧模式、首尾帧模式),支持音频生成 | |
doubao-seedance-1-5-pro-251215-noAudio | 文生视频、图生视频(首帧模式、首尾帧模式),不生成音频 |
- 文生视频(T2V):仅通过文本提示词生成视频
- 图生视频(I2V):基于参考图片生成视频
- 首帧模式:使用首帧图片作为起始画面
- 首尾帧模式:使用首帧和尾帧图片控制视频起止画面
- 参考图模式:使用参考图片作为风格参考(仅部分模型支持)
- 视频生视频(Remix):基于已有视频重新生成(仅 Sora 2 支持)
认证
string
必填
Bearer Token,如
Bearer sk-xxxxxxxxxxAPI 端点
提交视频任务
POST/v1/video/generations
提交视频生成任务,返回任务ID用于后续查询。
查询视频任务
GET/v1/video/generations/{task_id}
根据任务ID查询视频生成任务的状态和结果。
路径参数
string
必填
视频生成任务ID,由提交任务接口返回
响应示例
任务状态说明:| 状态 | 说明 | 建议操作 |
|---|---|---|
queued | 任务已排队,等待处理 | 继续轮询 |
in_progress | 任务正在处理中 | 继续轮询 |
succeeded | 任务成功完成 | 下载视频 |
failed | 任务失败 | 查看失败原因 |
{
"task_id": "video_69095b4ce0048190893a01510c0c98b0",
"status": "queued",
"format": "mp4"
}
{
"task_id": "video_69095b4ce0048190893a01510c0c98b0",
"status": "in_progress",
"format": "mp4"
}
{
"task_id": "video_69095b4ce0048190893a01510c0c98b0",
"status": "succeeded",
"format": "mp4"
}
{
"task_id": "video_69095b4ce0048190893a01510c0c98b0",
"status": "failed",
"format": "mp4",
"error": {
"code": 400,
"message": "提示词包含不当内容"
}
}
使用示例
curl -X GET "https://api.gravitex.ai/v1/video/generations/video_69095b4ce0048190893a01510c0c98b0" \
-H "Authorization: Bearer sk-xxxxxxxxxx"
下载视频
GET/v1/video/generations/download?id={videoId}
下载已完成的视频文件(仅 Sora 2 支持)。
查询参数
string
必填
视频ID,由查询任务接口返回的 task_id
响应示例
{
"success": true,
"generation_id": "video_69095b4ce0048190893a01510c0c98b0",
"task_id": "video_69095b4ce0048190893a01510c0c98b0",
"format": "mp4",
"size": 15728640,
"base64": "AAAAIGZ0eXBpc29tAAACAGlzb21pc28yYXZjMW1wNDEAAAAIZnJlZQAAB...",
"data_url": "data:video/mp4;base64,AAAAIGZ0eXBpc29tAAACAGlzb21pc28yYXZjMW1wNDEAAAAIZnJlZQAAB..."
}
| 字段名 | 类型 | 说明 |
|---|---|---|
success | boolean | 是否成功 |
generation_id | string | 生成ID(与 videoId 相同) |
task_id | string | 任务ID |
format | string | 视频格式(固定为 "mp4") |
size | number | 视频文件大小(字节) |
base64 | string | Base64 编码的视频数据 |
data_url | string | Data URL 格式的视频数据,可直接用于前端 <video> 标签 |
使用示例
curl -X GET "https://api.gravitex.ai/v1/video/generations/download?id=video_69095b4ce0048190893a01510c0c98b0" \
-H "Authorization: Bearer sk-xxxxxxxxxx"
提交视频任务
使用示例
- Sora 2
- Veo
- 阿里万相
- 豆包 Seedance
1. 文生视频(基础示例)2. 文生视频(横屏,8秒)3. 图生视频(首帧模式)4. Remix 模式(视频生视频)
curl -X POST "https://api.gravitex.ai/v1/video/generations" \
-H "Authorization: Bearer sk-xxxxxxxxxx" \
-H "Content-Type: application/json" \
-d '{
"model": "sora-2",
"prompt": "一只可爱的小猫在花园里玩耍,阳光明媚,画面温馨",
"seconds": "4",
"size": "720x1280"
}'
curl -X POST "https://api.gravitex.ai/v1/video/generations" \
-H "Authorization: Bearer sk-xxxxxxxxxx" \
-H "Content-Type: application/json" \
-d '{
"model": "sora-2",
"prompt": "一只可爱的小猫在花园里玩耍,阳光明媚,画面温馨",
"seconds": "8",
"size": "1280x720"
}'
curl -X POST "https://api.gravitex.ai/v1/video/generations" \
-H "Authorization: Bearer sk-xxxxxxxxxx" \
-H "Content-Type: application/json" \
-d '{
"model": "sora-2",
"prompt": "一只可爱的小猫在花园里玩耍,阳光明媚,画面温馨",
"seconds": "4",
"size": "720x1280",
"input_reference": "data:image/png;base64,iVBORw0KGgoAAxxxx..."
}'
curl -X POST "https://api.gravitex.ai/v1/video/generations" \
-H "Authorization: Bearer sk-xxxxxxxxxx" \
-H "Content-Type: application/json" \
-d '{
"model": "sora-2",
"prompt": "将视频改成夜晚场景,添加星空",
"seconds": "4",
"size": "720x1280",
"remix_from_video_id": "video_69095b4ce0048190893a01510c0c98b0"
}'
1. 文生视频(基础示例)2. 文生视频(竖屏,带随机种子)3. 图生视频(首帧模式)4. 图生视频(首尾帧模式,仅 veo-3.1 支持)
curl -X POST "https://api.gravitex.ai/v1/video/generations" \
-H "Authorization: Bearer sk-xxxxxxxxxx" \
-H "Content-Type: application/json" \
-d '{
"model": "veo-3.1-fast-generate-preview",
"prompt": "科幻城市鸟瞰图,黎明时分,阳光穿透云层",
"durationSeconds": 8,
"aspectRatio": "16:9",
"resolution": "1080p",
"fps": 24,
"generateAudio": true,
"personGeneration": "allow_all",
"addWatermark": false
}'
curl -X POST "https://api.gravitex.ai/v1/video/generations" \
-H "Authorization: Bearer sk-xxxxxxxxxx" \
-H "Content-Type: application/json" \
-d '{
"model": "veo-3.1-fast-generate-preview",
"prompt": "科幻城市鸟瞰图,黎明时分,阳光穿透云层",
"durationSeconds": 6,
"aspectRatio": "9:16",
"resolution": "720p",
"fps": 30,
"generateAudio": false,
"personGeneration": "allow_adult",
"addWatermark": true,
"seed": 12345,
"sampleCount": 2
}'
curl -X POST "https://api.gravitex.ai/v1/video/generations" \
-H "Authorization: Bearer sk-xxxxxxxxxx" \
-H "Content-Type: application/json" \
-d '{
"model": "veo-3.1-fast-generate-preview",
"prompt": "基于这张图片生成视频,画面逐渐展开",
"durationSeconds": 8,
"aspectRatio": "16:9",
"resolution": "1080p",
"fps": 24,
"image": "data:image/png;base64,iVBORw0KGgoAAxxxx...",
"generateAudio": true,
"personGeneration": "dont_allow",
"addWatermark": false
}'
curl -X POST "https://api.gravitex.ai/v1/video/generations" \
-H "Authorization: Bearer sk-xxxxxxxxxx" \
-H "Content-Type: application/json" \
-d '{
"model": "veo-3.1-fast-generate-preview",
"prompt": "从第一张图过渡到第二张图",
"durationSeconds": 8,
"aspectRatio": "16:9",
"resolution": "1080p",
"fps": 24,
"image": "data:image/png;base64,iVBORw0KGgoAAxxxx...",
"lastFrame": "data:image/png;base64,iVBORw0KGgoAAyyyy...",
"generateAudio": true,
"seed": 67890,
"sampleCount": 1
}'
1. 文生视频(基础示例)2. 文生视频(10秒,1080p,带随机种子)3. 图生视频(首帧模式)4. 图生视频(带自定义音频)
curl -X POST "https://api.gravitex.ai/v1/video/generations" \
-H "Authorization: Bearer sk-xxxxxxxxxx" \
-H "Content-Type: application/json" \
-d '{
"model": "wan2.5-t2v-preview",
"prompt": "一只小猫慢慢睁开眼睛,耳朵轻轻抖动,镜头慢慢推进",
"duration": 5,
"size": "1280*720",
"smart_rewrite": true,
"generate_audio": true
}'
curl -X POST "https://api.gravitex.ai/v1/video/generations" \
-H "Authorization: Bearer sk-xxxxxxxxxx" \
-H "Content-Type: application/json" \
-d '{
"model": "wan2.5-t2v-preview",
"prompt": "一只小猫慢慢睁开眼睛,耳朵轻轻抖动,镜头慢慢推进",
"duration": 10,
"size": "1920*1080",
"smart_rewrite": false,
"generate_audio": false,
"seed": 123456
}'
curl -X POST "https://api.gravitex.ai/v1/video/generations" \
-H "Authorization: Bearer sk-xxxxxxxxxx" \
-H "Content-Type: application/json" \
-d '{
"model": "wan2.5-i2v-preview",
"prompt": "小猫慢慢睁开眼睛,耳朵轻轻抖动,镜头慢慢推进",
"duration": 5,
"resolution": "720p",
"smart_rewrite": true,
"generate_audio": true,
"image": "data:image/png;base64,iVBORw0KGgoAAxxxx..."
}'
curl -X POST "https://api.gravitex.ai/v1/video/generations" \
-H "Authorization: Bearer sk-xxxxxxxxxx" \
-H "Content-Type: application/json" \
-d '{
"model": "wan2.5-i2v-preview",
"prompt": "小猫慢慢睁开眼睛,耳朵轻轻抖动,镜头慢慢推进",
"duration": 10,
"resolution": "1080p",
"smart_rewrite": false,
"generate_audio": false,
"audio_url": "https://example.com/audio.mp3",
"image": "data:image/png;base64,iVBORw0KGgoAAxxxx...",
"seed": 789012
}'
1. 文生视频(T2V,基础示例)2. 文生视频(T2V,完整参数)3. 图生视频(首帧模式)4. 图生视频(首尾帧模式,仅 lite-i2v 支持)5. 图生视频(参考图模式,仅 lite-i2v 支持)6. Pro 模型(首帧模式)7. Seedance 1.5 Pro 文生视频(带音频)8. Seedance 1.5 Pro 图生视频(首帧模式,不带音频)9. Seedance 1.5 Pro 图生视频(首尾帧模式,带音频)
curl -X POST "https://api.gravitex.ai/v1/video/generations" \
-H "Authorization: Bearer sk-xxxxxxxxxx" \
-H "Content-Type: application/json" \
-d '{
"model": "doubao-seedance-1-0-lite-t2v-250428",
"metadata": {
"content": [
{
"type": "text",
"text": "一只小猫在花园里玩耍,阳光明媚 --ratio 16:9 --dur 5 --rs 720p --wm false"
}
]
}
}'
curl -X POST "https://api.gravitex.ai/v1/video/generations" \
-H "Authorization: Bearer sk-xxxxxxxxxx" \
-H "Content-Type: application/json" \
-d '{
"model": "doubao-seedance-1-0-lite-t2v-250428",
"metadata": {
"content": [
{
"type": "text",
"text": "一只小猫在花园里玩耍,阳光明媚 --ratio 9:16 --dur 10 --rs 1080p --fps 30 --wm true --seed 12345"
}
]
}
}'
curl -X POST "https://api.gravitex.ai/v1/video/generations" \
-H "Authorization: Bearer sk-xxxxxxxxxx" \
-H "Content-Type: application/json" \
-d '{
"model": "doubao-seedance-1-0-lite-i2v-250428",
"metadata": {
"content": [
{
"type": "text",
"text": "女孩睁开眼睛,温柔地看着镜头 --ratio adaptive --dur 5 --rs 720p --wm false"
},
{
"type": "image_url",
"image_url": {
"url": "data:image/png;base64,iVBORw0KGgoAAxxxx..."
}
}
]
}
}'
curl -X POST "https://api.gravitex.ai/v1/video/generations" \
-H "Authorization: Bearer sk-xxxxxxxxxx" \
-H "Content-Type: application/json" \
-d '{
"model": "doubao-seedance-1-0-lite-i2v-250428",
"metadata": {
"content": [
{
"type": "text",
"text": "一只蓝绿色的精卫鸟变成人形 --rs 720p --dur 5 --fps 24 --cf false --wm false --seed 67890"
},
{
"type": "image_url",
"image_url": {
"url": "data:image/png;base64,iVBORw0KGgoAAxxxx..."
},
"role": "first_frame"
},
{
"type": "image_url",
"image_url": {
"url": "data:image/png;base64,iVBORw0KGgoAAyyyy..."
},
"role": "last_frame"
}
]
}
}'
curl -X POST "https://api.gravitex.ai/v1/video/generations" \
-H "Authorization: Bearer sk-xxxxxxxxxx" \
-H "Content-Type: application/json" \
-d '{
"model": "doubao-seedance-1-0-lite-i2v-250428",
"metadata": {
"content": [
{
"type": "text",
"text": "[图1] 戴眼镜穿蓝色T恤的男孩和 [图2] 柯基狗,坐在 [图3] 草坪上,3D卡通风格 --rs 720p --dur 5 --ratio 16:9 --wm false"
},
{
"type": "image_url",
"image_url": {
"url": "https://example.com/ref1.png"
},
"role": "reference_image"
},
{
"type": "image_url",
"image_url": {
"url": "https://example.com/ref2.png"
},
"role": "reference_image"
},
{
"type": "image_url",
"image_url": {
"url": "https://example.com/ref3.png"
},
"role": "reference_image"
}
]
}
}'
curl -X POST "https://api.gravitex.ai/v1/video/generations" \
-H "Authorization: Bearer sk-xxxxxxxxxx" \
-H "Content-Type: application/json" \
-d '{
"model": "doubao-seedance-1-0-pro-250528",
"metadata": {
"content": [
{
"type": "text",
"text": "女孩睁开眼睛,温柔地看着镜头 --ratio 16:9 --dur 5 --rs 1080p --wm false"
},
{
"type": "image_url",
"image_url": {
"url": "data:image/png;base64,iVBORw0KGgoAAxxxx..."
}
}
]
}
}'
curl -X POST "https://api.gravitex.ai/v1/video/generations" \
-H "Authorization: Bearer sk-xxxxxxxxxx" \
-H "Content-Type: application/json" \
-d '{
"model": "doubao-seedance-1-5-pro-251215",
"metadata": {
"content": [
{
"type": "text",
"text": "一只可爱的小猫在花园里追逐蝴蝶,春天的阳光洒在花朵上 --ratio 16:9 --dur 6 --rs 720p --wm false"
}
]
}
}'
curl -X POST "https://api.gravitex.ai/v1/video/generations" \
-H "Authorization: Bearer sk-xxxxxxxxxx" \
-H "Content-Type: application/json" \
-d '{
"model": "doubao-seedance-1-5-pro-251215-noAudio",
"metadata": {
"content": [
{
"type": "text",
"text": "画面逐渐动起来,人物微笑看向镜头 --ratio 16:9 --dur 5 --rs 720p --wm false"
},
{
"type": "image_url",
"image_url": {
"url": "data:image/png;base64,iVBORw0KGgoAAxxxx..."
}
}
]
}
}'
curl -X POST "https://api.gravitex.ai/v1/video/generations" \
-H "Authorization: Bearer sk-xxxxxxxxxx" \
-H "Content-Type: application/json" \
-d '{
"model": "doubao-seedance-1-5-pro-251215",
"metadata": {
"content": [
{
"type": "text",
"text": "从静态画面过渡到动态场景 --ratio 16:9 --dur 8 --rs 720p --wm false"
},
{
"type": "image_url",
"image_url": {
"url": "data:image/png;base64,iVBORw0KGgoAAxxxx..."
},
"role": "first_frame"
},
{
"type": "image_url",
"image_url": {
"url": "data:image/png;base64,iVBORw0KGgoAAyyyy..."
},
"role": "last_frame"
}
]
}
}'
响应示例
{
"task_id": "video_69095b4ce0048190893a01510c0c98b0",
"status": "submitted",
"format": "mp4"
}
请求参数
string
必填
模型标识,支持的模型及功能如下:Sora 2 系列:
sora-2- 支持文生视频、图生视频、视频生视频(Remix 模式)
veo-3.0-fast-generate-001- 文生视频(首帧模式)veo-3.1-fast-generate-preview- 文生视频(首帧模式、首尾帧模式)
wan2.5-t2v-preview- 文生视频wan2.5-i2v-preview- 图生视频(首帧模式)
doubao-seedance-1-0-lite-t2v-250428- 文生视频1111doubao-seedance-1-0-lite-i2v-250428- 图生视频(首帧模式、首尾帧模式、参考图模式)doubao-seedance-1-0-pro-250528- 文生视频(首帧模式)doubao-seedance-1-5-pro-251215- 文生视频、图生视频(首帧模式、首尾帧模式),支持音频生成doubao-seedance-1-5-pro-251215-noAudio- 文生视频、图生视频(首帧模式、首尾帧模式),不生成音频
string
视频生成提示词,描述画面动作和场景。注意:豆包 Seedance 系列模型不需要此字段,提示词直接写在
metadata.content 数组的 text 字段中string
图生视频时的参考图片(支持 Base64 或 URL 格式)
integer
默认值:"5"
视频时长(秒),不同模型支持不同时长
string
默认值:"720p"
视频分辨率:
480p、720p、1080p、4kstring
默认值:"16:9"
宽高比:
16:9、9:16、1:1、4:3、3:4、21:9、adaptive(自适应,仅部分模型支持)模型专用参数
不同模型支持不同的专用参数,以下按模型系列分类说明:- Sora 2
- Veo
- 阿里万相
- 豆包 Seedance
string|integer
默认值:"4"
视频时长(秒),支持:
4、8、12string
默认值:"720x1280"
视频分辨率,支持:
720x1280(竖屏)、1280x720(横屏)string
参考图片(支持 URL 或 Base64 格式),用于图生视频
string
Remix 模式:基于已有视频ID重新生成(必须以
video_ 开头)integer
默认值:"4"
视频时长(秒),支持:
4、6、8string
默认值:"16:9"
宽高比,仅支持:
16:9、9:16string
默认值:"1080p"
分辨率,支持:
720p、1080pinteger
默认值:"24"
帧率,默认 24
string
首帧参考图(支持 URL 或 Base64 格式)
string
尾帧参考图(支持 URL 或 Base64 格式),仅
veo-3.1 系列支持boolean
默认值:"false"
是否生成同步音频。快速版模型会忽略该参数并始终包含音频
string
默认值:"allow_all"
人像生成策略:
allow_all(所有年龄)、allow_adult(成年人)、dont_allow(禁止人像)boolean
默认值:"false"
是否添加水印
integer
随机种子,用于复现结果
integer
默认值:"1"
每次生成的视频数量,范围:
1-4integer
默认值:"5"
视频时长(秒),支持:
5、10string
默认值:"720p"
视频分辨率,支持:
480p、720p、1080pstring
视频尺寸(仅 t2v 模式),格式:
宽度*高度,如 1280*720boolean
默认值:"false"
是否启用智能提示词扩写
boolean
默认值:"false"
是否生成与画面同步的音频
string
自定义音频文件URL(HTTPS格式)
integer
随机种子,范围:
0-2147483647array
必填
内容数组,必须放在
metadata 对象中。必须包含文本和可选的图片。参数通过文本提示词中的特殊标记控制:--rs或--resolution:分辨率(480p、720p、1080p)--ratio:宽高比(16:9、9:16、1:1、4:3、3:4、adaptive,注意doubao-seedance-1-0-lite-t2v-250428不支持adaptive)--dur或--duration:时长(秒,如5、10)--fps或--framespersecond:帧率(如24、30)--seed:随机种子--wm或--watermark:水印开关(true、false)--cf或--camerafixed:固定摄像头(true、false,仅 lite 模型支持)
- 1.0 lite/pro 系列:
doubao-seedance-1-0-lite-t2v-250428、doubao-seedance-1-0-lite-i2v-250428、doubao-seedance-1-0-pro-250528- 支持基础视频生成功能
- lite-i2v 支持首尾帧模式和参考图模式
- pro 模型支持高分辨率(720p/1080p)
- 1.5 pro 系列:
doubao-seedance-1-5-pro-251215、doubao-seedance-1-5-pro-251215-noAudio- 1.5-pro:支持文生视频和图生视频(首帧模式、首尾帧模式),自动生成匹配的音频
- 1.5-pro-noAudio:与 1.5-pro 功能相同,但不生成音频,视频渲染更快
- 分辨率支持:仅支持
480p和720p(不支持 1080p) - 时长支持:4-12 秒之间的任意整数(如 4、5、6、7、8、9、10、11、12)
- 图生视频模式:支持首帧模式和首尾帧模式(不支持参考图模式)
{
"metadata": {
"content": [
{
"type": "text",
"text": "提示词内容 --ratio 16:9 --dur 5 --rs 720p --wm false"
},
{
"type": "image_url",
"image_url": {
"url": "data:image/png;base64,..."
},
"role": "first_frame" // 可选:first_frame、last_frame、reference_image
}
],
"return_last_frame": true, // 是否返回最后一帧(1.5 Pro 系列)
"callback_url": "https://your-domain.com/callback" // 可选的回调 URL
}
}
完整示例
豆包 Seedance 系列
豆包 Seedance 系列模型使用特殊的参数传递方式:所有参数通过提示词中的特殊标记传递,图片通过metadata.content 数组传递。
1. 文生视频(T2V)
curl -X POST "https://api.gravitex.ai/v1/video/generations" \
-H "Authorization: Bearer sk-xxxxxxxxxx" \
-H "Content-Type: application/json" \
-d '{
"model": "doubao-seedance-1-0-lite-t2v-250428",
"metadata": {
"content": [
{
"type": "text",
"text": "一只小猫在花园里玩耍,阳光明媚 --ratio 16:9 --dur 5 --rs 720p --wm false"
}
]
}
}'
2. 图生视频 - 首帧模式
curl -X POST "https://api.gravitex.ai/v1/video/generations" \
-H "Authorization: Bearer sk-xxxxxxxxxx" \
-H "Content-Type: application/json" \
-d '{
"model": "doubao-seedance-1-0-lite-i2v-250428",
"metadata": {
"content": [
{
"type": "text",
"text": "女孩睁开眼睛,温柔地看着镜头 --ratio adaptive --dur 5 --rs 720p --wm false"
},
{
"type": "image_url",
"image_url": {
"url": "data:image/png;base64,iVBORw0KGgoAAxxxx..."
}
}
]
}
}'
3. 图生视频 - 首尾帧模式(仅 lite-i2v 支持)
curl -X POST "https://api.gravitex.ai/v1/video/generations" \
-H "Authorization: Bearer sk-xxxxxxxxxx" \
-H "Content-Type: application/json" \
-d '{
"model": "doubao-seedance-1-0-lite-i2v-250428",
"metadata": {
"content": [
{
"type": "text",
"text": "一只蓝绿色的精卫鸟变成人形 --rs 720p --dur 5 --cf false"
},
{
"type": "image_url",
"image_url": {
"url": "data:image/png;base64,iVBORw0KGgoAAxxxx..."
},
"role": "first_frame"
},
{
"type": "image_url",
"image_url": {
"url": "data:image/png;base64,iVBORw0KGgoAAyyyy..."
},
"role": "last_frame"
}
]
}
}'
4. 图生视频 - 参考图模式(仅 lite-i2v 支持)
curl -X POST "https://api.gravitex.ai/v1/video/generations" \
-H "Authorization: Bearer sk-xxxxxxxxxx" \
-H "Content-Type: application/json" \
-d '{
"model": "doubao-seedance-1-0-lite-i2v-250428",
"metadata": {
"content": [
{
"type": "text",
"text": "[图1] 戴眼镜穿蓝色T恤的男孩和 [图2] 柯基狗,坐在 [图3] 草坪上,3D卡通风格 --rs 720p --dur 5"
},
{
"type": "image_url",
"image_url": {
"url": "https://example.com/ref1.png"
},
"role": "reference_image"
},
{
"type": "image_url",
"image_url": {
"url": "https://example.com/ref2.png"
},
"role": "reference_image"
},
{
"type": "image_url",
"image_url": {
"url": "https://example.com/ref3.png"
},
"role": "reference_image"
}
]
}
}'
5. Seedance 1.5 Pro 文生视频(带音频)
curl -X POST "https://api.gravitex.ai/v1/video/generations" \
-H "Authorization: Bearer sk-xxxxxxxxxx" \
-H "Content-Type: application/json" \
-d '{
"model": "doubao-seedance-1-5-pro-251215",
"metadata": {
"content": [
{
"type": "text",
"text": "海边日落,海鸥飞过,波浪拍打岸边,镜头缓缓推进 --ratio 16:9 --dur 8 --rs 720p --fps 30 --wm false"
}
]
}
}'
6. Seedance 1.5 Pro 图生视频 - 首帧模式(不带音频)
curl -X POST "https://api.gravitex.ai/v1/video/generations" \
-H "Authorization: Bearer sk-xxxxxxxxxx" \
-H "Content-Type: application/json" \
-d '{
"model": "doubao-seedance-1-5-pro-251215-noAudio",
"metadata": {
"content": [
{
"type": "text",
"text": "照片中的人物开始微笑,眼神望向远方 --ratio 16:9 --dur 10 --rs 480p --wm false"
},
{
"type": "image_url",
"image_url": {
"url": "data:image/png;base64,iVBORw0KGgoAAxxxx..."
}
}
]
}
}'
7. Seedance 1.5 Pro 图生视频 - 首尾帧模式(带音频)
curl -X POST "https://api.gravitex.ai/v1/video/generations" \
-H "Authorization: Bearer sk-xxxxxxxxxx" \
-H "Content-Type: application/json" \
-d '{
"model": "doubao-seedance-1-5-pro-251215",
"metadata": {
"content": [
{
"type": "text",
"text": "场景从白天平滑过渡到夜晚,灯光逐渐亮起 --ratio 16:9 --dur 12 --rs 720p --fps 24 --wm false"
},
{
"type": "image_url",
"image_url": {
"url": "data:image/png;base64,iVBORw0KGgoAAxxxx..."
},
"role": "first_frame"
},
{
"type": "image_url",
"image_url": {
"url": "data:image/png;base64,iVBORw0KGgoAAyyyy..."
},
"role": "last_frame"
}
]
}
}'
content数组必须放在metadata对象中- 所有参数通过提示词中的特殊标记传递(如
--ratio 16:9) - 图片必须放在
content数组中,使用image_url类型 - 首尾帧模式需要两张图片,分别标记
role: "first_frame"和role: "last_frame" - 参考图模式需要在提示词中使用
[图1]、[图2]等标记引用图片,图片标记role: "reference_image" doubao-seedance-1-0-lite-t2v-250428不支持图片输入和adaptive宽高比doubao-seedance-1-0-pro-250528仅支持首帧模式doubao-seedance-1-5-pro-251215自动生成音频,适合需要配乐的场景doubao-seedance-1-5-pro-251215-noAudio不生成音频,渲染速度更快,适合需要后期配音的场景- 1.5 pro 系列支持文生视频和图生视频(首帧模式、首尾帧模式),不支持参考图模式
- 1.5 pro 系列分辨率限制:仅支持
480p和720p(不支持 1080p) - 1.5 pro 系列时长范围:支持 4-12 秒之间的任意整数秒数
- 首尾帧模式:需要提供两张图片,分别标记
role: "first_frame"和role: "last_frame"
