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:94:31:13:49:1621:9adaptive。设置为 adaptive 时,模型会根据输入自动选择合适的宽高比。
resolution string 输出视频分辨率。支持 480p720p
duration integer 视频时长,单位为秒。支持 430 的整数,或使用 -1 让模型自动选择时长。
watermark boolean 是否添加“AI Generated”水印。

content[]

字段 类型 必填 描述
type string 内容类型。支持 textimage_url
text string 条件必填 typetext 时必填,用于描述视频生成内容。支持中文、英文、日文、印尼文、西班牙文和葡萄牙文。
image_url object 条件必填 typeimage_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,生成时间可能会延长。

参考图像要求

  • 支持格式:jpegpngwebpbmptiffgifheicheif
  • 宽高比(宽/高):0.42.5
  • 宽度和高度:3006000 px
  • 每张图像最大大小:小于 30 MB
  • 最大请求体大小:64 MB
  • 支持同时提供 130 张参考图像
  • 每张参考图像的 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"
}