> ## Documentation Index
> Fetch the complete documentation index at: https://docs.dreamto.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Seedance 2.5 Flash 视频生成

> Seedance 2.5 Flash 视频生成：Seedance 2.5 的高性价比版本，单次最长 30 秒，支持 480p / 720p 与参考 / 编辑 / 延长。

Seedance 2.5 Flash 是 Seedance 2.5 系列中兼顾速度与成本的一档：保留 2.5 的多模态音视频联合生成、单次最长 30 秒的多镜头叙事，以及参考、编辑、延长三种全能参考模式，出片更快、价格更低，分辨率为 480p / 720p，可参考最多 10 张图片、5 段视频和 5 段音频。适合批量短视频、电商素材和需要快速迭代的创作场景。

`model` 填 `seedance-2.5-flash`，其余用法见 [通用说明](https://docs.dreamto.ai/video/seedance-2-0.md)。

## 参数范围

超出范围返回 400，不建任务、不扣费。

| 字段 | 默认值 | 本模型取值 |
| - | - | - |
| `model` | — | `seedance-2.5-flash` |
| `duration` | `-1`（智能时长） | `4` \~ `30` 秒的整数，或 `-1` 智能时长 |
| `resolution` | `720p` | `480p` / `720p` |
| `ratio` | `adaptive` | `adaptive` / `16:9` / `9:16` / `1:1` / `4:3` / `3:4` / `21:9` |
| `generate_audio` | `true` | `true` / `false` |
| `omni_reference_task_type` | 不传（按素材判定） | `auto` / `reference` / `edit` / `extend` |

全部参数见 [创建视频生成任务](https://docs.dreamto.ai/api-reference/seedance-2-5-flash/create-task.md)。

## 参考素材

| 类型 | 本模型上限 | 用途 |
| - | - | - |
| 图片 `image_url` | 10 张 | 首帧 / 尾帧 / 参考图 |
| 视频 `video_url` | 5 个 | 参考视频（视频编辑 / 延长） |
| 音频 `audio_url` | 5 个 | 参考音频 |

素材地址可以是公网 `http(s)` 地址、`asset://<素材Id>`，或 Base64 内联数据 `data:<类型>/<格式>;base64,<数据>`（类型须与条目一致，如 `image_url` 用 `data:image/png;base64,...`，单个解码后不超过 45 MB、整个请求体不超过 64 MB，网关转存为 URL 后提交；较大的视频、音频建议直接传 URL）；超出上限时任务失败。

## 快速开始

创建任务后轮询，`status` 为 `succeeded` 时取 `content.video_url`。

```bash cURL theme={null}
# 1. 创建任务
curl -X POST "https://api.dreamto.ai/api/v3/contents/generations/tasks" \
  -H "Authorization: Bearer $DREAMTO_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "seedance-2.5-flash",
    "content": [
      {
        "type": "text",
        "text": "雨后的城市街头，霓虹灯倒映在积水中，镜头低角度跟随一辆自行车缓缓驶过"
      }
    ],
    "ratio": "16:9",
    "duration": 5,
    "resolution": "720p"
  }'

# 2. 查询任务（替换为上一步返回的 id）
curl "https://api.dreamto.ai/api/v3/contents/generations/tasks/task_8c1d2e3f4a5b6c7d8e9f0a1b" \
  -H "Authorization: Bearer $DREAMTO_API_KEY"
```

```python Python theme={null}
import os
import time

import requests

URL = "https://api.dreamto.ai/api/v3/contents/generations/tasks"
HEADERS = {"Authorization": f"Bearer {os.environ['DREAMTO_API_KEY']}"}

payload = {
    "model": "seedance-2.5-flash",
    "content": [
        {
            "type": "text",
            "text": "雨后的城市街头，霓虹灯倒映在积水中，镜头低角度跟随一辆自行车缓缓驶过"
        }
    ],
    "ratio": "16:9",
    "duration": 5,
    "resolution": "720p"
}

resp = requests.post(URL, headers=HEADERS, json=payload, timeout=60)
resp.raise_for_status()
task_id = resp.json()["id"]

while True:
    task = requests.get(f"{URL}/{task_id}", headers=HEADERS, timeout=30).json()
    if task["status"] == "succeeded":
        print(task["content"]["video_url"])
        break
    if task["status"] == "failed":
        raise RuntimeError(task["error"]["message"])
    time.sleep(5)
```

```javascript Node.js theme={null}
const URL = "https://api.dreamto.ai/api/v3/contents/generations/tasks";
const headers = {
  Authorization: `Bearer ${process.env.DREAMTO_API_KEY}`,
  "Content-Type": "application/json",
};

const payload = {
  "model": "seedance-2.5-flash",
  "content": [
    {
      "type": "text",
      "text": "雨后的城市街头，霓虹灯倒映在积水中，镜头低角度跟随一辆自行车缓缓驶过"
    }
  ],
  "ratio": "16:9",
  "duration": 5,
  "resolution": "720p"
};

const created = await fetch(URL, { method: "POST", headers, body: JSON.stringify(payload) });
if (!created.ok) throw new Error(JSON.stringify(await created.json()));
const { id } = await created.json();

for (;;) {
  const task = await (await fetch(`${URL}/${id}`, { headers })).json();
  if (task.status === "succeeded") {
    console.log(task.content.video_url);
    break;
  }
  if (task.status === "failed") throw new Error(task.error.message);
  await new Promise((r) => setTimeout(r, 5000));
}
```

## 使用示例

* [文生视频](https://docs.dreamto.ai/video/models/seedance-2-5-flash/scenarios/text-to-video.md)
* [图生视频（首帧）](https://docs.dreamto.ai/video/models/seedance-2-5-flash/scenarios/image-to-video.md)
* [首尾帧生视频](https://docs.dreamto.ai/video/models/seedance-2-5-flash/scenarios/first-last-frame.md)
* [多图参考生视频](https://docs.dreamto.ai/video/models/seedance-2-5-flash/scenarios/multi-image-reference.md)
* [视频编辑](https://docs.dreamto.ai/video/models/seedance-2-5-flash/scenarios/video-edit.md)
* [视频延长](https://docs.dreamto.ai/video/models/seedance-2-5-flash/scenarios/video-extend.md)
* [参考音频](https://docs.dreamto.ai/video/models/seedance-2-5-flash/scenarios/reference-audio.md)
* [联网搜索增强](https://docs.dreamto.ai/video/models/seedance-2-5-flash/scenarios/web-search.md)

## 常见报错

| 场景 | HTTP | 返回 |
| - | - | - |
| `duration` 超出 4 \~ 30 或不是整数 | 400 | `duration must be an integer from 4 to 30 seconds, or -1 (smart duration)` |
| `resolution` 不在 `480p` / `720p` 中 | 400 | `resolution must be one of: 480p, 720p` |
| 传入本模型不支持的字段 `camera_fixed` / `real_person_mode` / `draft` / `bitrate_mode` / `task_nickname` | 400 | `<字段> is not supported by this model` |
| 素材 Base64 数据无效 | 400 | `content[n].image_url.url is not valid base64 data` |
| Base64 素材解码后超过 45 MB | 400 | `content[n].video_url.url exceeds 45 MB; use an http/https URL` |
| 账号未开放该模型 | 404 | `error.code` 为 `not_found` |

全部错误码见 [错误码](https://docs.dreamto.ai/errors.md)。


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.