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.

Keep FreeVideo's own text out of browser auto-translate (MP stays MP)

Bowen Xue6ca16b3432bc
diff --git a/scripts/test_freevideo_entry.mjs b/scripts/test_freevideo_entry.mjs
index 65fe2b1..dc1ee8a 100644
--- a/scripts/test_freevideo_entry.mjs
+++ b/scripts/test_freevideo_entry.mjs
@@ -126,7 +126,8 @@ test('main browser entry registers both views and preserves node hooks', async t
.replace("import { uploadMedia } from './media_upload.js';", 'const {uploadMedia} = globalThis.__freevideoEntryTest;')
.replace("import { createCastLibrary } from './cast_library.js';", 'const {createCastLibrary} = globalThis.__freevideoEntryTest;')
.replace("import { agentInterfaceEnabled } from './agent_connect.js';", 'const agentInterfaceEnabled = async () => false;')
- .replace("import { installNativeErrorGuard } from './native_errors.js';", 'const installNativeErrorGuard = () => {};');
+ .replace("import { installNativeErrorGuard } from './native_errors.js';", 'const installNativeErrorGuard = () => {};')
+ .replace("import { installTranslateGuard } from './translate_guard.js';", 'const installTranslateGuard = () => {};');
await import('data:text/javascript;base64,' + Buffer.from(source).toString('base64'));
const extension = extensions.find(row => row.name === 'FreeVideo.UnifiedMedia');
assert.ok(extension, 'the main extension must register');
diff --git a/web/freevideo.js b/web/freevideo.js
index ae5fb80..5f5de11 100644
--- a/web/freevideo.js
+++ b/web/freevideo.js
@@ -1,5 +1,6 @@
import { createErrorPanel, errorText, createErrorReport, adviceFor } from './error_panel.js';
import { installNativeErrorGuard } from './native_errors.js';
+import { installTranslateGuard } from './translate_guard.js';
import { app } from "../../scripts/app.js";
import { api } from "../../scripts/api.js";
import { openEditorView } from './editor_loader.js';
@@ -846,6 +847,7 @@ api.addEventListener('freevideo_prewarm', event => {
if (value) app.graph?.getNodeById(value.node)?.freevideoShowPrewarm?.(value);
});
+installTranslateGuard({chinese: cn});
installNativeErrorGuard({api, app, describe: detail => {
const {advice} = adviceFor(createErrorReport(detail, {stage: 'execution', graph: app.graph}), text);
return [advice.title, advice.summary].filter(Boolean).join('\n');
diff --git a/web/health.js b/web/health.js
index 3647b1f..050c2f6 100644
--- a/web/health.js
+++ b/web/health.js
@@ -15,7 +15,7 @@ const launchVisit = query.get('freevideo') === 'launch';
// Every script this folder ships; a test keeps the list in step with web/*.js.
export const MODULES = ['agent_activity.js', 'agent_connect.js', 'agent_session.js', 'autopilot.js', 'autopilot_chat.js', 'autopilot_conversations.js', 'browser_extension.js', 'caret_rect.js', 'chain_support.js', 'capability_view.js', 'cast_generate.js', 'cast_mention.js', 'cast_overlay.js', 'cast_source.js', 'compatibility.js', 'entry_showcase.js', 'error_panel.js', 'first_run_guide.js', 'fonts.js', 'freevideo.js', 'generation_progress.js',
'editor.js', 'editor_actions.js', 'editor_lifecycle.js', 'editor_adjust.js', 'editor_adjust_picture.js', 'editor_picture_fields.js', 'editor_picture_session.js', 'editor_preview_picture.js', 'editor_entry.js', 'editor_expand.js', 'editor_export_dialog.js', 'editor_first_frame.js', 'editor_media_references.js', 'editor_references.js', 'editor_genbar.js', 'editor_geometry.js', 'editor_library.js', 'editor_menu.js', 'editor_model.js', 'editor_frame.js', 'editor_player.js', 'editor_room.js', 'editor_select.js', 'editor_state.js', 'editor_store.js', 'editor_tracks.js', 'editor_generation.js', 'editor_transport.js', 'editor_transport_model.js', 'editor_audio.js', 'editor_audio_model.js', 'editor_audio_notes.js', 'editor_audio_replace.js', 'editor_audio_rules.js', 'editor_speed.js', 'editor_speed_model.js', 'editor_failure.js', 'editor_header_fit.js',
- 'editor_loader.js', 'editor_text_coverage.js', 'editor_text.js', 'editor_toolbar_more.js', 'editor_text_model.js', 'editor_text_layout.js', 'editor_notes.js', 'editor_icons.js', 'dialog_keys.js', 'done_notify.js', 'failure_issue.js', 'feedback.js', 'frame_sizes.js', 'health.js', 'image_commands.js', 'image_editor.js', 'image_editor_engine.js', 'image_generation.js', 'launch_visit.js', 'launcher.js', 'length_plan.js', 'lora_triggers.js', 'lora_check.js', 'library.js', 'motion.js', 'native_errors.js', 'output_download.js', 'port_notice.js', 'preview_scene.js',
+ 'editor_loader.js', 'editor_text_coverage.js', 'editor_text.js', 'editor_toolbar_more.js', 'editor_text_model.js', 'editor_text_layout.js', 'editor_notes.js', 'editor_icons.js', 'dialog_keys.js', 'done_notify.js', 'failure_issue.js', 'feedback.js', 'frame_sizes.js', 'health.js', 'image_commands.js', 'image_editor.js', 'image_editor_engine.js', 'image_generation.js', 'launch_visit.js', 'launcher.js', 'length_plan.js', 'lora_triggers.js', 'lora_check.js', 'library.js', 'motion.js', 'native_errors.js', 'translate_guard.js', 'output_download.js', 'port_notice.js', 'preview_scene.js',
'progress_connection.js', 'prompt_draft.js', 'prompt_enhance.js', 'prompt_references.js', 'prompt_terms.js', 'request_assets.js', 'repair_hint.js', 'report_issue.js', 'studio_recent.js',
'result_actions.js', 'sampling_effort.js', 'setup.js', 'share.js', 'share_layout.js', 'studio.js', 'studio_chain.js', 'studio_extend.js', 'studio_length.js', 'first_frame_row.js', 'optional_inputs.js', 'studio_queue.js', 'studio_size.js',
'toolbar_position.js', 'updates.js', 'view_navigation.js', 'wordmark.js', 'workspace_restore.js', 'cast_library.js', 'media_upload.js', 'whitebox_encode.js', 'whitebox_mp4.js', 'whitebox_recording.js', 'whitebox_render.js', 'whitebox_scenes.js', 'whitebox_worker.js'];
diff --git a/web/translate_guard.js b/web/translate_guard.js
new file mode 100644
index 0000000..7db62f0
--- /dev/null
+++ b/web/translate_guard.js
@@ -0,0 +1,17 @@
+// Browser auto-translate reads ComfyUI's lang="en" page and rewrites FreeVideo's own text: "MP"
+// became 兆帕. FreeVideo writes both languages itself, so its surfaces opt out of translation and
+// a Chinese interface says so on the document.
+const OWN_CLASS = /(^|\s)fv-/;
+
+export function markOwn(node) {
+ if (node?.nodeType !== 1 || node.hasAttribute('translate')) return;
+ if (OWN_CLASS.test(node.getAttribute('class') || '') || node.id?.startsWith('fv-')) node.setAttribute('translate', 'no');
+}
+
+export function installTranslateGuard({chinese, doc = document} = {}) {
+ if (chinese) doc.documentElement.lang = 'zh-CN';
+ for (const node of doc.body.children) markOwn(node);
+ new MutationObserver(records => {
+ for (const record of records) for (const node of record.addedNodes) markOwn(node);
+ }).observe(doc.body, {childList: true});
+}