Skip to content

Make videos on the computer you already own. FreeVideo runs MiniMax H3 in as little as 8 GB of VRAM and 16 GB of RAM, and adapts its acceleration path to your hardware.

Localize advanced generation node labels in Chinese

Bowen Xueffefc31e6764
diff --git a/freevideo_engine/failure_details.py b/freevideo_engine/failure_details.py
index faa5b3f..ed856ca 100644
--- a/freevideo_engine/failure_details.py
+++ b/freevideo_engine/failure_details.py
@@ -451,13 +451,13 @@ def launcher_failure(value, *, zh=False, other_disk=False, disk_name='', can_rep
'请使用 39、56、73、90 等每次增加 17 的帧数;接续时,这个数包含开头重复的 22 帧。')),
(r'Continue from video cannot be used with these settings\. Continuing a video needs an NVIDIA', 'continuation-route',
("This computer can't continue a video", '这台电脑无法接续视频'),
- ('Continuing a video needs an NVIDIA GPU. To make a new video, clear "Continue from video".', '接续视频需要 NVIDIA 显卡。要生成新视频,请清空“Continue from video”。')),
+ ('Continuing a video needs an NVIDIA GPU. To make a new video, clear "Continue from video".', '接续视频需要 NVIDIA 显卡。要生成新视频,请清空“接着生成”。')),
(r'Continue from video cannot be used with these settings\. Turn on "Two-pass', 'continuation-passes',
('Continuing needs two-pass acceleration', '接续需要二次采样加速'),
- ('Turn on "Two-pass acceleration" and turn off the first-pass preview.', '请打开“二次采样加速”,并关闭首轮预览。')),
+ ('Turn on "Two-pass acceleration" and turn off the first-pass preview.', '请打开“二次采样加速”,并关闭先出预览。')),
(r'Continue from video cannot be used with these settings\. Clear either', 'continuation-refine',
('A continued part is made in full', '接续会完整生成这一段'),
- ('Clear either "Second pass of preview" or "Continue from video".', '请清空“Second pass of preview”或“Continue from video”其中一项。')),
+ ('Clear either "Second pass of preview" or "Continue from video".', '请清空“继续二采”或“接着生成”其中一项。')),
(r'Continue from video cannot be used with these settings\. Connect up to 3 pictures', 'continuation-media',
('A continued part takes picture references only', '接续段只能用图片参考'),
('Connect up to 3 pictures as references, and remove video, audio and pre-encoded inputs.', '最多接 3 张图片作为参考图,并移除视频、音频参考和预编码输入。')),
diff --git a/scripts/test_freevideo_entry.mjs b/scripts/test_freevideo_entry.mjs
index 5ef1282..c96118c 100644
--- a/scripts/test_freevideo_entry.mjs
+++ b/scripts/test_freevideo_entry.mjs
@@ -164,6 +164,38 @@ test('main browser entry registers both views and preserves node hooks', async t
}
} finally { navigator.language = 'en'; }
});
+ await t.test(`${language} advanced node labels preserve keys, values and untranslated copy`, async () => {
+ navigator.language = language;
+ try {
+ await import('data:text/javascript;base64,' + Buffer.from(source + `\n// label language: ${language}`).toString('base64'));
+ const localized = extensions.at(-1);
+ class LocalizedGenerateNode extends GenerateNode {}
+ await localized.beforeRegisterNodeDef(LocalizedGenerateNode, {name: 'FreeVideoGenerate'});
+ const rows = [
+ ['force_regenerate', 'Force regeneration', '重新生成', false, '跳过已保存结果的缓存。'],
+ ['preview', 'Two-pass: preview first pass', '先出预览', false,
+ '先出半分辨率预览,满意后在结果里点“继续二采”,成片与直接生成一致。'],
+ ['refine_from', 'Second pass of preview', '继续二采', 'preview.mp4', '从这个预览继续生成全分辨率视频。'],
+ ['continue_from', 'Continue from video', '接着生成', 'previous.mp4'],
+ ['frames', 'Total frames', '帧数', 141],
+ ['first_frame_reference', 'First-frame reference', '首帧参考', true, '减小漂移'],
+ ['voice_reference', 'Voice reference', 'Voice reference', true],
+ ['hide_tail', 'Hide dialogue tail', 'Hide dialogue tail', true],
+ ];
+ const node = new LocalizedGenerateNode();
+ node.widgets = rows.map(([name, label, , value]) => ({name, label, value, tooltip: `original ${name}`}));
+ node.onNodeCreated();
+ assert.deepEqual(node.widgets.map(w => [w.name, w.value]), rows.map(([name, , , value]) => [name, value]));
+ for (const [name, en, zh, , tooltip] of rows) {
+ const widget = node.widgets.find(w => w.name === name);
+ assert.equal(widget.label, language === 'zh' ? zh : en, name);
+ assert.equal(widget.tooltip, language === 'zh' && tooltip ? tooltip : `original ${name}`, name);
+ }
+ assert.equal(node.widgets[0].type, 'hidden');
+ assert.equal(node.widgets[0].serializeValue(), false);
+ node.onRemoved();
+ } finally { navigator.language = 'en'; }
+ });
}
await extension.beforeRegisterNodeDef(GenerateNode, {name: 'FreeVideoGenerate'});
const node = new GenerateNode(); app.graph._nodes = [node];
diff --git a/web/error_panel.js b/web/error_panel.js
index 80c16d0..c9d38de 100644
--- a/web/error_panel.js
+++ b/web/error_panel.js
@@ -23,13 +23,13 @@ const PLAIN_ERRORS = [
summary: ['Set the width and height to the previous video’s size.', '请把宽度和高度设为与上一段视频相同。']},
{key: 'continuation-route', message: 'Continue from video cannot be used with these settings. Continuing a video needs an NVIDIA GPU. To make a new video, clear "Continue from video".',
title: ['This computer can\'t continue a video', '这台电脑无法接续视频'],
- summary: ['Continuing a video needs an NVIDIA GPU. To make a new video, clear "Continue from video".', '接续视频需要 NVIDIA 显卡。要生成新视频,请清空“Continue from video”。']},
+ summary: ['Continuing a video needs an NVIDIA GPU. To make a new video, clear "Continue from video".', '接续视频需要 NVIDIA 显卡。要生成新视频,请清空“接着生成”。']},
{key: 'continuation-passes', message: 'Continue from video cannot be used with these settings. Turn on "Two-pass acceleration" and turn off the first-pass preview.',
title: ['Continuing needs two-pass acceleration', '接续需要二次采样加速'],
- summary: ['Turn on "Two-pass acceleration" and turn off the first-pass preview.', '请打开“二次采样加速”,并关闭首轮预览。']},
+ summary: ['Turn on "Two-pass acceleration" and turn off the first-pass preview.', '请打开“二次采样加速”,并关闭先出预览。']},
{key: 'continuation-refine', message: 'Continue from video cannot be used with these settings. Clear either "Second pass of preview" or "Continue from video".',
title: ['A continued part is made in full', '接续会完整生成这一段'],
- summary: ['Clear either "Second pass of preview" or "Continue from video".', '请清空“Second pass of preview”或“Continue from video”其中一项。']},
+ summary: ['Clear either "Second pass of preview" or "Continue from video".', '请清空“继续二采”或“接着生成”其中一项。']},
{key: 'continuation-media', message: 'Continue from video cannot be used with these settings. Connect up to 3 pictures as references, and remove video, audio and pre-encoded inputs.',
title: ['A continued part takes picture references only', '接续段只能用图片参考'],
summary: ['Connect up to 3 pictures as references, and remove video, audio and pre-encoded inputs.', '最多接 3 张图片作为参考图,并移除视频、音频参考和预编码输入。']},
diff --git a/web/freevideo.js b/web/freevideo.js
index f49e512..2ef03b0 100644
--- a/web/freevideo.js
+++ b/web/freevideo.js
@@ -721,6 +721,23 @@ app.registerExtension({
'修改采样步数可能降低生成质量。默认一采 8 步、二采 3 步;只有一采为 8 步时才会使用二次采样加速,其他步数只采样一遍;其他二采步数需小于一采步数。');
}
}
+ if (cn) {
+ // Reuse product wording; leave untranslated names with no established Chinese copy.
+ for (const [name, label, tooltip] of [
+ ['force_regenerate', '重新生成', '跳过已保存结果的缓存。'],
+ ['preview', '先出预览', '先出半分辨率预览,满意后在结果里点“继续二采”,成片与直接生成一致。'],
+ ['refine_from', '继续二采', '从这个预览继续生成全分辨率视频。'],
+ ['continue_from', '接着生成'],
+ ['frames', '帧数'],
+ ['first_frame_reference', '首帧参考', '减小漂移'],
+ ]) {
+ const widget = this.widgets?.find(w => w.name === name);
+ if (widget) {
+ widget.label = label;
+ if (tooltip) widget.tooltip = tooltip;
+ }
+ }
+ }
for (const widget of this.widgets || []) {
// Node and creation-panel edits use the same named draft.
const node = this, callback = widget.callback;