Seedance 2.5 图生视频
Seedance 2.5 Image-to-Video 是一款基于参考文字进行多模态视频生成的工具,并支持视频编辑与扩展功能。
bytedance/seedance-2-5/image-to-video
1. 认证
API 使用 API Key 进行认证。
获取 API Key
从 https://icreat.ai/hub/keys 获取 API Key。
2. 调用 API
提交请求
使用 cURL 提交 HTTP 请求以启动参考图生成视频任务:
curl --fail-with-body --connect-timeout 10 --max-time 60 \
-X POST https://api.icreat.ai/v1/task/submit/bytedance/seedance-2-5/image-to-video \
-H "Authorization: Bearer ${ICREAT_API_KEY}" \
-H "Content-Type: application/json" \
-d '{
"content": [
{
"type": "text",
"text": "A cat is playing with a ball"
},
{
"type": "image_url",
"image_url": {
"url": "https://example.com/reference.jpg"
},
"role": "reference_image"
}
],
"generate_audio": true,
"ratio": "3:4",
"duration": 5,
"resolution": "480p"
}'服务器将返回类似如下的响应体:
{ "task_id": "task-xxx" }使用 task_id 轮询任务状态并获取结果。
3. 轮询状态
curl --connect-timeout 10 --max-time 60 \
-X POST "https://api.icreat.ai/v1/task/query-status" \
-H "Authorization: Bearer ${ICREAT_API_KEY}" \
-H "Content-Type: application/json" \
-d '{
"task_id": "task-xxx"
}'服务器将返回任务状态。当状态为 SUCCEEDED 时,可以获取生成结果。
4. 获取结果
curl --connect-timeout 10 --max-time 60 \
-X POST "https://api.icreat.ai/v1/task/get-result" \
-H "Authorization: Bearer ${ICREAT_API_KEY}" \
-H "Content-Type: application/json" \
-d '{
"task_id": "task-xxx"
}'服务器将返回该任务生成的视频。
5. Schema
顶层字段
API 使用多模态输入结构。content 是必填数组,包含文本提示词和参考图像。
| 字段 | 类型 | 必填 | 描述 |
|---|---|---|---|
content |
object[] | 是 | 多模态内容数组,包含文本提示词和参考图像。 |
generate_audio |
boolean | 否 | 是否生成音频。 |
ratio |
string | 否 | 输出视频宽高比。支持 16:9、4:3、1:1、3:4、9:16、21:9 和 adaptive。设置为 adaptive 时,模型会根据输入自动选择合适的宽高比。 |
resolution |
string | 否 | 输出视频分辨率。支持 480p 和 720p。 |
duration |
integer | 否 | 视频时长,单位为秒。支持 4 至 30 的整数,或使用 -1 让模型自动选择时长。 |
watermark |
boolean | 否 | 是否添加“AI Generated”水印。 |
content[] 项
| 字段 | 类型 | 必填 | 描述 |
|---|---|---|---|
type |
string | 是 | 内容类型。支持 text 和 image_url。 |
text |
string | 条件必填 | 当 type 为 text 时必填,用于描述视频生成内容。支持中文、英文、日文、印尼文、西班牙文和葡萄牙文。 |
image_url |
object | 条件必填 | 当 type 为 image_url 时必填。格式为 {"url":"https://..."}。 |
role |
string | 媒体必填 | 参考图像的角色。参考图生成视频时必须设置为 reference_image。 |
need_review |
boolean | 否 | 是否将参考图像提交官方审核。当参考图像包含人脸或受版权保护的 IP 时,建议设置为 true。 |
中文提示词不得超过 2000 个字符,英文提示词不得超过 2000 个单词。过长的提示词可能会稀释关键信息,导致模型忽略部分细节。
need_review 指南
- 如果参考图像包含人脸或受版权保护的 IP,请将
need_review设置为true,否则生成可能失败。 - 需要审核的参考图像如果将
need_review设置为false,任务可能失败。 - 不需要审核的参考图像如果将
need_review设置为true,生成时间可能会延长。
参考图像要求
- 支持格式:
jpeg、png、webp、bmp、tiff、gif、heic和heif - 宽高比(宽/高):
0.4–2.5 - 宽度和高度:
300–6000px - 每张图像最大大小:小于
30 MB - 最大请求体大小:
64 MB - 支持同时提供
1–30张参考图像 - 每张参考图像的
role必须设置为reference_image
6. 输入示例
6.1 参考图像生成视频
{
"content": [
{
"type": "text",
"text": "A cat is playing with a ball"
},
{
"type": "image_url",
"image_url": {
"url": "https://example.com/reference.jpg"
},
"role": "reference_image"
}
],
"generate_audio": true,
"ratio": "3:4",
"duration": 5,
"resolution": "480p"
}6.2 使用多张参考图像生成视频
{
"content": [
{
"type": "text",
"text": "A cat is playing with a ball"
},
{
"type": "image_url",
"image_url": {
"url": "https://example.com/cat.jpg"
},
"role": "reference_image"
},
{
"type": "image_url",
"image_url": {
"url": "https://example.com/ball.jpg"
},
"role": "reference_image"
}
],
"generate_audio": true,
"ratio": "3:4",
"duration": 5,
"resolution": "480p"
}6.3 包含人脸或受版权保护 IP 的参考图像
{
"content": [
{
"type": "text",
"text": "A character walking through a futuristic city"
},
{
"type": "image_url",
"image_url": {
"url": "https://example.com/reference.jpg"
},
"role": "reference_image",
"need_review": true
}
],
"generate_audio": true,
"ratio": "16:9",
"duration": 5,
"resolution": "720p"
}