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

# 使用 Comfy Router 调用 Seed Audio 1.5 261128

> 通过 Comfy Router 调用 byteplus/seed-audio-1-5-261128：端点、请求结构以及 Router 返回的响应。

`byteplus/seed-audio-1-5-261128` 的 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/seed-audio-1-5-261128`

**端点：** `POST https://api.comfy.org/v2/models/byteplus/seed-audio-1-5-261128`

> [tab] 等待结果
>
> ```python Python theme={null}
> from comfy_sdk import Comfy
>
> # 从环境变量中读取 COMFY_API_KEY。
> # SDK 会自动创建幂等键，并在自动重试时复用它。
> with Comfy() as client:
>     result = client.models.run(
>         "byteplus/seed-audio-1-5-261128",
>         {
>             "content": [
>                 {
>                     "text": "Read with a calm English voice: 'Hello from Comfy Router.'",
>                     "type": "text",
>                 },
>             ],
>             "output_format": "mp3",
>         },
>     )
>
> print(result)
> ```
>
> ```typescript TypeScript theme={null}
> import { comfy } from "@comfyorg/sdk";
>
> // 从环境变量中读取 COMFY_API_KEY。
> // SDK 会自动创建幂等键，并在自动重试时复用它。
> const { data } = await comfy.models.run("byteplus/seed-audio-1-5-261128", {
>   content: [
>     {
>       text: "Read with a calm English voice: 'Hello from Comfy Router.'",
>       type: "text",
>     },
>   ],
>   output_format: "mp3",
> });
>
> console.log(data);
> ```
>
> ```bash cURL theme={null}
> curl https://api.comfy.org/v2/models/byteplus/seed-audio-1-5-261128 \
>   -H "X-API-Key: $COMFY_API_KEY" \
>   -H "Idempotency-Key: $(uuidgen)" \
>   -H "Content-Type: application/json" \
>   -d "{\"content\": [{\"text\":\"Read with a calm English voice: 'Hello from Comfy Router.'\",\"type\":\"text\"}], \"output_format\": \"mp3\"}"
> ```

> [tab] 排队并稍后收集
>
> 同一请求体，发送到 `POST https://api.comfy.org/v2/models/byteplus/seed-audio-1-5-261128/requests`。只要运行被接纳，Router 就会返回 `201` 以及一个 `request_id`，结果准备就绪后再进行收集，可以从本进程或另一个进程收集。[队列投递](https://docs.comfy.org/zh/development/comfy-router/queue.md)会介绍状态、取消与收集的完整流程。
>
> ```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/seed-audio-1-5-261128",
>             {
>                 "content": [
>                     {
>                         "text": "Read with a calm English voice: 'Hello from Comfy Router.'",
>                         "type": "text",
>                     },
>                 ],
>                 "output_format": "mp3",
>             },
>         )
>         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/seed-audio-1-5-261128", {
>   content: [
>     {
>       text: "Read with a calm English voice: 'Hello from Comfy Router.'",
>       type: "text",
>     },
>   ],
>   output_format: "mp3",
> });
> 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/seed-audio-1-5-261128/requests \
>   -H "X-API-Key: $COMFY_API_KEY" \
>   -H "Idempotency-Key: $(uuidgen)" \
>   -H "Content-Type: application/json" \
>   -d "{\"content\": [{\"text\":\"Read with a calm English voice: 'Hello from Comfy Router.'\",\"type\":\"text\"}], \"output_format\": \"mp3\"}"
>
> # 2. 轮询直到状态为 COMPLETED，每个响应都会给出要等待的 Retry-After 秒数。
> REQUEST_ID="<request_id from the 201 body>"
> curl -i https://api.comfy.org/v2/models/byteplus/seed-audio-1-5-261128/requests/$REQUEST_ID/status \
>   -H "X-API-Key: $COMFY_API_KEY"
>
> # 3. 收集。返回 200 时携带模型的原生输出，仍在运行时返回 202 及状态响应体。
> curl https://api.comfy.org/v2/models/byteplus/seed-audio-1-5-261128/requests/$REQUEST_ID \
>   -H "X-API-Key: $COMFY_API_KEY"
> ```

## Schema

### 输入

**audio\_config** `object`

**audio\_config.loudness\_rate** `integer`

音量。100 为 2x，-50 为 0.5x。默认 0。

范围：`-50` 到 `100`

**audio\_config.pitch\_rate** `integer`

音高。默认 0。

范围：`-12` 到 `12`

**audio\_config.sample\_rate** `integer`

8000、16000、24000、32000、44100（默认）或 48000。ogg\_opus 仅支持 48000。

**audio\_config.speech\_rate** `integer`

语速。100 为 2x，-50 为 0.5x。默认 0。

范围：`-50` 到 `100`

**content** `object[]` *required*

输入内容。角色决定模式。文本转音频：一个 `text` 项，以及 0 到 6 个角色为 `reference_audio` 的 `audio_url` 项来设置音色，或一个角色为 `reference_image` 的 `image_url` 项（图像不能与音频或视频组合使用）。视频配音：一个 `text` 项、一个角色为 `reference_video` 的 `video_url`，以及可选的 `reference_audio` 项。视频翻译：一个角色为 `dubbing_video` 的 `video_url`，且不包含文本。音轨分离：一个 `text` 项和一个角色为 `separate_audio` 的 `audio_url`。不能混用两种模式的角色。

**content\[].audio\_url** `object`

**content\[].audio\_url.url** `string` *required*

公网 http(s) URL，或仅用于小文件的 base64 data URL：整个请求限制为 64 MB，因此请通过 URL 发送大型音频和视频。参考音频为 wav 或 mp3，时长 2 到 30 秒，最大 15 MB，所有片段总计最长 180 秒。待分离音频为 2 到 360 秒，最大 90 MB。视频为 mp4 或 mov，4 到 360 秒，480p 到 1080p，并包含音轨。图像为 jpeg、png、webp、bmp、tiff、gif、heic 或 heif，每边 300 到 6000 px，宽高比 0.4 到 2.5，小于 10 MB。

**content\[].image\_url** `object`

**content\[].image\_url.url** `string` *required*

公网 http(s) URL，或仅用于小文件的 base64 data URL：整个请求限制为 64 MB，因此请通过 URL 发送大型音频和视频。参考音频为 wav 或 mp3，时长 2 到 30 秒，最大 15 MB，所有片段总计最长 180 秒。待分离音频为 2 到 360 秒，最大 90 MB。视频为 mp4 或 mov，4 到 360 秒，480p 到 1080p，并包含音轨。图像为 jpeg、png、webp、bmp、tiff、gif、heic 或 heif，每边 300 到 6000 px，宽高比 0.4 到 2.5，小于 10 MB。

**content\[].role** `string`

reference\_audio、separate\_audio、reference\_video、dubbing\_video 或 reference\_image。

**content\[].text** `string`

提示词。请提供完整的台词、音色、情感、语速以及任何音乐或音效。视频翻译不接受文本。

**content\[].type** `string` *required*

text、audio\_url 或 video\_url。

**content\[].video\_url** `object`

**content\[].video\_url.url** `string` *required*

公网 http(s) URL，或仅用于小文件的 base64 data URL：整个请求限制为 64 MB，因此请通过 URL 发送大型音频和视频。参考音频为 wav 或 mp3，时长 2 到 30 秒，最大 15 MB，所有片段总计最长 180 秒。待分离音频为 2 到 360 秒，最大 90 MB。视频为 mp4 或 mov，4 到 360 秒，480p 到 1080p，并包含音轨。图像为 jpeg、png、webp、bmp、tiff、gif、heic 或 heif，每边 300 到 6000 px，宽高比 0.4 到 2.5，小于 10 MB。

**dubbing\_config** `object`

视频翻译的设置（角色 dubbing\_video）。

**dubbing\_config.custom\_subtitle** `object`

用于配音的 UTF-8 目标语言 SRT 文件，使用后将跳过机器翻译。每段最长 15 秒。不能与术语表一起使用。

**dubbing\_config.custom\_subtitle.format** `string` *required*

srt

**dubbing\_config.custom\_subtitle.url** `string` *required*

**dubbing\_config.dialogue\_enhancement** `string`

off（默认）、low、medium 或 high。

**dubbing\_config.glossaries** `object[]`

固定译法。不能与 custom\_subtitle 一起使用。

**dubbing\_config.glossaries\[].source** `string` *required*

**dubbing\_config.glossaries\[].target** `string` *required*

**dubbing\_config.source\_language** `string`

zh 或 en。省略后将自动检测语言。

**dubbing\_config.target\_language** `string`

视频翻译时必填。可为 zh、en、ja、ko、de、fr、pt-BR、th、id、vi、ms、fil、it、ru、nl、pl、tr、sv、es-ES、es-MX、ar、pt-PT、fi、da、no、cs、hu、el、ro 或 hi 之一。

**include** `string[]`

额外的视频翻译输出：video\_url、subtitles.srt、subtitles.jsonl、subtitles\_source.srt 和 subtitles\_source.jsonl。

**model** `string`

模型标识符。支持的模型：seed-audio-1-5-261128。直接调用 POST /proxy/byteplus/api/v3/contents/generations 时必须提供。Comfy Router 会从 `{model}` 路径段中填充它。

**output\_format** `string`

输出音频格式：wav（默认）、mp3、pcm 或 ogg\_opus。

根据 Router 在 `GET /v2/models/byteplus/seed-audio-1-5-261128/openapi.json` 提供的 schema 生成，该文档也是请求到达提供商之前用于验证调用的同一份文档。

### 输出

**audio\_config** `object`

**audio\_config.sample\_rate** `integer`

**content** `object`

**content.audios** `object[]`

**content.audios\[].description** `string`

**content.audios\[].type** `string`

对于分轨，表示音轨类型（speaker、sfx 或 bgm）。

**content.audios\[].url** `string`

下载 URL，有效期为 24 小时。

**content.subtitles** `object[]`

**content.subtitles\[].format** `string`

**content.subtitles\[].url** `string`

**content.video\_url** `string`

配音后的视频，当请求中包含 video\_url 时返回。

**created** `integer`

格式：`int64`

**dubbing\_config** `object`

**id** `string`

**model** `string`

**output\_format** `string`

**subtitle** `boolean`

**usage** `object`

**usage.duration\_ms** `integer`

BytePlus 的用量时间，单位为毫秒。在文本转音频时，它可能长于返回的音频。Comfy 不对此计费。

格式：`int64`

**usage.final\_duration\_ms** `integer`

返回音频的长度，单位为毫秒；对于分轨，为输入长度乘以分轨数量。Comfy 按此值计费。

格式：`int64`

## Examples

### 输入

```json theme={null}
{
  "content": [
    {
      "text": "Read with a calm English voice: 'Hello from Comfy Router.'",
      "type": "text"
    }
  ],
  "output_format": "mp3"
}
```

### 输出

```json theme={null}
{
  "content": {
    "audios": [
      {
        "url": "https://example.invalid/byteplus/seed-audio-1-5/generated.mp3"
      }
    ]
  },
  "created": 1795664082,
  "id": "0217956640827568823a6d9d4020aa2a",
  "model": "seed-audio-1-5-261128",
  "output_format": "mp3",
  "usage": {
    "duration_ms": 2000,
    "final_duration_ms": 1910
  }
}
```

## 发布前须知

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

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

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

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

> [card] [请求头](https://docs.comfy.org/zh/development/comfy-router/headers.md)
>
> 身份验证、幂等性、请求 ID、错误分类、重试节奏、消费限额。

> [card] [使用 Router API](https://docs.comfy.org/zh/development/comfy-router/api.md)
>
> 模型发现、验证错误、重试与计费。

> [card] [限制](https://docs.comfy.org/zh/development/comfy-router/limitations.md)
>
> Router 目前不支持的功能，以及替代方案。


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