Publish Seedance 2.5 draft mode and video updates

- Add the 样片模式 flow: 480p draft generation, a linkable draft task ID, and pre-flight verification before the 1080p final request.

- Allow reference images and audio in video edit/extend requests, matching the provider's 2.5 contract.

- Move 主模型 and 样片模式 ahead of 生成模式, default 主模型 to seedance 2.5, and migrate saved widget values.

- Refresh the video panel, asset API response logs, and LLM node handling; cover the new behavior with offline tests.
This commit is contained in:
Jony
2026-10-21 20:13:55 +08:00
parent 532d4a9541
commit ff1cf830fa
27 changed files with 1810 additions and 341 deletions
+18 -7
View File
@@ -2,7 +2,7 @@ import { app } from "../../../scripts/app.js";
// ── Seedance 多模态节点参数联动 ───────────────────────────────────────────────
//
// fast、mini 不支持 1080p / 4k;2.5 支持全部分辨率和最长 30 秒。
// fast、mini 不支持 1080p / 4k;2.5 最高 1080p,且支持最长 30 秒。
// 当用户切换到受限模型,或选择不支持的分辨率时,
// 弹 toast 报错并把分辨率回退到 720p,避免提交后才在后端报错浪费一次调用。
//
@@ -16,7 +16,14 @@ const isLimitedModel = (v) => LIMITED_MODELS.has(v);
const MODEL_25 = "seedance 2.5";
const ALL_RESOLUTIONS = ["720p", "1080p", "4k", "480p"];
const LIMITED_RESOLUTIONS = ["720p", "480p"];
const NO_4K_RESOLUTIONS = ["720p", "1080p", "480p"];
const RESOLUTION_FALLBACK = "720p";
function resolutionsForModel(model) {
if (isLimitedModel(model)) return LIMITED_RESOLUTIONS;
if (model === MODEL_25) return NO_4K_RESOLUTIONS;
return ALL_RESOLUTIONS;
}
const durationOptions = (maximum) => [
"自动",
...Array.from({ length: maximum - 3 }, (_, index) => `${index + 4}秒`),
@@ -51,17 +58,20 @@ function updateDynamicParameters(node, silent = false) {
const durationWidget = findWidget(node, "时长");
if (!modelWidget || !resWidget || !durationWidget) return;
const limited = isLimitedModel(modelWidget.value);
const maximumDuration = modelWidget.value === MODEL_25 ? 30 : 15;
const allowedResolutions = resolutionsForModel(modelWidget.value);
resWidget.options ??= {};
resWidget.options.values = limited ? LIMITED_RESOLUTIONS : ALL_RESOLUTIONS;
resWidget.options.values = allowedResolutions;
durationWidget.options ??= {};
durationWidget.options.values = maximumDuration === 30 ? DURATIONS_25 : DURATIONS_20;
if (limited && !LIMITED_RESOLUTIONS.includes(resWidget.value)) {
if (!allowedResolutions.includes(resWidget.value)) {
setWidgetValue(resWidget, RESOLUTION_FALLBACK);
if (!silent) {
notify(`${modelWidget.value} 仅支持 480p/720p,已自动切换为 ${RESOLUTION_FALLBACK}。`);
notify(
`${modelWidget.value} 仅支持 ${allowedResolutions.join(" / ")},`
+ `已自动切换为 ${RESOLUTION_FALLBACK}。`,
);
}
}
@@ -94,9 +104,10 @@ function guardNode(node) {
const origResCb = resWidget.callback;
resWidget.callback = function (value) {
if (isLimitedModel(modelWidget.value) && !LIMITED_RESOLUTIONS.includes(value)) {
const allowedResolutions = resolutionsForModel(modelWidget.value);
if (!allowedResolutions.includes(value)) {
resWidget.value = RESOLUTION_FALLBACK;
notify(`${modelWidget.value} 仅支持 480p/720p。`);
notify(`${modelWidget.value} 仅支持 ${allowedResolutions.join(" / ")}。`);
node.setDirtyCanvas?.(true, true);
return origResCb?.call(this, RESOLUTION_FALLBACK);
}