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

# 通过 Comfy Router 使用 Seedance 1.5 Pro 251215

> 通过 Comfy Router 调用 byteplus/seedance-1-5-pro-251215：endpoint、请求形状以及 Router 返回的响应。

`byteplus/seedance-1-5-pro-251215` 的 API 参考文档，由 Comfy Router 从 BytePlus 提供。

## 快速开始

在[你的 Comfy 工作区](https://platform.comfy.org/profile/api-keys?onboarding=router)中创建一个密钥，并将其导出为 `COMFY_API_KEY`。Python 和 TypeScript 片段使用 Comfy SDK（`pip install comfy-sdk` 和 `npm install @comfyorg/sdk`）；cURL 片段是通过原始 HTTP 发出的相同调用。

**模型 ID：** `byteplus/seedance-1-5-pro-251215`

**端点：** `POST https://api.comfy.org/v2/models/byteplus/seedance-1-5-pro-251215`

<Tabs defaultTabIndex={1}>
  <Tab title="等待结果">
    <CodeGroup>
      ```python Python theme={null}
      from comfy_sdk import Comfy

      # 从环境变量中读取 COMFY_API_KEY。
      # SDK 会自动创建幂等键，并在自动重试时复用它。
      with Comfy() as client:
          result = client.models.run(
              "byteplus/seedance-1-5-pro-251215",
              {
                  "content": [
                      {
                          "text": "A red fox trotting through a snowy pine forest",
                          "type": "text",
                      },
                  ],
                  "duration": 5,
                  "ratio": "16:9",
                  "resolution": "720p",
              },
          )

      print(result)
      ```

      ```typescript TypeScript theme={null}
      import { comfy } from "@comfyorg/sdk";

      // 从环境变量中读取 COMFY_API_KEY。
      // SDK 会自动创建幂等键，并在自动重试时复用它。
      const { data } = await comfy.models.run("byteplus/seedance-1-5-pro-251215", {
        content: [
          {
            text: "A red fox trotting through a snowy pine forest",
            type: "text",
          },
        ],
        duration: 5,
        ratio: "16:9",
        resolution: "720p",
      });

      console.log(data);
      ```

      ```bash cURL theme={null}
      curl https://api.comfy.org/v2/models/byteplus/seedance-1-5-pro-251215 \
        -H "X-API-Key: $COMFY_API_KEY" \
        -H "Idempotency-Key: $(uuidgen)" \
        -H "Content-Type: application/json" \
        -d "{\"content\": [{\"text\":\"A red fox trotting through a snowy pine forest\",\"type\":\"text\"}], \"duration\": 5, \"ratio\": \"16:9\", \"resolution\": \"720p\"}"
      ```
    </CodeGroup>
  </Tab>

  <Tab title="排队并稍后收集">
    将相同的请求体发送到 `POST https://api.comfy.org/v2/models/byteplus/seedance-1-5-pro-251215/requests`。运行被受理后，Router 会立即返回 `201` 和 `request_id`；结果就绪后，可以从本进程或其他进程收集。状态、取消与收集的细节见 [队列投递](/zh/development/comfy-router/queue)。

    <CodeGroup>
      ```python Python theme={null}
      import asyncio
      from comfy_sdk import AsyncComfy

      # 从环境变量中读取 COMFY_API_KEY。
      # 每次 submit() 调用都会生成自己的 Idempotency-Key，并在自动重试时复用它。
      async def main():
          async with AsyncComfy() as client:
              handle = await client.models.submit(
                  "byteplus/seedance-1-5-pro-251215",
                  {
                      "content": [
                          {
                              "text": "A red fox trotting through a snowy pine forest",
                              "type": "text",
                          },
                      ],
                      "duration": 5,
                      "ratio": "16:9",
                      "resolution": "720p",
                  },
              )
              print("request_id:", handle.request_id)  # 配合模型 ID，这就是另一个进程所需的全部信息

              # 轮询直到请求完成，按服务器给出的 Retry-After 等待。
              async for update in handle.iter_events():
                  print(update.status, update.queue_position)

              # 提供商自己的负载，与 models.run() 返回的值相同。
              # 失败或已取消的请求会在此处抛出带类型的 Router 错误。
              result = await handle.get()

          print(result)

      asyncio.run(main())
      ```

      ```typescript TypeScript theme={null}
      import { comfy } from "@comfyorg/sdk";

      // 从环境变量中读取 COMFY_API_KEY。
      // 每次 submit() 调用都会生成自己的 Idempotency-Key，并在自动重试时复用它。
      const handle = await comfy.models.submit("byteplus/seedance-1-5-pro-251215", {
        content: [
          {
            text: "A red fox trotting through a snowy pine forest",
            type: "text",
          },
        ],
        duration: 5,
        ratio: "16:9",
        resolution: "720p",
      });
      console.log("requestId:", handle.requestId); // 配合模型 ID，这就是另一个进程所需的全部信息

      // 轮询直到请求完成，按服务器给出的 Retry-After 等待。
      for await (const update of handle.events()) {
        console.log(update.status, update.queuePosition);
      }

      // 与 models.run() 返回的结果相同。失败或已取消的请求会在此处被拒绝。
      const result = await handle.get();

      console.log(result.data);
      ```

      ```bash cURL theme={null}
      # 1. 提交。Router 返回 201，以及 request_id、status_url、response_url 和 cancel_url。
      curl https://api.comfy.org/v2/models/byteplus/seedance-1-5-pro-251215/requests \
        -H "X-API-Key: $COMFY_API_KEY" \
        -H "Idempotency-Key: $(uuidgen)" \
        -H "Content-Type: application/json" \
        -d "{\"content\": [{\"text\":\"A red fox trotting through a snowy pine forest\",\"type\":\"text\"}], \"duration\": 5, \"ratio\": \"16:9\", \"resolution\": \"720p\"}"

      # 2. 轮询直到状态为 COMPLETED，按每个响应给出的 Retry-After 秒数等待。
      REQUEST_ID="<request_id from the 201 body>"
      curl -i https://api.comfy.org/v2/models/byteplus/seedance-1-5-pro-251215/requests/$REQUEST_ID/status \
        -H "X-API-Key: $COMFY_API_KEY"

      # 3. 收集。完成时返回 200 和模型的原始输出；仍在运行时返回 202 和状态响应体。
      curl https://api.comfy.org/v2/models/byteplus/seedance-1-5-pro-251215/requests/$REQUEST_ID \
        -H "X-API-Key: $COMFY_API_KEY"
      ```
    </CodeGroup>
  </Tab>
</Tabs>

## Schema

### 输入

<ParamField body="callback_url" type="string (uri)">
  本次生成任务结果的回调通知地址

  格式：`uri`
</ParamField>

<ParamField body="content" type="object[]" required>
  供模型生成视频的输入内容
</ParamField>

<ParamField body="content[].audio_url" type="object">
  输入音频对象。仅 Seedance 2.5、2.0 和 2.0 fast 支持音频输入。Seedance 2.0 和 2.0 fast 不能单独使用音频，必须至少包含 1 个图像或视频；Seedance 2.5 支持仅音频输入。
</ParamField>

<ParamField body="content[].audio_url.url" type="string" required>
  音频网址、Base64 编码或资产 ID。
  音频网址：音频的公开网址（wav、mp3）。
  Base64：格式为 data:audio/\<format>;base64,\<content>
  资产 ID：格式为 asset://\<ASSET\_ID>
</ParamField>

<ParamField body="content[].draft_task" type="object">
  仅 Seedance 2.5。要渲染为最终视频的 Draft 任务。它必须是唯一的内容项。
  最终视频会复用该 Draft 任务的提示词、输入资产、时长、比例、种子、generate\_audio 和 omni\_reference\_task\_type，请勿再次提交它们。resolution 默认为 1080p，且仅支持 1080p。
</ParamField>

<ParamField body="content[].draft_task.id" type="string" required>
  使用 `draft` 设为 true 创建 Draft 视频时返回的任务 ID。
</ParamField>

<ParamField body="content[].image_url" type="object" />

<ParamField body="content[].image_url.url" type="string" required>
  用于图生视频生成的图像内容（当 type 为 "image\_url" 时）
  图片网址：请确保图片网址可访问。
  Base64 编码内容：格式必须为 data:image/\<format>;base64,\<content>
  资产 ID：格式为 asset://\<ASSET\_ID>
</ParamField>

<ParamField body="content[].role" type="string">
  内容项的角色/位置。
  对于图像：first\_frame、last\_frame 或 reference\_image。
  对于视频：reference\_video（仅 Seedance 2.5、2.0 和 2.0 fast）。
  对于音频：reference\_audio（仅 Seedance 2.5、2.0 和 2.0 fast）。

  可选值：`first_frame`、`last_frame`、`reference_image`、`reference_video`、`reference_audio`
</ParamField>

<ParamField body="content[].text" type="string">
  模型的输入文本信息。包含文本提示词和可选参数。

  文本提示词（必填）：使用中英文字符描述要生成的视频。

  参数（可选）：在文本提示词之后添加 --\[parameters] 以控制视频规格：

  * \--resolution (--rs)：480p、720p、1080p（默认：720p）
  * \--ratio (--rt)：21:9、16:9、4:3、1:1、3:4、9:16、9:21、adaptive（默认：16:9 或 adaptive）
  * \--duration (--dur)：3-12 秒（默认：5）
  * \--framepersecond (--fps)：24（默认：24）
  * \--watermark (--wm)：true/false（默认：false）
  * \--seed (--seed)：-1 到 2^32-1（默认：-1）
  * \--camerafixed (--cf)：true/false（默认：false）

  示例："A beautiful landscape --ratio 16:9 --resolution 720p --duration 5"

  Comfy 侧护栏，而非 BytePlus 的限制。BytePlus 未公布文本长度限制，在测试中接受了 40,000 个字符（2026-09-17）。它统计的是字符而非字节，因此多字节提示词在传输时可能达到该数值的数倍。它约束的是这一个字段，而不是整个请求：`content` 是数组，真正约束整个文档的是每请求的 body 限制。Comfy Router（/v2/models/byteplus/\{model}）是执行该限制的入口；在直接调用 v1 /proxy 时，则由 BytePlus 自身的校验器应答。该值设置得远高于真实流量，因此绝不会对真实提示词作出裁决。如果调用方需要更多，可以提高它。
</ParamField>

<ParamField body="content[].type" type="string" required>
  输入内容的类型

  可选值：`text`、`image_url`、`video_url`、`audio_url`、`draft_task`
</ParamField>

<ParamField body="content[].video_url" type="object">
  输入视频对象。仅 Seedance 2.5、2.0 和 2.0 fast 支持视频输入。
</ParamField>

<ParamField body="content[].video_url.url" type="string" required>
  视频网址或资产 ID。
  视频网址：视频的公开网址（mp4、mov）。
  资产 ID：格式为 asset://\<ASSET\_ID>
</ParamField>

<ParamField body="draft" type="boolean" default="false">
  仅 Seedance 2.5。生成 480p 的 Draft 视频；resolution 必须为 480p。
  将返回的任务 ID 传入 `draft_task` 内容项，以渲染最终的 1080p 视频。Draft 任务 ID 的有效期为 7 天。
</ParamField>

<ParamField body="duration" type="`-1` | object">
  视频时长（秒）。Seedance 2.5：\[4,30] 或 -1（自动；视频编辑任务仅支持 -1）。Seedance 2.0 和 2.0 fast：\[4,15] 或 -1（自动）。Seedance 1.5 pro：\[4,12] 或 -1。Seedance 1.0：\[2,12]。

  范围：`2` 到 `30`
</ParamField>

<ParamField body="execution_expires_after" type="integer">
  任务超时阈值（秒）。默认 172800（48 小时）。范围：\[3600, 259200]。

  范围：`3600` 到 `259200`
</ParamField>

<ParamField body="generate_audio" type="boolean" default="true">
  Seedance 2.5、2.0、2.0 fast 和 1.5 pro 支持。生成的视频是否包含与画面同步的音频。
  true：模型输出带同步音频的视频。
  false：模型输出无声视频。
</ParamField>

<ParamField body="model" type="string">
  要调用的模型 ID。支持的模型：seedance-1-5-pro-251215、seedance-1-0-pro-250528、seedance-1-0-pro-fast-251015、dreamina-seedance-2-0-260128、dreamina-seedance-2-0-fast-260128、dreamina-seedance-2-0-mini 和 dreamina-seedance-2-5-260628。直接调用 v1 的 POST /proxy/byteplus/api/v3/contents/generations/tasks 时必须提供它，代理会拒绝任何其他值，未提供时同样返回 400。它不在本 Schema 的 `required` 列表中，因为 Comfy Router 会从 /v2/models/byteplus/\{model} 的 `{model}` 路径段填充它，所以 Router 调用方可以省略。
</ParamField>

<ParamField body="output_format" type="string" default="&#x22;mp4&#x22;">
  仅 Seedance 2.5。输出视频的容器格式。mp4：通用容器（H.264/AAC、yuv420p），兼容性广，文件大小更小。
  mov：专业容器（H.264 High 4:4:4 Predictive/PCM、yuv444p），色彩精度高，适合后期制作；但文件大小更大。

  可选值：`mp4`、`mov`
</ParamField>

<ParamField body="ratio" type="string">
  已生成视频的比例。Seedance 2.0 与 2.0 fast、1.5 pro 默认：adaptive。
  Seedance 2.5 首帧 / 首尾帧生成：输出会跟随首帧的比例，因此只接受 `adaptive`（或省略该字段）；若传入具体比例，会在派发前以 400 拒绝。Seedance 2.0 在这些模式下可接受具体比例。

  可选值：`16:9`、`4:3`、`1:1`、`3:4`、`9:16`、`21:9`、`9:21`、`adaptive`
</ParamField>

<ParamField body="resolution" type="string">
  视频分辨率。Seedance 2.5、2.0 与 2.0 fast、1.5 pro、1.0 lite 默认：720p。Seedance 1.0 pro 与 pro-fast 默认：1080p。
  注意：Seedance 2.0 与 2.0 fast 不支持 1080p。Seedance 2.5 支持 480p、720p 和 1080p。

  可选值：`480p`、`720p`、`1080p`、`4k`
</ParamField>

<ParamField body="return_last_frame" type="boolean" default="false">
  是否返回已生成视频的最后一帧图像。
  true：返回已生成视频的最后一帧图像。将该参数设为 true 后，你可以通过调用“查询视频生成任务信息”来获取最后一帧图像。最后一帧图像为 PNG 格式，其像素宽度和高度与已生成视频一致，且不含水印。使用该参数可以生成多个连续的视频：将上一个已生成视频的最后一帧作为下一个视频任务的首帧，从而快速生成多个连续的视频。
  false：不返回已生成视频的最后一帧图像。
</ParamField>

<ParamField body="seed" type="integer">
  用于控制随机性的种子整数。范围：\[-1, 2^32-1]。-1 表示使用随机种子。

  范围：`-1` 到 `4294967295`
</ParamField>

<ParamField body="service_tier" type="string">
  处理所用的服务层级。Seedance 2.5、2.0 与 2.0 fast 不支持 flex（离线推理）。

  可选值：`default`、`flex`
</ParamField>

<ParamField body="watermark" type="boolean" default="false">
  已生成视频是否包含水印。
</ParamField>

该文档由 Router 在 `GET /v2/models/byteplus/seedance-1-5-pro-251215/openapi.json` 提供的 schema 生成，它也是请求到达提供商之前用于校验调用的同一份文档。

### 输出

<ResponseField name="content" type="object">
  视频生成任务完成后返回的输出，其中包含输出视频的下载 URL，以及当 BytePlus 返回时其最后一帧的下载 URL。`video_url` 和 `last_frame_url` 都会重新托管到 Comfy 存储上；此处的其他所有字段均由 BytePlus 提供。可为空：BytePlus 会在任务完成 24 小时后清除这些 URL，因此在之后轮询一个已成功的文档时，其 `content` 可能缺失或为 null。
</ResponseField>

<ResponseField name="content.last_frame_url" type="string">
  已生成视频最后一帧的下载 URL，当请求中设置了 `return_last_frame` 时返回。不要根据此 URL 推断图像格式：BytePlus 在请求侧将最后一帧记录为 PNG，Router 会重新托管它收到的任何字节，并根据上游 Content-Type 或内容嗅探确定类型，而 `image/jpeg` 只是两者都失败时的最后兜底。Router 会将最后一帧重新托管到 Comfy 存储上并改写此字段，因此它通常是 Comfy 签名的 URL，有效期最长 24 小时：签发时按 24 小时签名，并从 23 小时的备忘中回放，因此后续轮询返回的 URL 可能只剩一小时有效期。当无法执行重新托管时，此字段会保留 BytePlus 自己的 URL，而 BytePlus 会在任务完成 24 小时后清除该 URL。无论哪种方式链接都会过期，因此请下载该帧，而不要存储 URL。
</ResponseField>

<ResponseField name="content.output_format" type="string">
  已生成视频的容器格式（mp4 或 mov），当 BytePlus 将其嵌套在 `content` 中时出现。Seedance 模型更常将其作为 `content` 的顶层同级字段返回（参见顶层 `output_format` 字段），Router 会读取二者中存在的那个。
</ResponseField>

<ResponseField name="content.video_url" type="string">
  输出视频的下载 URL。Router 会将视频重新托管到 Comfy 存储上并改写此字段，因此它通常是 Comfy 签名的 URL，有效期最长 24 小时：签发时按 24 小时签名，并从 23 小时的备忘中回放，因此后续轮询返回的 URL 可能只剩一小时有效期。当无法执行重新托管时，此字段会保留 BytePlus 自己的 URL，而 BytePlus 会在任务完成 24 小时后清除该 URL，并在某些模型上将下载次数上限设为 100 次。无论哪种方式链接都会过期，因此请下载视频，而不要存储 URL。
</ResponseField>

<ResponseField name="created_at" type="integer">
  任务创建的时间。该值为 UNIX 时间戳，以秒为单位。
</ResponseField>

<ResponseField name="duration" type="number">
  已生成视频的时长，以秒为单位。之所以声明为 number 而不是 integer，是因为 BytePlus 对此并不一致：已观察到视频任务返回整数秒，而 BytePlus 的其他同类接口会报告带小数的时长，因此客户端不应假定它是整数值。这是 BytePlus 自己的字段，在成功的视频任务中返回，并原样转发。
</ResponseField>

<ResponseField name="error" type="object">
  错误信息。如果任务成功，则返回 null。如果任务失败，则返回错误信息。
</ResponseField>

<ResponseField name="error.code" type="string">
  上游 ModelArk 错误码。SensitiveContentDetected、InputTextSensitiveContentDetected、InputImageSensitiveContentDetected、InputVideoSensitiveContentDetected、InputAudioSensitiveContentDetected、OutputTextSensitiveContentDetected、OutputImageSensitiveContentDetected、OutputVideoSensitiveContentDetected 和 OutputAudioSensitiveContentDetected 表示内容策略拒绝。同一族系可能带有以点分隔的原因，例如 InputImageSensitiveContentDetected.PrivacyInformation、OutputVideoSensitiveContentDetected.PolicyViolation 或 OutputImageSensitiveContentDetected.DeepFake。这是一个开放字符串，而不是枚举：其他错误码描述验证和提供商故障。Router 会在 HTTP 400 错误信封和 HTTP 200 失败任务响应中识别策略族系，而不会覆盖传输层故障。
</ResponseField>

<ResponseField name="error.message" type="string">
  报错信息
</ResponseField>

<ResponseField name="id" type="string">
  视频生成任务的 ID
</ResponseField>

<ResponseField name="model" type="string">
  任务所用模型的名称和版本
</ResponseField>

<ResponseField name="output_format" type="string">
  已生成视频的容器格式（mp4 或 mov），作为 `content` 的同级字段在顶层返回：Seedance 视频任务查询即在此处返回它。这是 BytePlus 自己的字段，原样转发。
</ResponseField>

<ResponseField name="resolution" type="string">
  已生成视频的分辨率，例如 `1080p`。这是 BytePlus 自己的字段，在成功的视频任务中返回，并原样转发。
</ResponseField>

<ResponseField name="seed" type="integer">
  任务实际使用的生成种子。这是 BytePlus 自己的字段，在成功的视频任务中返回，并原样转发。

  格式：`int64`
</ResponseField>

<ResponseField name="status" type="string">
  任务的状态

  可能的值：`queued`、`running`、`cancelled`、`succeeded`、`failed`、`expired`
</ResponseField>

<ResponseField name="updated_at" type="integer">
  任务最后更新的时间。该值为 UNIX 时间戳，以秒为单位。
</ResponseField>

<ResponseField name="usage" type="object">
  请求的 token 用量
</ResponseField>

<ResponseField name="usage.completion_tokens" type="integer">
  模型生成的 token 数量
</ResponseField>

<ResponseField name="usage.total_tokens" type="integer">
  对于视频生成模型，不计算输入 token 数量，默认为 0。因此，total\_tokens = completion\_tokens。
</ResponseField>

## 示例

### 输入

```json theme={null}
{
  "content": [
    {
      "text": "A red fox trotting through a snowy pine forest",
      "type": "text"
    }
  ],
  "duration": 5,
  "ratio": "16:9",
  "resolution": "720p"
}
```

### 输出

```json theme={null}
{
  "content": {
    "last_frame_url": "https://example.invalid/byteplus/seedance-1-0-pro-250528/last-frame",
    "video_url": "https://example.invalid/byteplus/seedance-1-0-pro-250528/generated.mp4"
  },
  "created_at": 1767225600,
  "duration": 5,
  "error": null,
  "id": "3f7a1b28-5c0d-4e91-8a6f-1b2c3d4e5f60",
  "model": "seedance-1-5-pro-251215",
  "output_format": "mp4",
  "resolution": "1080p",
  "seed": 1234567890123,
  "status": "succeeded",
  "updated_at": 1767225730
}
```

## 发布前须知

SDK 会生成 `Idempotency-Key` 并在自动重试中复用它。手动重试时，请复用原始 key。Router 最长可保持连接 10 分钟。

请求失败时，Router 会发送 `X-Comfy-Error-Type` 响应头说明原因。`422` 表示 Router 在调用提供商之前就拒绝了输入，`413` 表示请求体超出了 Router 可接受的大小。已生成的资源请及时下载，因为[结果 URL 会过期](/zh/development/comfy-router/reference#结果资产)。

上文任何字段描述中提到的尺寸限制，都是提供商对该字段自身的限定，引自提供商的规范。Router 会对整个请求体另行设置上限，base64 编码的媒体内容也计入其中：参见[请求体大小](/zh/development/comfy-router/limitations)。

本页记录的是通过 Comfy Router 调用的某一个合作伙伴模型。同一个 `comfy-sdk` / `@comfyorg/sdk` 包还提供第二个客户端，用于在 Comfy Cloud 上运行完整的 ComfyUI 工作流图：`Comfy(api_key=...)` / `new Comfy({ apiKey })`，并带有 `client.workflows`、`client.assets` 和 `client.jobs`。请参阅 [Comfy SDKs](/zh/development/api-development/sdks)。

<CardGroup cols={3}>
  <Card title="请求头" icon="list" href="/zh/development/comfy-router/headers">
    身份验证、幂等性、请求 ID、错误分类、重试节奏、消费限额。
  </Card>

  <Card title="使用 Router API" icon="code" href="/zh/development/comfy-router/api">
    模型发现、验证错误、重试与计费。
  </Card>

  <Card title="限制" icon="triangle-exclamation" href="/zh/development/comfy-router/limitations">
    Router 目前不支持的功能，以及替代方案。
  </Card>
</CardGroup>
