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.

Failure panel: one layout for submission, queue and browser-extension failures

Bowen Xue2d61420cc72a
diff --git a/scripts/test_freevideo_entry.mjs b/scripts/test_freevideo_entry.mjs
index b3ef8a6..80c2d96 100644
--- a/scripts/test_freevideo_entry.mjs
+++ b/scripts/test_freevideo_entry.mjs
@@ -46,6 +46,7 @@ test('main browser entry registers both views and preserves node hooks', async t
},
secondPassAction: () => new Element('button'),
createErrorPanel: () => ({element: new Element('error'), show() {}, clear() {}}),
+ createErrorReport: () => ({}), adviceFor: () => ({advice: {}}),
errorText: value => String(value),
openStudio: node => opened.push(node),
loraPanel: () => () => {}, loraWarning: () => 'LoRA warning', promptGuide: () => new Element('guide'),
@@ -90,7 +91,7 @@ test('main browser entry registers both views and preserves node hooks', async t
let source = await readFile(new URL('../web/freevideo.js', import.meta.url), 'utf8');
source = source.replace("import { openEditorView } from './editor_loader.js';", 'const openEditorView = (...args) => globalThis.__freevideoEntryTest.openEditorView?.(...args);');
source = source
- .replace("import { createErrorPanel, errorText } from './error_panel.js';", 'const {createErrorPanel,errorText} = globalThis.__freevideoEntryTest;')
+ .replace("import { createErrorPanel, errorText, createErrorReport, adviceFor } from './error_panel.js';", 'const {createErrorPanel,errorText,createErrorReport,adviceFor} = globalThis.__freevideoEntryTest;')
.replace('import { app } from "../../scripts/app.js";', 'const {app} = globalThis.__freevideoEntryTest;')
.replace('import { api } from "../../scripts/api.js";', 'const {api} = globalThis.__freevideoEntryTest;')
.replace("import { openStudio, loraPanel, loraWarning, promptGuide } from \"./studio.js\";", 'const {openStudio,loraPanel,loraWarning,promptGuide} = globalThis.__freevideoEntryTest;')
diff --git a/web/error_panel.js b/web/error_panel.js
index 5326c4b..d3c6735 100644
--- a/web/error_panel.js
+++ b/web/error_panel.js
@@ -410,6 +410,30 @@ function showFailureDialog(report, t) {
// cause drops it: the technical details and the report keep the original text.
const shownCause = text => text.replace(/\s*Use PYTORCH_MPS_HIGH_WATERMARK_RATIO=[\d.]+ to disable upper limit for memory allocations(?: \(may cause system failure\))?\.?/g, '');
+/** The written title and explanation for a report, and whether it gets the packaged layout (not a rejected input). */
+export function adviceFor(report, t) {
+ const advice = report.browser_extension
+ ? browserExtensionAdvice(report.browser_extension, t)
+ : failureAdvice(report.details, t, report.known_error ?? null);
+ if (report.stage === 'submission' && advice.kind === 'unknown') {
+ advice.title = t('The task could not be submitted', '任务提交失败');
+ advice.summary = '';
+ }
+ if (report.stage === 'queue' && advice.kind === 'unknown') {
+ advice.title = t('The queue operation did not complete', '队列操作未完成');
+ advice.summary = t('Check that ComfyUI is still running and connected, then retry.', '请确认 ComfyUI 仍在运行、连接正常后重试。');
+ }
+ // Every failure except a rejected input (which the user fixes in place) has one layout: written title,
+ // Export report / Submit to GitHub, the raw error only inside the technical details.
+ const generated = advice.kind !== 'validation';
+ // A generation that stopped without a known cause is named by the stage it stopped in.
+ if (generated && advice.kind === 'unknown' && report.stage === 'execution') {
+ const stage = failureStage(report);
+ advice.title = stage ? t(`Generation did not finish: ${stage[0]}`, `生成未完成:${stage[1]}`) : t('Generation did not finish', '生成未完成');
+ }
+ return {advice, generated};
+}
+
export function createErrorPanel(t) {
if (!document.getElementById('freevideo-error-style')) {
const style = document.createElement('style'); style.id = 'freevideo-error-style';
@@ -505,25 +529,7 @@ export function createErrorPanel(t) {
head.append(title, actions); element.append(head, explanation, location, cause, action, disclosure, privacy, downloadStatus);
return {element, show(value, popup = true, context = {}) {
const report = createErrorReport(value, context); currentReport = report;
- const advice = report.browser_extension
- ? browserExtensionAdvice(report.browser_extension, t)
- : failureAdvice(report.details, t, report.known_error ?? null);
- if (report.stage === 'submission' && advice.kind === 'unknown') {
- advice.title = t('The task could not be submitted', '任务提交失败');
- advice.summary = t('The task could not be submitted; see the error details below.', '任务未提交成功,可查看下方错误详情。');
- }
- if (report.stage === 'queue' && advice.kind === 'unknown') {
- advice.title = t('The queue operation did not complete', '队列操作未完成');
- advice.summary = t('Check that ComfyUI is still running and connected, then retry.', '请确认 ComfyUI 仍在运行、连接正常后重试。');
- }
- if (advice.kind === 'unknown' && ['submission', 'queue'].includes(report.stage))
- advice.action = t('Select "Copy error" to keep the error details.', '可点“复制错误”保留错误详情。');
- // A generation that stopped without a known cause is named by the stage it stopped in.
- const generated = report.stage === 'execution' && advice.kind !== 'browser-extension';
- if (generated && advice.kind === 'unknown') {
- const stage = failureStage(report);
- advice.title = stage ? t(`Generation did not finish: ${stage[0]}`, `生成未完成:${stage[1]}`) : t('Generation did not finish', '生成未完成');
- }
+ const {advice, generated} = adviceFor(report, t);
title.textContent = advice.title; explanation.textContent = advice.summary; explanation.hidden = !advice.summary; action.textContent = advice.action;
element.querySelector('.fv-extension-steps')?.remove();
if (advice.kind === 'browser-extension') action.after(extensionSteps(advice));
@@ -543,8 +549,7 @@ export function createErrorPanel(t) {
`${node.type || t('Node', '节点')} #${node.id}${error.input ? ' · ' + error.input : ''}: ${error.message}${error.details ? ': ' + error.details : ''}`));
const causeText = shownCause(reasons.length ? reasons.join('\n') : [report.message, report.error_details].filter(Boolean).join('\n'));
const internal = advice.kind === 'unknown' && !['submission', 'queue'].includes(report.stage);
- const causeInDetails = advice.kind === 'browser-extension'
- || advice.kind !== 'validation' && !['submission', 'queue'].includes(report.stage);
+ const causeInDetails = generated;
location.hidden = causeInDetails; detailLocation.hidden = !causeInDetails;
detailLocation.textContent = causeInDetails ? location.textContent : '';
if (causeInDetails) location.textContent = '';
diff --git a/web/failure_issue.js b/web/failure_issue.js
index cd6fdd6..66d3820 100644
--- a/web/failure_issue.js
+++ b/web/failure_issue.js
@@ -11,6 +11,8 @@ const PHASES = [
/** The stage a generation stopped in, as [English, Chinese] words, or null when the report does not say. */
export function failureStage(report) {
+ if (report?.stage === 'submission') return ['submitting the task', '提交任务'];
+ if (report?.stage === 'queue') return ['queue operation', '队列操作'];
const named = [report?.progress?.phase, report?.progress?.stage,
/^Stage: (\S+)/m.exec(String(report?.details || ''))?.[1]].filter(Boolean);
for (const name of named)
diff --git a/web/freevideo.js b/web/freevideo.js
index 6ea9b72..f027031 100644
--- a/web/freevideo.js
+++ b/web/freevideo.js
@@ -1,4 +1,4 @@
-import { createErrorPanel, errorText } from './error_panel.js';
+import { createErrorPanel, errorText, createErrorReport, adviceFor } from './error_panel.js';
import { installNativeErrorGuard } from './native_errors.js';
import { app } from "../../scripts/app.js";
import { api } from "../../scripts/api.js";
@@ -831,7 +831,10 @@ api.addEventListener('freevideo_prewarm', event => {
if (value) app.graph?.getNodeById(value.node)?.freevideoShowPrewarm?.(value);
});
-installNativeErrorGuard({api, app});
+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');
+}});
api.addEventListener('execution_error', event => {
// An upstream loader/media node can stop FreeVideo before its own node is
// entered. Retain that error even while the creative workspace is closed.
diff --git a/web/native_errors.js b/web/native_errors.js
index d60baab..3ff0f2e 100644
--- a/web/native_errors.js
+++ b/web/native_errors.js
@@ -1,7 +1,8 @@
// ComfyUI answers every node error with its own overlay (or dialog) carrying a traceback, local
// paths and a link to ComfyUI's issue tracker. FreeVideo shows its own failure panel instead, so
// for errors that belong to FreeVideo those two are skipped while the event is delivered; the
-// event itself still reaches ComfyUI's stores and every other listener.
+// event itself still reaches ComfyUI's stores and every other listener. The stored record keeps its node
+// but carries our written explanation instead of the traceback.
const EVENT = 'execution_error';
const DIALOG_KEY = 'global-execution-error';
@@ -36,7 +37,7 @@ function stores(app) {
}
/** Skip ComfyUI's own error overlay and dialog for FreeVideo errors. Does nothing when the page lacks them. */
-export function installNativeErrorGuard({api, app, owns = detail => ownsFailure(detail, app?.graph)}) {
+export function installNativeErrorGuard({api, app, owns = detail => ownsFailure(detail, app?.graph), describe = null}) {
if (!api || api.freevideoNativeErrorGuard) return;
api.freevideoNativeErrorGuard = true;
// ComfyUI delivers server messages through dispatchCustomEvent (which calls EventTarget's own dispatchEvent).
@@ -55,6 +56,13 @@ export function installNativeErrorGuard({api, app, owns = detail => ownsFailure(
store[name] = make(store[name]);
};
replace(errors, 'showErrorOverlay', () => () => {});
+ // ComfyUI's side panel and the node's red frame read the recorded error. The frame follows node_id, which
+ // stays; the text becomes our written explanation, without the traceback (it carries local paths).
+ replace(errors, 'recordExecutionError', keep => function (record, ...rest) {
+ let written = '';
+ try { written = describe ? String(describe(record) || '') : ''; } catch { /* keep ComfyUI's text */ }
+ return keep.call(this, written ? {...record, exception_message: written, traceback: [], current_inputs: undefined, current_outputs: undefined} : record, ...rest);
+ });
replace(dialogs, 'showDialog', keep => function (options, ...rest) {
return options?.key === DIALOG_KEY ? undefined : keep.call(this, options, ...rest);
});