@q253595422/dsh-imagegen-video 1.14.0 → 1.15.0
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 +40 -0
- package/README.md +9 -0
- package/docs/releases/v1.15.0.md +77 -0
- package/lib/client.js +54 -0
- package/lib/client.js.map +1 -1
- package/lib/index.js +256 -20
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -5,6 +5,46 @@ Attribution for third-party code is in [NOTICE](./NOTICE).
|
|
|
5
5
|
|
|
6
6
|
## Releases
|
|
7
7
|
|
|
8
|
+
### 1.15.0 — Volcengine Ark, properly
|
|
9
|
+
|
|
10
|
+
- **Seedream gets the real Ark contract.** The official ids
|
|
11
|
+
(`doubao-seedream-5-0-pro-260628` and friends) have no `aspect_ratio`
|
|
12
|
+
parameter at all, and their `size` is EITHER a tier (`1K`/`1.5K`/`2K`/`3K`/
|
|
13
|
+
`4K`) OR an explicit `WxH` — never both. Sending a bare tier therefore
|
|
14
|
+
threw the panel's ratio away and a 16:9 request came back square or 1:1.
|
|
15
|
+
Ark ids now receive explicit even dimensions solved from the chosen ratio
|
|
16
|
+
inside that model's documented pixel budget (5.0 pro/flash cap at
|
|
17
|
+
`2048x2048x1.1025`; 4.5 and 5.0 lite at `4096x4096`; 3.0 at `2048x2048`).
|
|
18
|
+
`auto` still sends the tier string, which is Ark's "you choose" form.
|
|
19
|
+
- **The watermark is turned off explicitly.** Ark documents `watermark: true`
|
|
20
|
+
as the default, so every Ark request used to come back with a visible
|
|
21
|
+
"AI生成" stamp in the corner. Both the text-to-image and the edit request
|
|
22
|
+
now send `watermark: false`. Gateway-shaped Seedream still sends
|
|
23
|
+
`b64_json`; only the official Ark shape uses `response_format: 'url'`.
|
|
24
|
+
- **Seedance is a first-class video family.** `doubao-seedance-*` ids were
|
|
25
|
+
being classified as the generic OpenAI-style video endpoint, which posted
|
|
26
|
+
to `/videos` and never worked. They now speak Ark's own task contract:
|
|
27
|
+
`POST /contents/generations/tasks`, poll
|
|
28
|
+
`GET /contents/generations/tasks/{id}`, clip at `content.video_url`.
|
|
29
|
+
The prompt and every reference ride in a `content` array — images carry a
|
|
30
|
+
`role` of `first_frame` / `last_frame` / `reference_image` — the ratio field
|
|
31
|
+
is `ratio`, resolution is lowercase, and duration is an integer.
|
|
32
|
+
- **Values are narrowed where the model would reject them.** Seedance 2.x
|
|
33
|
+
accepts 4–15 seconds and 1.0 accepts 2–12; the `fast`/`mini` ids cap at
|
|
34
|
+
720p and reject 1080p and 4k upstream. Requests are clamped to the window
|
|
35
|
+
and degraded to the best tier the id does support (a 1080P ask on a fast id
|
|
36
|
+
becomes 720p, not 480p) instead of being sent as a guaranteed 400.
|
|
37
|
+
- **Silent by default, not by accident.** `generate_audio` also defaults to
|
|
38
|
+
true upstream; the panel has no audio control, so both flags are sent
|
|
39
|
+
explicitly as `false`.
|
|
40
|
+
- **One channel, both halves.** The built-in preset is now "字节 · 火山方舟
|
|
41
|
+
(Seedream / Seedance)" with real model ids and a video catalog, so one
|
|
42
|
+
Ark channel serves images and videos.
|
|
43
|
+
- **Offline coverage.** `B7` asserts the Ark pixel size stays inside the
|
|
44
|
+
budget, keeps the ratio and is even, plus `watermark: false`; two new
|
|
45
|
+
`smoke-video` cases cover the Seedance submit body, the poll path and
|
|
46
|
+
`content.video_url`, and the duration/resolution narrowing.
|
|
47
|
+
|
|
8
48
|
### 1.14.0 — draw it in code, render it here
|
|
9
49
|
|
|
10
50
|
- **A second renderer, chosen per task.** The canvas composer now carries a
|
package/README.md
CHANGED
|
@@ -185,13 +185,22 @@ 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 秒。`fast` / `mini` 型号上游只到 720p,面板会把 1080P 收敛到 720p 而不是让请求 400。 |
|
|
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 下是 `2866x1612`),这样比例才真的生效;`auto` 才回落到档位字符串。
|
|
200
|
+
- **水印**:方舟的 `watermark` 默认是 **true**(右下角「AI生成」),插件每次都显式发 `watermark: false`。生视频同理,并额外关掉 `generate_audio`(面板没有音轨控制,不想凭空多一条声音)。
|
|
201
|
+
- **响应格式**:方舟的 Seedream 用 `response_format: 'url'`,插件随后回源下载;网关版的 Seedream 仍走 `b64_json`。
|
|
202
|
+
- **模型 ID**:预置里是方舟控制台的模型 ID;如果用的是推理接入点,把模型 id 换成 `ep-…` 也能工作(协议族按请求形状判断,不依赖具体 id)。
|
|
203
|
+
|
|
195
204
|
</details>
|
|
196
205
|
|
|
197
206
|
#### 代码生成路径(不调生图/生视频模型)
|
|
@@ -0,0 +1,77 @@
|
|
|
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 → `2866x1612`(比例 1.7779,总像素 4,619,992,在预算内)。
|
|
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。越界的请求会被收进窗口,并把分辨率降到该型号真正支持的最高档(1080P 在 fast 型号上降为 720p,而不是掉到 480p)。
|
|
54
|
+
- `watermark` 与 `generate_audio` 在方舟都默认 true,插件每次都显式发 `false`。
|
|
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
|
+
用推理接入点(`ep-…`)也能工作:协议族按请求形状与模型 id 前缀判断,不依赖固定 id。
|
|
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
|
+
- 收敛后的值会写进请求,但**不会改写你在面板里选的原值**:同一次生成之外,选择保持原样。
|
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,26 @@ 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
|
+
return seedance2 ? {
|
|
60494
|
+
family: "seedance",
|
|
60495
|
+
...base,
|
|
60496
|
+
resolutions,
|
|
60497
|
+
modes: [
|
|
60498
|
+
"text",
|
|
60499
|
+
"image",
|
|
60500
|
+
"keyframe",
|
|
60501
|
+
"reference"
|
|
60502
|
+
]
|
|
60503
|
+
} : {
|
|
60504
|
+
family: "seedance",
|
|
60505
|
+
...base,
|
|
60506
|
+
resolutions
|
|
60507
|
+
};
|
|
60508
|
+
}
|
|
60455
60509
|
if (isComemoeVideoModel(id)) {
|
|
60456
60510
|
const base = ENTRIES.comemoe;
|
|
60457
60511
|
return id === "wan2.2-t2v" || /t2v/i.test(id) ? {
|