ComfyPilotComfyPilot
文档 / 开发 / 使用 Dreamina Seedance 2.5 260628 与 Comfy Router

使用 Dreamina Seedance 2.5 260628 与 Comfy Router

通过 Comfy Router 调用 byteplus/dreamina-seedance-2-5-260628:端点、请求形状以及 Router 返回的响应。

开发 code 更新于 2026-11-03

查看官方原文

使用 Dreamina Seedance 2.5 260628 与 Comfy Router

通过 Comfy Router 调用 byteplus/dreamina-seedance-2-5-260628:端点、请求形状以及 Router 返回的响应。

byteplus/dreamina-seedance-2-5-260628 的 API 参考文档,由 Comfy Router 从 BytePlus 提供。

输入: 文本, 图像, 视频, 音频 · 输出: 视频 + 音频

快速开始

在 你的 Comfy 工作区 中创建密钥,并将其导出为 COMFY_API_KEY。Python 和 TypeScript 代码片段使用 Comfy SDK(pip install comfy-sdk 和 npm install @comfyorg/sdk);cURL 代码片段则是通过原始 HTTP 发出的同一调用。

模型 ID: byteplus/dreamina-seedance-2-5-260628

端点: POST https://api.comfy.org/v2/models/byteplus/dreamina-seedance-2-5-260628

[tab] 等待结果 ``python Python theme={null} from comfy_sdk import Comfy # 从环境中读取 COMFY_API_KEY。 # SDK 会自动创建幂等键,并在自动重试时复用它。 with Comfy() as client: result = client.models.run( "byteplus/dreamina-seedance-2-5-260628", { "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/dreamina-seedance-2-5-260628", { 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/dreamina-seedance-2-5-260628 \ -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\"}" ``
[tab] 排队并稍后收集 将相同的请求体发送到 POST https://api.comfy.org/v2/models/byteplus/dreamina-seedance-2-5-260628/requests。运行一经受理,Router 便会返回 201 和 request_id;结果就绪后,可从本进程或其他进程收集。队列投递 介绍了状态、取消与收集的完整流程。 ``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/dreamina-seedance-2-5-260628", { "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/dreamina-seedance-2-5-260628", { 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/dreamina-seedance-2-5-260628/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/dreamina-seedance-2-5-260628/requests/$REQUEST_ID/status \ -H "X-API-Key: $COMFY_API_KEY" # 3. 收集。返回 200 时附带模型的原生输出,仍在运行时返回 202 及状态响应体。 curl https://api.comfy.org/v2/models/byteplus/dreamina-seedance-2-5-260628/requests/$REQUEST_ID \ -H "X-API-Key: $COMFY_API_KEY" ``

服务提供商

除非请求中指定了其他提供商,否则该模型由 Comfy Router 直接提供服务。以下提供商同样可以服务该模型,它们使用同一端点和相同的模型 ID,通过 model_provider 查询参数进行选择。

  • Comfy(默认):POST https://api.comfy.org/v2/models/byteplus/dreamina-seedance-2-5-260628
  • fal,模型 ID 为 fal/fal-seedance-2.5:POST https://api.comfy.org/v2/models/byteplus/dreamina-seedance-2-5-260628?model_provider=fal
  • Higgsfield,模型 ID 为 higgsfield/higgsfield-seedance-2.5:POST https://api.comfy.org/v2/models/byteplus/dreamina-seedance-2-5-260628?model_provider=higgsfield
  • Runware,模型 ID 为 runware/runware-seedance-2.5:POST https://api.comfy.org/v2/models/byteplus/dreamina-seedance-2-5-260628?model_provider=runware
  • WaveSpeed,模型 ID 为 wavespeed/wavespeed-seedance-2.5:POST https://api.comfy.org/v2/models/byteplus/dreamina-seedance-2-5-260628?model_provider=wavespeed

strict_mode 默认为 false,因此 Router 会将本页记录的原始请求体转换为提供商自己的 schema,并将响应转换回来。请参阅 API 参考中的 model_provider、strict_mode 和 fallback_provider,以及服务提供商,了解所有以此方式路由的模型。

Schema

输入

callback\_url string (uri)

已忽略。为兼容 BytePlus 的请求形状而接受,但在提交任务之前就会被移除,因此永远不会发送回调;请改为轮询任务状态路由来获取结果。

格式:uri

content object[] required

供模型生成视频的输入内容

content\[].audio\_url object

输入音频对象。仅 Seedance 2.5、2.0、2.0 fast 与 2.0 mini 支持音频输入。Seedance 2.0、2.0 fast 与 2.0 mini 不能仅使用音频,必须包含至少 1 个图像或视频;Seedance 2.5 支持仅音频输入。

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

音频 URL、Base64 编码或资产 ID。 音频 URL:音频的公开 URL(wav、mp3)。 Base64:格式为 data:audio/\<format>;base64,\<content> 资产 ID:格式为 asset://\<ASSET\_ID>

content\[].draft\_task object

仅 Seedance 2.5。要渲染为最终视频的 Draft 任务。它必须是唯一的内容项。 最终视频会复用 Draft 任务的提示词、输入资产、时长、比例、种子、generate\_audio 和 omni\_reference\_task\_type;请勿再次发送这些内容。分辨率默认为且仅支持 1080p。

content\[].draft\_task.id string required

使用 draft 设为 true 创建 Draft 视频时返回的任务 ID。

content\[].image\_url object

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

用于图生视频生成的图像内容(当 type 为 "image\_url" 时) 图片网址:请确保图片网址可访问。 Base64 编码内容:格式必须为 data:image/\<format>;base64,\<content> 资产 ID:格式为 asset://\<ASSET\_ID>

content\[].role string

内容项的角色/位置。 对于图像:first\_frame、last\_frame 或 reference\_image。 对于视频:reference\_video(仅 Seedance 2.5、2.0、2.0 fast 与 2.0 mini)。 对于音频:reference\_audio(仅 Seedance 2.5、2.0、2.0 fast 与 2.0 mini)。

可能的值:first_frame、last_frame、reference_image、reference_video、reference_audio

content\[].text 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 是数组,整个文档由每请求的请求体上限来限定。 执行该限制的是 Comfy Router(/v2/models/byteplus/\{model}); 若直接调用 v1 /proxy,则由 BytePlus 自己的校验器给出答复。 该值设置得远高于真实流量,因此它永远不会裁决真实的提示词;如果调用方需要更多,可以提高该值。

content\[].type string required

输入内容的类型

可能的值:text、image_url、video_url、audio_url、draft_task

content\[].video\_url object

输入视频对象。仅 Seedance 2.5、2.0、2.0 fast 与 2.0 mini 支持视频输入。

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

视频 URL 或资产 ID。 视频 URL:视频的公开 URL(mp4、mov)。 资产 ID:格式为 asset://\<ASSET\_ID>

draft boolean (default: false)

仅 Seedance 2.5。生成 480p 的 Draft 视频;分辨率必须为 480p。 在 draft_task 内容项中传入返回的任务 ID,以渲染最终的 1080p 视频。Draft 任务 ID 有效期为 7 天。

duration integer

视频时长,单位为秒。Seedance 2.5:\[4,30] 或 -1(自动)。

可能的值:-1, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30

execution\_expires\_after integer

任务超时阈值,单位为秒。默认 172800(48 小时)。范围:\[3600, 259200]。

范围:3600 到 259200

generate\_audio boolean (default: true)

由 Seedance 2.5、2.0、2.0 fast、2.0 mini 和 1.5 pro 支持。生成的视频是否包含与画面同步的音频。 true:模型输出带有同步音频的视频。 false:模型输出无声视频。在支持此功能的模型上,生成的音轨会由提供商与视频分开进行内容检查;若此处被拒绝,会报告为 content_policy_violation,并且由于每次运行的音频不同,对于提供商原本会接受的输入,这种拒绝可能间歇性出现。若发生这种情况,请发送 false 以生成无声视频;仅当被拒绝的模态是音频时,这样做才有帮助,同步的 Router 响应会将其标识为 refusal_subject: output_audio(排队中的请求尚不会标识这一点)。Seedance 2.5 的最终渲染会继承其 Draft 任务的 generate_audio,因此请改用 false 重新创建 Draft。

model 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。直接对 POST /proxy/byteplus/api/v3/contents/generations/tasks 发起 v1 调用时必须提供它:代理会拒绝任何其他值以及省略该值的情况,并返回 400。它不在本 schema 的 required 列表中,因为 Comfy Router 会从 /v2/models/byteplus/\{model} 的 {model} 路径段填充它,因此 Router 调用方会省略它。

output\_format string (default: "mp4")

仅限 Seedance 2.5。输出视频的容器格式。 mp4: 通用容器(H.264/AAC,yuv420p),兼容性广,文件大小更小。 mov: 专业容器(H.264 High 4:4:4 Predictive/PCM,yuv444p),颜色精度高,适合后期制作;文件大小更大。

可能的值:mp4, mov

ratio string

已生成视频的宽高比。Seedance 2.0、2.0 fast、2.0 mini 和 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

resolution string

视频分辨率。Seedance 2.5、2.0、2.0 fast、2.0 mini、1.5 pro 和 1.0 lite 的默认值:720p。Seedance 1.0 pro 和 pro-fast 的默认值:1080p。 注意:Seedance 2.0、2.0 fast 和 2.0 mini 不支持 1080p。Seedance 2.5 支持 480p、720p 和 1080p。

可能的值:480p, 720p, 1080p, 4k

return\_last\_frame boolean (default: false)

是否返回已生成视频的最后一帧图像。 true: 返回已生成视频的最后一帧图像。将此参数设为 true 后,可以通过调用“查询视频生成任务信息”来获取最后一帧图像。该最后一帧图像为 PNG 格式,其像素宽度和高度与已生成视频一致,并且不含水印。使用此参数可以生成多个连续视频:将先前生成的视频的最后一帧用作下一个视频任务的首帧,从而快速生成多个连续视频。 false: 不返回已生成视频的最后一帧图像。

seed integer

用于控制随机性的种子整数。范围:\[-1, 2^32-1]。-1 表示使用随机种子。

范围:-1 到 4294967295

service\_tier string

用于处理的服务层级。Seedance 2.5、2.0 和 2.0 fast 不支持 flex(离线推理)。

可能的值:default, flex

watermark boolean (default: false)

已生成视频是否包含水印。

根据 Router 在 GET /v2/models/byteplus/dreamina-seedance-2-5-260628/openapi.json 提供的 schema 生成,该 schema 也是它在请求到达提供商之前用于校验调用的同一文档。

输出

content object

视频生成任务已完成后的输出,包含输出视频的下载 URL,以及 BytePlus 返回时其最后一帧的下载 URL。video_url 和 last_frame_url 都会被重新托管到 Comfy 存储;这里的其他字段均由 BytePlus 提供。可为空:BytePlus 会在任务完成 24 小时后清除这些 URL,因此在此之后轮询已成功的文档时,content 可能缺失或为 null。

content.last\_frame\_url 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。

content.output\_format string

当 BytePlus 将其嵌套在 content 内时,表示已生成视频的容器格式(mp4 或 mov)。Seedance 模型更常将其作为 content 的顶层同级字段返回;请参阅顶层的 output_format 字段。Router 会读取两者中存在的那个。

content.upstream\_expires\_at string (date-time)

RFC 3339 时间,表示上游 URL 停止工作的时间:最早的签名时间加上这些 URL 自身携带的有效期;当 updated_at 存在时,绝不晚于任务的 updated_at 加 24 小时(BytePlus 文档所述的 URL 生存期);否则为任务的 updated_at 加 24 小时。仅当存在 upstream_video_url 或 upstream_last_frame_url 时才提供,当两个来源都未给出时间时省略。与重新托管的 video_url / last_frame_url 的生命周期无关。

格式:date-time

content.upstream\_last\_frame\_url string

BytePlus 自己的最后一帧下载 URL,与重新托管的 last_frame_url 并列逐字节返回,适用条件与 upstream_video_url 相同:仅限已选择加入的工作区,仅限 Seedance 2.x,BytePlus 清除后即不存在,并且在 upstream_expires_at 之前是一种 bearer 凭证。

content.upstream\_video\_url string

BytePlus 自己的输出视频下载 URL,与重新托管的 video_url 并列逐字节返回。仅当 Seedance 2.x 任务由 Comfy 已在服务器端选择加入的工作区轮询时才提供(没有请求参数);其他所有情况下均不存在,包括解析不到任何工作区的凭证(例如未限定到某个工作区的传统 API 密钥),并且在 BytePlus 于生成 24 小时后清除其 URL 后缺失。它是预签名的对象存储 URL,因此是一种 bearer 凭证:任何持有它的人都可以在它过期前下载视频,所以请像对待机密一样对待它。它会在 upstream_expires_at 过期,在 Seedance 2.5 上 BytePlus 将其限制为最多 100 次下载,其中一次会被 Router 自己的重新托管消耗。

content.video\_url string

输出视频的下载 URL。Router 会将视频重新托管到 Comfy 存储并重写此字段,因此它通常是由 Comfy 签名的 URL,有效期最长 24 小时。签发时按 24 小时签名,并从 23 小时缓存中重放,因此之后的轮询可能返回仅剩一小时有效期的 URL。当无法执行重新托管时,该字段会改为保留 BytePlus 自己的 URL;BytePlus 会在任务完成 24 小时后清除该 URL,并在某些模型上将下载次数限制为 100 次。无论哪种方式,链接都会过期,因此请下载视频,而不是存储 URL。

created\_at integer

任务创建的时间。该值为 UNIX 时间戳,单位为秒。

duration number

已生成视频的时长,单位为秒。声明为数字而非整数,因为 BytePlus 对此并不一致:已观察到视频任务返回整秒,而其他 BytePlus 接口会报告小数时长,因此客户端不得假定该值为整数。这是 BytePlus 自己的字段,在已成功的视频任务上返回并原样转发。

error object

错误信息。如果任务成功,则返回 null。如果任务失败,则返回错误信息。

error.code string

上游 ModelArk 错误码。SensitiveContentDetected、InputTextSensitiveContentDetected、InputImageSensitiveContentDetected、InputVideoSensitiveContentDetected、InputAudioSensitiveContentDetected、OutputTextSensitiveContentDetected、OutputImageSensitiveContentDetected、OutputVideoSensitiveContentDetected 和 OutputAudioSensitiveContentDetected 表示内容策略拒绝。一个系列可能带有以点号分隔的原因,例如 InputImageSensitiveContentDetected.PrivacyInformation、OutputVideoSensitiveContentDetected.PolicyViolation 或 OutputImageSensitiveContentDetected.DeepFake。这是一个开放字符串,而不是枚举:其他错误码描述验证和提供商失败。Router 会在 HTTP 400 错误响应封装和 HTTP 200 失败任务响应中识别策略系列,而不会覆盖传输失败。

error.message string

报错信息

id string

视频生成任务的 ID

model string

任务所使用的模型名称与版本

output\_format string

已生成视频的容器格式(mp4 或 mov),在顶层作为 content 的同级字段返回。Seedance 视频任务查询正是在此位置返回该字段。该字段为 BytePlus 自有字段,原样透传。

resolution string

已生成视频的分辨率,例如 1080p。该字段为 BytePlus 自有字段,在成功的视频任务中返回,并原样透传。

seed integer

该任务实际使用的生成种子。该字段为 BytePlus 自有字段,在成功的视频任务中返回,并原样透传。

格式:int64

status string

任务的状态

可能的值:queued、running、cancelled、succeeded、failed、expired

updated\_at integer

任务最后更新的时间。该值为 UNIX 时间戳,单位为秒。

usage object

本次请求的 token 用量

usage.completion\_tokens integer

模型生成的 token 数量

usage.total\_tokens integer

对于视频生成模型,不计算输入 token 数量,其默认值为 0。因此,total\_tokens = completion\_tokens。

示例

输入

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

输出

{
  "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": "dreamina-seedance-2-5-260628",
  "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 会过期。

上文任何字段描述中提到的尺寸限制,都是提供商对该字段自身的限定,引自提供商的规范。Router 会对整个请求体另行设置上限,base64 编码的媒体内容也计入其中:参见请求体大小。

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

[card] 请求头 身份验证、幂等性、请求 ID、错误分类、重试节奏、消费限额。
[card] 使用 Router API 模型发现、验证错误、重试与计费。
[card] 限制 Router 目前不支持的功能,以及替代方案。