Seedance 2.0 Mini 图生视频
Seedance 2.0 Mini 提供快速视频生成功能。它可根据文本提示词生成 4 至 15 秒的视频,并支持多种宽高比、音频生成和增强型网页搜索功能。参考图片宽度限制300px-6000px。
bytedance/seedance-2-0-mini/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-0-mini/image-to-video \
-H "Authorization: Bearer ${ICREAT_API_KEY}" \
-H "Content-Type: application/json" \
-d '{
"content": [
{
"type": "text",
"text": "A golden retriever running on a beach at sunset in slow motion"
}
],
"ratio": "16:9",
"resolution": "1080p",
"duration": 5
}'服务器将返回类似如下的响应体:
{ "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[] | 是 | 多模态内容数组。请参见下方 schema |
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 到 15 的整数,或使用 -1 让模型自动选择时长 |
watermark |
boolean | 否 | 是否添加“AI Generated”水印 |
tools |
object[] | 否 | 要使用的工具列表 |
content[] 项
| 字段 | 类型 | 必填 | 描述 |
|---|---|---|---|
type |
string | 是 | 内容类型:text、image_url、video_url 或 audio_url |
text |
string | 条件必填 | 当 type=text 时必填。支持中文、英文、日文、印尼文、西班牙文和葡萄牙文 |
image_url |
object | 条件必填 | 当 type=image_url 时必填。格式:{"url":"https://..."} |
video_url |
object | 条件必填 | 当 type=video_url 时必填。格式:{"url":"https://..."} |
audio_url |
object | 条件必填 | 当 type=audio_url 时必填。格式:{"url":"https://..."} |
role |
string | 媒体必填 | 媒体角色:reference_image、reference_video、reference_audio、first_frame 或 last_frame |
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
支持以下模式:
-
首帧模式 提供一个
image_url项,并将其role设置为first_frame。 -
首尾帧模式 提供两个
image_url项,并分别将它们的角色设置为first_frame和last_frame。 -
参考图像模式 提供 1-9 个
image_url项,并将每张图像的role设置为reference_image。
参考视频
- 支持的格式:
mp4、mov - 支持的分辨率:
480p、720p、1080p、4k - 每个视频时长:
2-15秒 - 参考视频最大数量:3
- 所有参考视频的总时长最大值:
15秒 - 宽高比(宽/高):
0.4-2.5 - 宽度和高度:
300-6000px - 总像素数:
409600-8295044 - 每个视频最大大小:
200 MB - 帧率:
24-60 FPS
| 容器格式 | 扩展名 | MIME 类型 | 支持的编解码器 |
|---|---|---|---|
| MP4 | .mp4 |
video/mp4 |
视频:H.264/AVC、H.265/HEVC;音频:AAC、MP3 |
| QuickTime | .mov |
video/quicktime |
视频:H.264/AVC、H.265/HEVC;音频:AAC、MP3 |
参考音频
- 支持的格式:
wav、mp3 - 每个音频文件时长:
2-15秒 - 参考音频文件最大数量:3
- 所有参考音频文件的总时长最大值:
15秒 - 每个音频文件最大大小:
15 MB - 最大请求体大小:
64 MB - 不建议对大文件使用 Base64 编码
tools[] 项
| 字段 | 类型 | 必填 | 描述 |
|---|---|---|---|
type |
string | 是 | 工具类型。目前仅支持 web_search |
6. 输入示例
6.1 文本转视频
{
"content": [
{
"type": "text",
"text": "A cat is playing a ball"
}
],
"generate_audio": true,
"ratio": "3:4",
"duration": 5,
"resolution": "480p"
}6.2 不带水印
{
"content": [
{
"type": "text",
"text": "A cat is playing a ball"
}
],
"generate_audio": true,
"ratio": "3:4",
"duration": 5,
"resolution": "480p",
"watermark": false
}6.3 启用 web_search
{
"content": [
{
"type": "text",
"text": "A kitten plays the piano under the Eiffel Tower"
}
],
"ratio": "3:4",
"duration": 5,
"resolution": "480p",
"tools": [
{
"type": "web_search"
}
]
}6.4 图像转视频 - 首帧
{
"content": [
{
"type": "text",
"text": "A cat is playing a ball"
},
{
"type": "image_url",
"image_url": {
"url": "https://example.com/reference.jpg"
},
"role": "first_frame"
}
],
"generate_audio": true,
"ratio": "3:4",
"duration": 5,
"resolution": "480p"
}6.5 图像转视频 - 首帧和尾帧
{
"content": [
{
"type": "text",
"text": "A cat is playing a ball"
},
{
"type": "image_url",
"image_url": {
"url": "https://example.com/first.jpg"
},
"role": "first_frame"
},
{
"type": "image_url",
"image_url": {
"url": "https://example.com/last.jpg"
},
"role": "last_frame"
}
],
"generate_audio": true,
"ratio": "3:4",
"duration": 5,
"resolution": "480p"
}6.6 参考图像
{
"content": [
{
"type": "text",
"text": "A cat is playing a ball"
},
{
"type": "image_url",
"image_url": {
"url": "https://example.com/first.jpg"
},
"role": "reference_image"
},
{
"type": "image_url",
"image_url": {
"url": "https://example.com/last.jpg"
},
"role": "reference_image"
}
],
"generate_audio": true,
"ratio": "3:4",
"duration": 5,
"resolution": "480p"
}6.7 参考图像 - need_review
{
"content": [
{
"type": "text",
"text": "A cat is playing a ball"
},
{
"type": "image_url",
"image_url": {
"url": "https://example.com/first.jpg"
},
"role": "reference_image",
"need_review": true
},
{
"type": "image_url",
"image_url": {
"url": "https://example.com/last.jpg"
},
"role": "reference_image"
}
],
"generate_audio": true,
"ratio": "3:4",
"duration": 5,
"resolution": "480p"
}