Seedance 2.0 Mini 文生视频


Seedance 2.0 Mini Text-to-Video 提供快速视频生成功能。它可根据文本提示词生成 4 至 15 秒的视频,并支持多种宽高比、音频生成和增强型网页搜索功能。参考图片宽度限制300px-6000px。

bytedance/seedance-2-0-mini/text-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/text-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:94:31:13:49:1621:9adaptive。设置为 adaptive 时,模型会根据输入自动选择最合适的宽高比
resolution string 输出分辨率。支持的值:480p720p
duration integer 视频时长,单位为秒。接受 415 的整数,或使用 -1 让模型自动选择时长
watermark boolean 是否添加“AI Generated”水印
tools object[] 要使用的工具列表

content[]

字段 类型 必填 描述
type string 内容类型:textimage_urlvideo_urlaudio_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_imagereference_videoreference_audiofirst_framelast_frame
need_review boolean 是否将参考内容提交官方审核。当参考内容包含人脸或受版权保护的 IP 时,请将其设置为 true

中文提示词不得超过 2000 个字符,英文提示词不得超过 2000 个单词。过长的提示词可能会稀释信息,导致模型忽略某些细节。

need_review 指南

  • 如果参考内容包含人脸或受版权保护的 IP,请将 need_review 设置为 true;否则生成很可能失败。
  • 如果需要审核的内容在提交时将 need_review 设置为 false,任务很可能失败。
  • 如果不需要审核的内容在提交时将 need_review 设置为 true,生成可能需要更长时间。

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"
    }
  ]
}