新增 MiniMax H3 Highspeed/Lite 与 Seedance 2.5 Flash,兼容视频参数和旧工作流
This commit is contained in:
@@ -3686,7 +3686,7 @@ assert.match(migrationSource, /原生 seed 参数/);
|
||||
nodes: [{ type: "MiniMaxH3Video", widgets_values: legacyMiniMaxValues }],
|
||||
};
|
||||
migrationExtension.beforeConfigureGraph(legacyMiniMaxGraph);
|
||||
assert.deepEqual(legacyMiniMaxValues.slice(-2), ["MiniMax-H3", 0]);
|
||||
assert.deepEqual(legacyMiniMaxValues, ["prompt", "MiniMax-H3", "文生视频", "16:9", "2K", 5, 0]);
|
||||
assert.equal(legacyMiniMaxValues.length, 7);
|
||||
migrationExtension.beforeConfigureGraph(legacyMiniMaxGraph);
|
||||
assert.equal(legacyMiniMaxValues.length, 7);
|
||||
@@ -3697,7 +3697,48 @@ assert.match(migrationSource, /原生 seed 参数/);
|
||||
migrationExtension.beforeConfigureGraph({
|
||||
nodes: [{ type: "MiniMaxH3Video", widgets_values: modelOnlyMiniMaxValues }],
|
||||
});
|
||||
assert.deepEqual(modelOnlyMiniMaxValues.slice(-2), ["MiniMax-H3-MAX", 0]);
|
||||
assert.deepEqual(modelOnlyMiniMaxValues, ["prompt", "MiniMax-H3-MAX", "文生视频", "16:9", "2K", 5, 0]);
|
||||
for (const model of ["MiniMax-H3", "MiniMax-H3-MAX", "MiniMax-H3-Highspeed", "MiniMax-H3-Lite"]) {
|
||||
// A current workflow must survive repeated migration without extra defaults.
|
||||
const values = ["prompt", "参考素材生视频", "16:9", "480P", 4, model, 42];
|
||||
const saved = [...values];
|
||||
const graph = { nodes: [{ type: "MiniMaxH3Video", widgets_values: values }] };
|
||||
migrationExtension.beforeConfigureGraph(graph);
|
||||
migrationExtension.beforeConfigureGraph(graph);
|
||||
const current = ["prompt", model, "多模态生视频", "16:9", "480P", 4, 42];
|
||||
assert.deepEqual(values, current);
|
||||
for (const control of ["fixed", "increment", "decrement", "randomize"]) {
|
||||
const withSeedControl = [...saved, control];
|
||||
const controlGraph = {
|
||||
nodes: [{ type: "MiniMaxH3Video", widgets_values: withSeedControl }],
|
||||
};
|
||||
migrationExtension.beforeConfigureGraph(controlGraph);
|
||||
migrationExtension.beforeConfigureGraph(controlGraph);
|
||||
assert.deepEqual(withSeedControl, [...current, control]);
|
||||
}
|
||||
const withoutSeed = saved.slice(0, -1);
|
||||
migrationExtension.beforeConfigureGraph({
|
||||
nodes: [{ type: "MiniMaxH3Video", widgets_values: withoutSeed }],
|
||||
});
|
||||
assert.deepEqual(withoutSeed, [...current.slice(0, -1), 0]);
|
||||
const nested = [...saved];
|
||||
const nestedGraph = { definitions: { subgraphs: [{ nodes: [
|
||||
{ type: "MiniMaxH3Video", widgets_values: nested },
|
||||
] }] } };
|
||||
migrationExtension.beforeConfigureGraph(nestedGraph);
|
||||
migrationExtension.beforeConfigureGraph(nestedGraph);
|
||||
assert.deepEqual(nested, current);
|
||||
|
||||
// Model-first workflows, including text mode, keep their selected mode and values.
|
||||
for (const mode of ["多模态生视频", "文生视频", "首帧图生视频", "首尾帧生视频"]) {
|
||||
const currentValues = ["prompt", model, mode, "768P", 8, 123, "randomize"];
|
||||
const expected = [...currentValues];
|
||||
const currentGraph = { nodes: [{ type: "MiniMaxH3Video", widgets_values: currentValues }] };
|
||||
migrationExtension.beforeConfigureGraph(currentGraph);
|
||||
migrationExtension.beforeConfigureGraph(currentGraph);
|
||||
assert.deepEqual(currentValues, expected);
|
||||
}
|
||||
}
|
||||
assert.equal(legacyValues[13], "auto");
|
||||
assert.equal(legacyValues[14], false);
|
||||
assert.equal(legacyValues[15], "整组素材→多个目标");
|
||||
@@ -4225,12 +4266,12 @@ assert.match(migrationSource, /原生 seed 参数/);
|
||||
callback(nextValue) { callbacks.push([name, nextValue]); },
|
||||
});
|
||||
const model = widget("模型", "MiniMax-H3");
|
||||
const mode = widget("生成模式", "参考素材生视频");
|
||||
const mode = widget("生成模式", "多模态生视频");
|
||||
const resolution = widget("分辨率", "2K");
|
||||
const duration = widget("时长", 4);
|
||||
const node = {
|
||||
comfyClass: "MiniMaxH3Video",
|
||||
widgets: [mode, resolution, duration, model],
|
||||
widgets: [model, mode, resolution, duration],
|
||||
setDirtyCanvas() {},
|
||||
};
|
||||
|
||||
@@ -4243,11 +4284,72 @@ assert.match(migrationSource, /原生 seed 参数/);
|
||||
assert.equal(duration.value, 5);
|
||||
assert.equal(mode.value, "文生视频");
|
||||
|
||||
mode.value = "参考素材生视频";
|
||||
mode.value = "多模态生视频";
|
||||
mode.callback(mode.value);
|
||||
assert.equal(mode.value, "文生视频");
|
||||
assert.ok(notices.length >= 1);
|
||||
assert.ok(callbacks.some(([name, value]) => name === "生成模式" && value === "文生视频"));
|
||||
|
||||
const ratio = widget("生成模式.宽高比", "adaptive");
|
||||
node.widgets.push(ratio);
|
||||
for (const nextModel of ["MiniMax-H3-Highspeed", "MiniMax-H3-Lite"]) {
|
||||
mode.value = "多模态生视频";
|
||||
resolution.value = "2K";
|
||||
duration.value = 4;
|
||||
ratio.value = "adaptive";
|
||||
model.value = nextModel;
|
||||
model.callback(nextModel);
|
||||
assert.deepEqual(Array.from(resolution.options.values), ["768P", "480P"]);
|
||||
assert.equal(resolution.value, "768P");
|
||||
assert.equal(duration.options.min, 4);
|
||||
assert.equal(duration.value, 4);
|
||||
assert.equal(mode.value, "多模态生视频");
|
||||
assert.equal(ratio.options.values.includes("adaptive"), nextModel !== "MiniMax-H3-Lite");
|
||||
assert.equal(ratio.value, nextModel === "MiniMax-H3-Lite" ? "16:9" : "adaptive");
|
||||
resolution.value = "480P";
|
||||
resolution.callback("480P");
|
||||
assert.equal(resolution.value, "480P");
|
||||
resolution.value = "1080P";
|
||||
resolution.callback("1080P");
|
||||
assert.equal(resolution.value, "768P");
|
||||
mode.value = "尾帧图生视频";
|
||||
mode.callback(mode.value);
|
||||
assert.equal(mode.value, "首尾帧生视频");
|
||||
}
|
||||
|
||||
mode.value = "多模态生视频";
|
||||
mode.callback(mode.value);
|
||||
ratio.value = "adaptive";
|
||||
ratio.callback(ratio.value);
|
||||
assert.equal(ratio.value, "16:9");
|
||||
assert.deepEqual(callbacks.at(-1), ["生成模式.宽高比", "16:9"]);
|
||||
ratio.value = "9:16";
|
||||
model.value = "MiniMax-H3-Highspeed";
|
||||
model.callback(model.value);
|
||||
assert.equal(ratio.value, "9:16");
|
||||
assert.equal(ratio.options.values.includes("adaptive"), true);
|
||||
|
||||
// Dynamic mode changes replace child widgets; guard the replacement too.
|
||||
const replacementRatio = widget("宽高比", "adaptive");
|
||||
node.widgets.pop();
|
||||
mode.childWidgets = [replacementRatio];
|
||||
model.value = "MiniMax-H3-Lite";
|
||||
model.callback(model.value);
|
||||
assert.equal(replacementRatio.value, "16:9");
|
||||
const callbackAfterGuard = model.callback;
|
||||
minimaxExtension.loadedGraphNode(node);
|
||||
minimaxExtension.nodeCreated(node);
|
||||
assert.equal(model.callback, callbackAfterGuard);
|
||||
replacementRatio.value = "adaptive";
|
||||
minimaxExtension.loadedGraphNode(node);
|
||||
assert.equal(replacementRatio.value, "16:9");
|
||||
|
||||
model.value = "MiniMax-H3";
|
||||
resolution.value = "480P";
|
||||
model.callback(model.value);
|
||||
assert.deepEqual(Array.from(resolution.options.values), ["2K", "768P"]);
|
||||
assert.equal(resolution.value, "768P");
|
||||
assert.equal(replacementRatio.options.values.includes("adaptive"), true);
|
||||
}
|
||||
|
||||
{
|
||||
@@ -4323,11 +4425,25 @@ assert.match(migrationSource, /原生 seed 参数/);
|
||||
modelWidget.callback(modelWidget.value);
|
||||
assert.equal(routeWidget.value, "国内");
|
||||
|
||||
modelWidget.value = "seedance 2.5 flash";
|
||||
routeWidget.value = "海外";
|
||||
resolutionWidget.value = "1080p";
|
||||
modelWidget.callback(modelWidget.value);
|
||||
assert.deepEqual(Array.from(resolutionWidget.options.values), ["480p", "720p"]);
|
||||
assert.deepEqual(Array.from(routeWidget.options.values), ["国内"]);
|
||||
assert.equal(routeWidget.value, "国内");
|
||||
assert.equal(resolutionWidget.value, "720p");
|
||||
assert.equal(durationWidget.options.values.at(-1), "30秒");
|
||||
routeWidget.value = "海外";
|
||||
routeWidget.callback("海外");
|
||||
assert.equal(routeWidget.value, "国内");
|
||||
|
||||
modelWidget.value = "seedance 2.0 fast";
|
||||
modelWidget.callback(modelWidget.value);
|
||||
assert.deepEqual(Array.from(resolutionWidget.options.values), ["480p", "720p"]);
|
||||
assert.equal(resolutionWidget.value, "720p");
|
||||
assert.equal(durationWidget.value, "15秒");
|
||||
assert.deepEqual(Array.from(routeWidget.options.values), ["海外", "国内"]);
|
||||
}
|
||||
|
||||
{
|
||||
@@ -4506,6 +4622,13 @@ assert.match(migrationSource, /原生 seed 参数/);
|
||||
);
|
||||
migrationExtension.beforeConfigureGraph({ nodes: [autoPassNode] });
|
||||
assert.equal(autoPassNode.widgets_values.length, 65);
|
||||
const flashNode = JSON.parse(JSON.stringify(autoPassNode));
|
||||
flashNode.widgets_values[1] = "seedance 2.5 flash";
|
||||
const flashValues = [...flashNode.widgets_values];
|
||||
const flashGraph = { definitions: { subgraphs: [{ nodes: [flashNode] }] } };
|
||||
migrationExtension.beforeConfigureGraph(flashGraph);
|
||||
migrationExtension.beforeConfigureGraph(flashGraph);
|
||||
assert.deepEqual(flashNode.widgets_values, flashValues);
|
||||
|
||||
const legacyFrameNode = {
|
||||
type: "SeedanceAutoPass",
|
||||
@@ -4793,6 +4916,14 @@ assert.match(migrationSource, /原生 seed 参数/);
|
||||
node.inputs = [{name: "样片任务ID输入", link: null}];
|
||||
node.onConnectionsChange?.();
|
||||
assert.equal(taskId.hidden, false);
|
||||
|
||||
model.value = "seedance 2.5 flash";
|
||||
model.callback(model.value);
|
||||
assert.equal(draft.value, "关闭");
|
||||
assert.equal(draft.hidden, true);
|
||||
assert.equal(taskId.hidden, true);
|
||||
assert.deepEqual(Array.from(resolution.options.values), ["480p", "720p"]);
|
||||
assert.equal(duration.options.values.at(-1), "30秒");
|
||||
}
|
||||
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user