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.
Generating no longer fails when a restored workflow leaves the frame count empty
Bowen Xue44a47f41e251
diff --git a/scripts/test_freevideo_entry.mjs b/scripts/test_freevideo_entry.mjsindex d790bb6..de10236 100644--- a/scripts/test_freevideo_entry.mjs+++ b/scripts/test_freevideo_entry.mjs@@ -4,6 +4,7 @@ import test from 'node:test';import {outputDownloadURL} from '../web/output_download.js';import {regenerateResult, upscaleResult} from '../web/studio_queue.js';import {referenceInputs} from '../web/prompt_references.js';+import {cleanOptionalPrompt, cleanOptionalWidgets} from '../web/optional_inputs.js';class Element {constructor(tag) {@@ -35,7 +36,7 @@ test('main browser entry registers both views and preserves node hooks', async tconst document = {head: new Element('head'), createElement: tag => new Element(tag),createRange: () => ({createContextualFragment: () => new Element('span')})};const dependencies = {- app, api, outputDownloadURL, regenerateResult, upscaleResult, referenceInputs,+ app, api, outputDownloadURL, regenerateResult, upscaleResult, referenceInputs, cleanOptionalPrompt, cleanOptionalWidgets,createErrorPanel: () => ({element: new Element('error'), show() {}, clear() {}}),errorText: value => String(value),openStudio: node => opened.push(node),@@ -93,6 +94,7 @@ test('main browser entry registers both views and preserves node hooks', async t.replace("import { shareButton } from './share.js';", 'const {shareButton} = globalThis.__freevideoEntryTest;').replace("import { reportFileName } from './report_issue.js';", 'const {reportFileName} = globalThis.__freevideoEntryTest;').replace("import { rememberPromptDraft, savePromptDraft } from './prompt_draft.js';", 'const {rememberPromptDraft,savePromptDraft} = globalThis.__freevideoEntryTest;')+ .replace("import { cleanOptionalWidgets, cleanOptionalPrompt } from './optional_inputs.js';", 'const {cleanOptionalWidgets,cleanOptionalPrompt} = globalThis.__freevideoEntryTest;').replace("import { regenerateResult, upscaleResult } from './studio_queue.js';", 'const {regenerateResult,upscaleResult} = globalThis.__freevideoEntryTest;').replace("import { openImageEditor, icon } from './image_editor.js';", 'const {openImageEditor,icon} = globalThis.__freevideoEntryTest;').replace("import { installNavigation, refreshNavigation, preferredView } from './view_navigation.js';", 'const {installNavigation,refreshNavigation,preferredView} = globalThis.__freevideoEntryTest;')diff --git a/web/editor_entry.js b/web/editor_entry.jsindex e907fe8..3f2feb8 100644--- a/web/editor_entry.js+++ b/web/editor_entry.js@@ -3,6 +3,7 @@ import {openEditor} from './editor.js';import {api} from '../../scripts/api.js';import {app} from '../../scripts/app.js';import {openStudio, showNodes} from './studio.js';+import {cleanOptionalPrompt} from './optional_inputs.js';import {openAutopilot, viewChanged} from './view_navigation.js';import {mediaReferences} from './editor_media_references.js';function editorPanel(node) {@@ -13,7 +14,7 @@ function editorPanel(node) {references: mediaReferences(node),async snapshot() {if (node.freevideoEditorLooping?.()) throw new Error('loop_active');- const value = structuredClone(await app.graphToPrompt());+ const value = cleanOptionalPrompt(structuredClone(await app.graphToPrompt()));return {node: String(node.id), prompt: value.output, extra_data: {extra_pnginfo: {workflow: value.workflow || {}}}};}};}diff --git a/web/freevideo.js b/web/freevideo.jsindex e60bb97..28c1d75 100644--- a/web/freevideo.js+++ b/web/freevideo.js@@ -14,6 +14,7 @@ import { outputDownloadURL } from './output_download.js';import { shareButton } from './share.js';import { reportFileName } from './report_issue.js';import { rememberPromptDraft, savePromptDraft } from './prompt_draft.js';+import { cleanOptionalWidgets, cleanOptionalPrompt } from './optional_inputs.js';import { regenerateResult, upscaleResult } from './studio_queue.js';import { openImageEditor, icon } from './image_editor.js';import { imageGenerationSupported } from './image_generation.js';@@ -458,6 +459,7 @@ function resultPanel(node) {// before the public version added sampling-step widgets.const base = this.widgets?.find(w => w.name === 'base_steps');if (base && typeof base.value === 'boolean') base.value = 8;+ cleanOptionalWidgets(this);// Workflows saved with the earlier 8 + 2 default move to the 8 + 3 default once.if (!args[0]?.properties?.freevideo_refine_v3) {const refine = this.widgets?.find(w => w.name === 'refine_steps');@@ -549,13 +551,13 @@ function resultPanel(node) {node.freevideoUpscaleResult = async value => {if (node.freevideoUpscaling) return;node.freevideoUpscaling = true;- try { return await upscaleResult(api, node.id, value, () => app.graphToPrompt()); }+ try { return await upscaleResult(api, node.id, value, async () => cleanOptionalPrompt(await app.graphToPrompt())); }finally { node.freevideoUpscaling = false; }};node.freevideoRegenerateResult = async value => {if (node.freevideoRegenerating) return;node.freevideoRegenerating = true;- try { return await regenerateResult(api, node.id, value, () => app.graphToPrompt()); }+ try { return await regenerateResult(api, node.id, value, async () => cleanOptionalPrompt(await app.graphToPrompt())); }finally { node.freevideoRegenerating = false; }};const executed = node.onExecuted;diff --git a/web/health.js b/web/health.jsindex 59fb38a..536d6e4 100644--- a/web/health.js+++ b/web/health.js@@ -17,7 +17,7 @@ export const MODULES = ['agent_activity.js', 'agent_connect.js', 'agent_session.'editor.js', 'editor_actions.js', 'editor_adjust.js', 'editor_adjust_picture.js', 'editor_picture_fields.js', 'editor_picture_session.js', 'editor_preview_picture.js', 'editor_entry.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_loader.js', 'editor_text_coverage.js', 'editor_text.js', 'editor_text_model.js', 'editor_text_layout.js', 'editor_notes.js', 'editor_icons.js', 'dialog_keys.js', 'frame_sizes.js', 'health.js', 'image_commands.js', 'image_editor.js', 'image_editor_engine.js', 'image_generation.js', 'launcher.js', 'length_plan.js', 'library.js', 'motion.js', 'output_download.js', 'port_notice.js', 'preview_scene.js','progress_connection.js', 'prompt_draft.js', 'prompt_enhance.js', 'prompt_references.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', 'studio_queue.js', 'studio_size.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'];const sleep = ms => new Promise(resolve => setTimeout(resolve, ms));let visibleAt = 0;diff --git a/web/optional_inputs.js b/web/optional_inputs.jsnew file mode 100644index 0000000..1ce5dcf--- /dev/null+++ b/web/optional_inputs.js@@ -0,0 +1,30 @@+// The optional advanced inputs were appended after the first public workflow+// shape. A workflow restored from an older version, or a widget list that moved,+// can leave an empty or missing value in them, and Comfy then rejects the whole+// request. Keep each of them to a value the server accepts.+const DEFAULTS = {continue_from: '', frames: 0, first_frame_reference: false};++export function optionalInputValue(name, value) {+ if (name === 'frames') return Number.isSafeInteger(value) && value >= 0 ? value : 0;+ if (name === 'continue_from') return typeof value === 'string' ? value : '';+ if (name === 'first_frame_reference') return value === true;+ return value;+}++export function cleanOptionalWidgets(node) {+ for (const widget of node?.widgets || []) {+ if (!(widget.name in DEFAULTS)) continue;+ const value = optionalInputValue(widget.name, widget.value);+ if (value !== widget.value) widget.value = value;+ }+}++export function cleanOptionalPrompt(prompt) {+ for (const entry of Object.values(prompt?.output || {})) {+ if (entry?.class_type !== 'FreeVideoGenerate' || !entry.inputs) continue;+ for (const name of Object.keys(DEFAULTS)) {+ if (name in entry.inputs) entry.inputs[name] = optionalInputValue(name, entry.inputs[name]);+ }+ }+ return prompt;+}diff --git a/web/studio.js b/web/studio.jsindex eced36b..8d9db68 100644--- a/web/studio.js+++ b/web/studio.js@@ -1,5 +1,6 @@import { createErrorPanel, errorText, createErrorReport } from './error_panel.js';import {topDialog} from './dialog_keys.js';+import {cleanOptionalPrompt} from './optional_inputs.js';import { app } from '../../scripts/app.js';import { api } from '../../scripts/api.js';import { openSetup } from './setup.js';@@ -948,7 +949,7 @@ export function openStudio(node, {extendFrom = null} = {}) {// Only serialization briefly locks the editor. Network submission// and all GPU execution leave the next draft fully editable.for (const section of controls.querySelectorAll('.fv-section')) section.inert = true;- const snapshot = singleRunSnapshot(extendSnapshot(structuredClone(await app.graphToPrompt()), node.id, source,+ const snapshot = singleRunSnapshot(extendSnapshot(cleanOptionalPrompt(structuredClone(await app.graphToPrompt())), node.id, source,{multiple: lengthPlan?.count > 1}), node.id, lengthPlan);if (!snapshot) { status.textContent = t('Could not plan this single run. Try again.', '暂时无法计算这次单次生成,请重试。'); return; }const seedIndex = node.widgets.findIndex(w => w.name === 'seed');