@q253595422/dsh-imagegen-video 1.14.0 → 1.15.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -5,6 +5,79 @@ Attribution for third-party code is in [NOTICE](./NOTICE).
5
5
 
6
6
  ## Releases
7
7
 
8
+ ### 1.15.1 — 火山适配的收口修复
9
+
10
+ - **Ark pixel sizes stay inside the budget.** At 4K / 16:9 the solved
11
+ `2866x1612` rounds up to 16,779,264 pixels, 2048 over the 4096² ceiling, and
12
+ the provider rejects it. The height is now scanned near the target for an
13
+ even pair that is both legal and nearest the requested ratio, with a scale
14
+ fallback when none exists. lite and 4.5 also get their own tier floor
15
+ (`2560x1440`, not 5.0 pro's `1280x720`), so 1K stops being refused there.
16
+ - **Capabilities are read from the upstream id, not the alias.** A channel can
17
+ map `seedance-hd` to `doubao-seedance-2-0-fast-260128`, and the 720p ceiling
18
+ belongs to the latter. Both the engine and the panel described the alias, so
19
+ the panel offered 1080P and the submit got a 400. `resolveVideoModelId`
20
+ resolves the id first; the resolution fallback also stops collapsing 1080P to
21
+ 480P (it now picks the highest tier at or below the request).
22
+ - **The `ep-…` claim was wrong** and is corrected in the README, the preset
23
+ hint and the release notes: the family comes from the model id prefix, so an
24
+ inference endpoint is refused before submit instead of being sent a
25
+ malformed body.
26
+ - **A `renderer: code` submit no longer demands a channel.** Code rendering
27
+ needs no image/video channel, but both submit routes validated one and
28
+ refused the request before rendering started.
29
+ - **Code detection no longer uses a method whitelist.** A model writing
30
+ `ctx.fillRect(...)` — a method this renderer does not have — had the whole
31
+ answer filed as prose and silently replaced with the fallback title card,
32
+ hiding the actual problem. Any `ctx.<method>(` now counts as code and the
33
+ executor reports `code-runtime` with the method name; a prose answer also
34
+ quotes what the model said, so a refusal is distinguishable from a wrong API.
35
+
36
+ ### 1.15.0 — Volcengine Ark, properly
37
+
38
+ - **Seedream gets the real Ark contract.** The official ids
39
+ (`doubao-seedream-5-0-pro-260628` and friends) have no `aspect_ratio`
40
+ parameter at all, and their `size` is EITHER a tier (`1K`/`1.5K`/`2K`/`3K`/
41
+ `4K`) OR an explicit `WxH` — never both. Sending a bare tier therefore
42
+ threw the panel's ratio away and a 16:9 request came back square or 1:1.
43
+ Ark ids now receive explicit even dimensions solved from the chosen ratio
44
+ inside that model's documented pixel budget (5.0 pro/flash cap at
45
+ `2048x2048x1.1025`; 4.5 and 5.0 lite at `4096x4096`; 3.0 at `2048x2048`).
46
+ `auto` still sends the tier string, which is Ark's "you choose" form.
47
+ - **The watermark is turned off explicitly.** Ark documents `watermark: true`
48
+ as the default, so every Ark request used to come back with a visible
49
+ "AI生成" stamp in the corner. Both the text-to-image and the edit request
50
+ now send `watermark: false`. Gateway-shaped Seedream still sends
51
+ `b64_json`; only the official Ark shape uses `response_format: 'url'`.
52
+ - **Seedance is a first-class video family.** `doubao-seedance-*` ids were
53
+ being classified as the generic OpenAI-style video endpoint, which posted
54
+ to `/videos` and never worked. They now speak Ark's own task contract:
55
+ `POST /contents/generations/tasks`, poll
56
+ `GET /contents/generations/tasks/{id}`, clip at `content.video_url`.
57
+ The prompt and every reference ride in a `content` array — images carry a
58
+ `role` of `first_frame` / `last_frame` / `reference_image` — the ratio field
59
+ is `ratio`, resolution is lowercase, and duration is an integer.
60
+ - **Values are narrowed where the model would reject them.** Seedance 2.x
61
+ accepts 4–15 seconds and 1.0 accepts 2–12; the `fast`/`mini` ids cap at
62
+ 720p and reject 1080p and 4k upstream, and 1.0 does not accept the
63
+ `reference_image` role (`1.0 pro fast` also has no last frame). Requests are
64
+ clamped to the window, degraded to the best tier the id does support (a
65
+ 1080P ask on a fast id becomes 720p, not 480p), and modes the id cannot
66
+ express are dropped from the panel instead of being sent as a 400.
67
+ - **Silent by default, not by accident.** Seedream's `watermark` defaults to
68
+ `true` (a visible "AI生成" stamp), so it is sent as `false`. On the video
69
+ side `watermark` already defaults to `false` but is still sent explicitly,
70
+ while `generate_audio` — which exists on 2.x and defaults to `true` — is
71
+ sent as `false`; 1.0 ids do not receive the field at all, since they have no
72
+ audio track to switch off.
73
+ - **One channel, both halves.** The built-in preset is now "字节 · 火山方舟
74
+ (Seedream / Seedance)" with real model ids and a video catalog, so one
75
+ Ark channel serves images and videos.
76
+ - **Offline coverage.** `B7` asserts the Ark pixel size stays inside the
77
+ budget, keeps the ratio and is even, plus `watermark: false`; two new
78
+ `smoke-video` cases cover the Seedance submit body, the poll path and
79
+ `content.video_url`, and the duration/resolution narrowing.
80
+
8
81
  ### 1.14.0 — draw it in code, render it here
9
82
 
10
83
  - **A second renderer, chosen per task.** The canvas composer now carries a
package/README.md CHANGED
@@ -185,13 +185,23 @@ dsh plugin --profile web add ./q253595422-dsh-imagegen-video-1.7.8.tgz
185
185
  | 协议族 | 模型示例 | 说明 |
186
186
  | --- | --- | --- |
187
187
  | Agnes 视频 | `agnes-video-2.5-flash`、`agnes-video-2.5` | 提交 `POST /v1/videos`,轮询 `GET /v1/videos/{id}`,取 `metadata.url`;支持文生视频、首尾帧、多参考图、`seed`。 |
188
+ | 火山 Seedance(方舟) | `doubao-seedance-2-0-260128`、`doubao-seedance-2-0-fast-260128`、`doubao-seedance-1-0-pro-250528` | 方舟原生任务协议:提交 `POST /contents/generations/tasks`,轮询 `GET /contents/generations/tasks/{id}`,成片在 `content.video_url`。提示词与参考图放在 `content` 数组里(参考图带 `role`:`first_frame` / `last_frame` / `reference_image`),比例字段是 `ratio`,分辨率小写。时长:2.x 为 4–15 秒、1.0 为 2–12 秒。分辨率:2.0 支持 480p/720p/1080p/4k,`fast` / `mini` 只到 720p;1.0 为 480p/720p/1080p。1.0 不支持 `reference_image` 角色,`1.0 pro fast` 也不支持尾帧,面板会把这两种模式从该型号上收起来。 |
188
189
  | 算力萌 comemoe | `wan2.2-t2v`、`zhimeng-h3-local` | `wan2.2-t2v` 仅文生视频;`zhimeng-h3-local` 支持图生视频。比例只接受 16:9 / 9:16 / 1:1;5 秒片子实测约 9 分钟。 |
190
+ | xAI Grok | `grok-imagine-video-1.5`、`grok-imagine-video-1.5-lite` | 提交 `POST /videos/generations`(注意不是 `/videos`),轮询 `GET /videos/{id}`,取 `video.url` 与 `video.duration`。 |
189
191
  | 通用视频 | 其他视频模型 id | 按 OpenAI 兼容视频端点尽力适配;未识别的协议族会明确报错,不会静默发出错误请求。 |
190
192
 
191
193
  - **生成模式**:文生视频、图生视频(单张参考图)、首尾帧(首帧+尾帧插值)、参考图(多张风格/主体参考);不同模型支持的模式不同,面板只会给出该模型支持的选项。
192
194
  - **成片存储**:视频保存在本机数据目录的 `videos/` 下,历史列表只存元数据,播放走支持 Range 的同源路由,所以可以拖动进度条。
193
195
  - **Agent 调用**:Agent 可调用 `generate_video`(文生视频)与 `generate_video_from_image`(图生视频/首尾帧/参考图),并用 `get_video_generation_task` 查询进度;视频渲染较慢,不要紧凑轮询。
194
196
 
197
+ **火山方舟(Seedream / Seedance)** 的生图与生视频可以共用一个渠道(`https://ark.cn-beijing.volces.com/api/v3`),渠道里分别填图片模型与视频模型即可:
198
+
199
+ - **生图(Seedream)**:方舟的 `size` 只能是档位(`1K`/`1.5K`/`2K`/`3K`/`4K`)**或** `宽x高`,二选一,且没有 `aspect_ratio` 参数。所以选了具体比例时,插件按该模型的像素预算换算出显式的偶数宽高(例如 5.0 pro 在 16:9 / 4K 下是 `2784x1566`),这样比例才真的生效;`auto` 才回落到档位字符串。
200
+ - **水印**:生图的 `watermark` 默认是 **true**(右下角「AI生成」),插件每次都显式发 `watermark: false`。生视频的默认值是 `false`,插件同样显式发送,不依赖上游默认值。
201
+ - **音轨**:生视频的 `generate_audio` 默认是 **true**(2.5 / 2.0 才有这个字段);面板没有音轨控制,插件显式发 `false`,1.0 系列则完全不带这个字段。
202
+ - **响应格式**:方舟的 Seedream 用 `response_format: 'url'`,插件随后回源下载;网关版的 Seedream 仍走 `b64_json`。
203
+ - **模型 ID**:请填方舟控制台的模型 ID(`doubao-seedream-*` / `doubao-seedance-*`)——协议族是从这个 id 前缀判断的。方舟的**推理接入点**(`ep-…`)目前无法判断协议族:图片会被当成通用渠道、生视频会在提交前直接报「协议族未知」而不是静默发一个形状错误的请求。要在接入点上用,请把该渠道的模型 ID 填成对应的方舟模型 ID。
204
+
195
205
  </details>
196
206
 
197
207
  #### 代码生成路径(不调生图/生视频模型)
@@ -0,0 +1,78 @@
1
+ # v1.15.0 — 火山方舟:Seedream 生图与 Seedance 生视频按真实协议适配
2
+
3
+ 一句话概括:火山方舟(Volcengine Ark)的 Seedream 生图与 Seedance 生视频不再是「名字看着像就按通用协议发」,而是各按方舟自己的契约整形请求。一个 Ark 渠道同时服务生图与生视频。
4
+
5
+ ## 为什么
6
+
7
+ 之前这两个模型族走的是兜底形状,在真上游上会以不同方式失真:
8
+
9
+ - **Seedream**:方舟没有 `aspect_ratio` 参数,`size` 只能填档位(`1K`/`1.5K`/`2K`/`3K`/`4K`)或显式 `宽x高`,二者不可混用。原先发的是档位字符串,于是你在面板里选的比例被直接丢掉——选 16:9 出来的仍是接近正方形的图。另外 `watermark` 在方舟**默认 true**,每张图右下角都带「AI生成」。
10
+ - **Seedance**:`doubao-seedance-*` 之前被归到通用视频端点,提交到 `/videos`,而方舟的接口在 `/contents/generations/tasks`,请求体形状也完全不同(`content` 数组 + `role`),所以这条路径在真上游上根本走不通。
11
+
12
+ ## 做了什么
13
+
14
+ ### 生图(Seedream / Ark)
15
+
16
+ - 选了具体比例时,按该模型的**文档像素预算**换算出显式的偶数宽高:
17
+
18
+ | 模型族 | 总像素区间 |
19
+ | --- | --- |
20
+ | 5.0 pro / flash | `1280x720` ~ `2048x2048x1.1025` |
21
+ | 5.0 lite、4.5 | `2560x1440` ~ `4096x4096` |
22
+ | 4.0 | `1280x720` ~ `4096x4096` |
23
+ | 3.0 t2i | `512x512` ~ `2048x2048`(只接受像素值) |
24
+
25
+ 例:5.0 pro、比例 16:9、清晰度 4K → `2784x1566`(比例严格 16:9,总像素 4,359,744,在预算内)。换算时先按目标总像素解出宽高并取偶,然后校验取偶后的乘积**没有越过上限**(4K 16:9 四舍五入会变成 16,779,264 > 4096²,上游会直接拒绝),所以会在附近挑一个仍然合法的偶数尺寸。
26
+ - `auto` 保留档位字符串,这是方舟「让模型自己决定」的合法写法。
27
+ - 每次显式发送 `watermark: false`(文生图与图生图都一样)。
28
+ - 响应格式:方舟用 `response_format: 'url'` 并回源下载;网关形态的 Seedream 仍用 `b64_json`。
29
+
30
+ ### 生视频(Seedance / Ark)
31
+
32
+ - 新增 `seedance` 协议族:提交 `POST /contents/generations/tasks`,轮询 `GET /contents/generations/tasks/{id}`。
33
+ - 请求体:
34
+
35
+ ```json
36
+ {
37
+ "model": "doubao-seedance-2-0-260128",
38
+ "content": [
39
+ { "type": "text", "text": "…" },
40
+ { "type": "image_url", "image_url": { "url": "data:image/png;base64,…" }, "role": "first_frame" }
41
+ ],
42
+ "ratio": "9:16",
43
+ "resolution": "1080p",
44
+ "duration": 5,
45
+ "watermark": false,
46
+ "generate_audio": false
47
+ }
48
+ ```
49
+
50
+ - 首尾帧模式发 `first_frame` / `last_frame`;参考图模式逐张发 `reference_image`(2.x 支持);图生视频发单张 `first_frame`。
51
+ - 比例字段是 `ratio`;分辨率小写;时长是整数秒。
52
+ - 轮询结果从 `content.video_url` 取成片,`content.last_frame_url` 作为封面回落,`duration` 作为真实时长。
53
+ - **收敛而不是硬发**:2.x 时长窗口 4–15 秒,1.0 为 2–12 秒;`fast` / `mini` 上游最高 720p;1.0 不支持 `reference_image` 角色,`1.0 pro fast` 也没有尾帧,所以这些模式会从对应型号上收起来。越界的请求会被收进窗口,并把分辨率降到该型号真正支持的最高档(1080P 在 fast 型号上降为 720p,而不是掉到 480p)。
54
+ - `watermark` 生图默认 true、生视频默认 false,插件一律显式发送 `false`;`generate_audio`(2.x 才有,默认 true)显式发 `false`,1.0 系列不带这个字段。
55
+
56
+ ### 渠道预设
57
+
58
+ `volc-ark-seedream` 改名为「字节 · 火山方舟(Seedream / Seedance)」,图片模型换成方舟控制台的真实 ID,并新增视频模型目录:
59
+
60
+ - `doubao-seedream-5-0-pro-260628` / `-5-0-260128` / `-4-5-251128` / `-4-0-250828`(保留旧的 `seedream-5.0-pro` / `seedream-4.0` 别名兼容)
61
+ - `doubao-seedance-2-0-260128` / `doubao-seedance-2-0-fast-260128` / `doubao-seedance-1-0-pro-250528`
62
+
63
+ 模型 ID 请填方舟控制台的 `doubao-seedream-*` / `doubao-seedance-*`:协议族按这个 id 前缀判断,推理接入点(`ep-…`)识别不出协议族,生视频会在提交前明确报「协议族未知」而不是静默发出一个形状错误的请求。
64
+
65
+ ## 验证
66
+
67
+ - `pnpm run typecheck`、`pnpm run build`、`pnpm test` 全绿(含 UI 契约检查)。
68
+ - `scripts/smoke.mjs` 的 `B7`:断言 Ark 的 `size` 是 `宽x高`、比例保持在 16:9、宽高为偶数、总像素落在 5.0 pro 的预算内,且 `watermark === false`、`response_format === 'url'`、不出现 `resolution` 字段。
69
+ - `scripts/smoke-video.mjs` 新增两项:
70
+ - `V1c2`:Seedance 提交体是 `content[{text}] + content[{image_url, role:'first_frame'|'last_frame'}]`,带 `ratio`、小写 `resolution`、整数 `duration`、`watermark:false`、`generate_audio:false`;轮询打到 `/v1/contents/generations/tasks/{id}` 并由 `content.video_url` 取到成片。
71
+ - `V1c3`:fast 型号请求 `1080P` / 30 秒 → `720p` / 15 秒;1.0 pro 请求 1 秒 → 2 秒、`1080p` 保留。
72
+
73
+ ## 依赖与边界
74
+
75
+ - 新增依赖:**无**。
76
+ - 仍只支持方舟文档化的字段;未文档化的参数(如 1.0 上的多图参考)不发送,面板也会把不支持的选项收起来。
77
+ - 时长仍由面板的 5 / 10 秒两档控制(两者都落在所有 Seedance 型号的窗口内);通过 Agent 调用可以传入别的秒数,会被收进对应型号的区间。
78
+ - 收敛后的值会写进请求,但**不会改写你在面板里选的原值**:同一次生成之外,选择保持原样。
@@ -0,0 +1,39 @@
1
+ # v1.15.1 — 火山适配的收口修复
2
+
3
+ 一句话概括:v1.15.0 把 Seedream / Seedance 接上了方舟的真实契约,这一版修的是「接上之后仍然会在真上游上出问题」的几处细节——像素尺寸越界、能力按渠道别名而非上游 ID 判断、文档里对推理接入点的错误说法,以及代码生成路径在缺渠道时被误拦。
4
+
5
+ ## 为什么
6
+
7
+ v1.15.0 发布后逐字段复核方舟文档,发现七处会真实影响结果的问题。它们不是风格问题,每一处都会让某类请求在真上游上失败或失真。
8
+
9
+ ## 修了什么
10
+
11
+ ### 生图(Seedream)
12
+
13
+ - **像素尺寸会越过上限。** 4K、16:9 时按目标总像素解出的 `2866x1612` 四舍五入后是 16,779,264 像素,比 4096² = 16,777,216 多了 2048,上游直接 400。现在改为在目标高度附近扫描偶数高度、挑出「合法且比例最接近」的一对;扫描不到时按 `sqrt(target / (w*h))` 缩放兜底。文档示例同步改成 `2784x1566`。
14
+ - **lite / 4.5 的档位下限不同。** 5.0 lite 与 4.5 的文档预算是 `2560x1440` 起,原先统一按 5.0 pro 的 `1280x720` 起算,1K 档会在这些型号上被拒。现在按型号分支。
15
+
16
+ ### 生视频(Seedance)
17
+
18
+ - **能力判定看的是渠道别名,不是上游 ID。** 渠道可以把 `seedance-hd` 映射到 `doubao-seedance-2-0-fast-260128`,而 720p 上限属于后者。原先引擎和面板都拿别名去判,于是面板会给出 1080P、提交后 400。新增 `resolveVideoModelId`,引擎与面板都先解析出上游 ID 再判能力(`src/video-model-catalog.ts`、`src/video-engine.ts`、`src/client/VideoPanel.tsx`)。
19
+ - **分辨率降档会掉到最低档。** `normalizeVideoResolution` 原先回落到档位表第一项,`1080P` 在 fast 型号上会变成 `480P`,等于白白丢掉大半画面。现在取「不超过请求的最高档」,只有低于下限时才向上取。
20
+ - **文档对推理接入点的说法不成立。** 之前写成 `ep-…` 也能用。实际上协议族按模型 ID 前缀判断,`ep-…` 识别不出来,生视频会在提交前明确报「协议族未知」。README、预设提示与发布说明已一起改正。
21
+
22
+ ### 代码生成路径
23
+
24
+ - **`renderer: code` 的提交不再要求渠道。** 代码渲染不需要任何生图/生视频渠道,但两个提交路由仍在校验渠道,缺渠道时会在真正开始渲染之前被拦下(`src/routes.ts`)。
25
+ - **代码识别不再用方法白名单。** 原先只有 `ctx.background/rect/roundRect/circle/line/text/gradient` 这几个调用算「代码」,模型如果写了 `ctx.fillRect(...)`(本渲染器没有这个方法),整段会被判成散文并静默换成内置标题卡——真正的问题(方法不存在)反而被藏起来。现在任何 `ctx.<方法>(` 都算代码,交给执行器报 `code-runtime`,错误里带着方法名。被判定为散文时也会引用模型原话的前 160 字,让用户能区分「模型拒绝了」和「模型写错了 API」。
26
+
27
+ ## 验证
28
+
29
+ - `pnpm run typecheck`、`pnpm run build`、`pnpm test` 全绿。
30
+ - `scripts/smoke-video.mjs`:`V1c4` 断言面板按上游 ID 描述能力;`V1c3` 覆盖时长/分辨率收敛;`V6b` 走「别名 `hd`、上游 fast」的完整运行时路径。
31
+ - `scripts/smoke.mjs`:`B7b` 覆盖编辑路径的水印与 1K→2K 档位收窄,以及 6 种比例在 4K 下的尺寸扫描。
32
+ - `scripts/smoke-code-render.mjs` 增至 16 项,新增两条**反向验证过**的用例:
33
+ - `C4b2`:裸函数体 `ctx.fillRect(...)` → `code-runtime` 且错误信息含 `fillRect`。把修复临时回退后该用例失败(旧代码把它当散文换成标题卡),恢复后通过。
34
+ - `C3b`:散文回答的降级原因里必须引用模型原话。旧代码的失败信息是「没有 render 函数,也没有任何绘制调用」,不含原文。
35
+
36
+ ## 依赖与边界
37
+
38
+ - 新增依赖:**无**。
39
+ - **火山真实端到端仍未在本机跑过**:开发机上没有火山方舟的 API key(凭据里只有 Agnes / Comemoe / TX 等),且 `ark.cn-beijing.volces.com` 不在安全门允许的地址列表里,直接请求会被拦下。当前验证止于「离线假上游 + 方舟官方文档逐字段对照」。若要本机真跑:设置 → 生图配置里加一个火山渠道,地址填 `https://ark.cn-beijing.volces.com/api/v3`,填 Ark key,模型用方舟控制台的 `doubao-seedream-*` / `doubao-seedance-*`。
package/lib/client.js CHANGED
@@ -60412,6 +60412,30 @@ probe: "/api/dsh-imagegen/code/probe" };
60412
60412
  supportsSeed: false,
60413
60413
  requiresReference: false
60414
60414
  },
60415
+ seedance: {
60416
+ label: "seedance",
60417
+ labelZh: "火山 Seedance",
60418
+ known: true,
60419
+ modes: [
60420
+ "text",
60421
+ "image",
60422
+ "keyframe"
60423
+ ],
60424
+ resolutions: [
60425
+ "480P",
60426
+ "720P",
60427
+ "1080P"
60428
+ ],
60429
+ aspectRatios: [
60430
+ "16:9",
60431
+ "9:16",
60432
+ "1:1",
60433
+ "4:3",
60434
+ "3:4"
60435
+ ],
60436
+ supportsSeed: true,
60437
+ requiresReference: false
60438
+ },
60415
60439
  xai: {
60416
60440
  label: "xAI Grok",
60417
60441
  labelZh: "xAI Grok",
@@ -60440,6 +60464,16 @@ probe: "/api/dsh-imagegen/code/probe" };
60440
60464
  const id = model.trim();
60441
60465
  return COMEMOE_VIDEO_MODELS.has(id) || /^comemoe[-_/]/i.test(id);
60442
60466
  }
60467
+ /**
60468
+ * Whether a model id is Volcengine Ark's Seedance video contract.
60469
+ *
60470
+ * Both the official ids (`doubao-seedance-2-0-260128`) and the shorter gateway
60471
+ * aliases (`seedance-2-0`) are accepted: the family is decided by the request
60472
+ * SHAPE, and both spellings mean the same `/contents/generations/tasks` body.
60473
+ */
60474
+ function isArkSeedanceVideoModel(model) {
60475
+ return /^(?:doubao-)?seedance(?:[-_.]|$)/i.test(model.trim());
60476
+ }
60443
60477
  /** Classify one upstream video model id into its request-shaping family. */
60444
60478
  function describeVideoModel(model) {
60445
60479
  const id = model.trim();
@@ -60452,6 +60486,23 @@ probe: "/api/dsh-imagegen/code/probe" };
60452
60486
  family: "xai",
60453
60487
  ...ENTRIES.xai
60454
60488
  };
60489
+ if (isArkSeedanceVideoModel(id)) {
60490
+ const base = ENTRIES.seedance;
60491
+ const seedance2 = /seedance[-_.]?2/i.test(id);
60492
+ const resolutions = /seedance[-_.]?2(?:[-_.]\d+)*[-_.](?:fast|mini)/i.test(id) ? ["480P", "720P"] : [...base.resolutions];
60493
+ const modes = /seedance[-_.]?1[-_.]?\d+[-_.]?pro[-_.]?fast/i.test(id) ? ["text", "image"] : [...base.modes];
60494
+ return seedance2 ? {
60495
+ family: "seedance",
60496
+ ...base,
60497
+ resolutions,
60498
+ modes: [...modes, "reference"]
60499
+ } : {
60500
+ family: "seedance",
60501
+ ...base,
60502
+ resolutions,
60503
+ modes
60504
+ };
60505
+ }
60455
60506
  if (isComemoeVideoModel(id)) {
60456
60507
  const base = ENTRIES.comemoe;
60457
60508
  return id === "wan2.2-t2v" || /t2v/i.test(id) ? {
@@ -60489,6 +60540,27 @@ probe: "/api/dsh-imagegen/code/probe" };
60489
60540
  }
60490
60541
  /** Default video model ids offered when a channel has no video catalog yet. */
60491
60542
  const DEFAULT_VIDEO_MODELS = ["agnes-video-2.5-flash", "agnes-video-2.5"];
60543
+ /**
60544
+ * The upstream id a channel alias actually resolves to.
60545
+ *
60546
+ * Capability checks (modes, resolutions, family) must describe the id the
60547
+ * provider RECEIVES, not the alias the user typed: a channel can map
60548
+ * `seedance-hd` → `doubao-seedance-2-0-fast-260128`, and only the latter is
60549
+ * capped at 720p. Describing the alias would offer a tier the id rejects.
60550
+ *
60551
+ * Falls back to the alias itself when no channel maps it (a request built
60552
+ * outside the panel, or a catalog edited after selection).
60553
+ */
60554
+ function resolveVideoModelId(alias, channels) {
60555
+ const wanted = alias.trim();
60556
+ if (wanted === "") return "";
60557
+ for (const channel of channels ?? []) for (const row of channel.videoModels ?? []) {
60558
+ if (row.alias !== wanted) continue;
60559
+ const upstream = (row.id ?? "").trim();
60560
+ return upstream === "" ? wanted : upstream;
60561
+ }
60562
+ return wanted;
60563
+ }
60492
60564
  //#endregion
60493
60565
  //#region src/client/VideoPanel.tsx
60494
60566
  /**
@@ -60597,9 +60669,8 @@ probe: "/api/dsh-imagegen/code/probe" };
60597
60669
  }
60598
60670
  if (!videoModels.includes(model)) setModel(videoModels[0]);
60599
60671
  }, [videoModels, model]);
60600
- model === "" || describeVideoModel(model).family;
60601
- const unknownModel = model !== "" && describeVideoModel(model).family === "unknown";
60602
- const catalog = describeVideoModel(model);
60672
+ const catalog = describeVideoModel((0, react.useMemo)(() => resolveVideoModelId(model, config?.channels), [config, model]));
60673
+ const unknownModel = model !== "" && catalog.family === "unknown";
60603
60674
  const availableModes = (0, react.useMemo)(() => {
60604
60675
  if (model === "") return ["text"];
60605
60676
  const supported = catalog.modes;