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.
Carry the host-memory marker to every image failure card with the final wording
Bowen Xuefa2ddbaea25a
diff --git a/freevideo_engine/agent/errors.py b/freevideo_engine/agent/errors.pyindex 59974fa..0dbad56 100644--- a/freevideo_engine/agent/errors.py+++ b/freevideo_engine/agent/errors.py@@ -408,7 +408,7 @@ def with_reason(error):def build(code, *, details=None, request=None, validation=False, message=None, next_action=None,action_required=True, retry_after_seconds=None, owner=None, kind=None, stage='request', resumable=True,- report_id=None):+ report_id=None, memory=None):code = code if code in ERRORS else 'internal_error'_, retryable, default_message, _ = ERRORS[code]action = recovery(code, kind=kind, stage=stage, resumable=resumable)@@ -422,6 +422,8 @@ def build(code, *, details=None, request=None, validation=False, message=None, ndocs='/freevideo/agent/v1/guide#errors')if kind == 'image':result.update(image_failure(code, report_id))+ if code == 'no_memory' and memory == 'host':+ result['memory'] = 'host'if action_required:result['next'] = next_action if validation and next_action else actionif code == 'busy':diff --git a/freevideo_engine/agent/jobs.py b/freevideo_engine/agent/jobs.pyindex b1930b2..9f645f0 100644--- a/freevideo_engine/agent/jobs.py+++ b/freevideo_engine/agent/jobs.py@@ -687,7 +687,7 @@ class Jobs:error = errors.build(code, details=error.get('details'),request=row.get('request_id'), action_required=code != 'cancelled',kind=row['kind'], stage='terminal', resumable=not row['spec'].get('refine_from'),- report_id=error.get('report_id'))+ report_id=error.get('report_id'), memory=error.get('memory'))if row['kind'] == 'image':reason_zh, reason_en = error['error_zh'], error['error_en']if error is not None:@@ -1979,7 +1979,7 @@ class Jobs:code = failure.get('code') if isinstance(failure, dict) else failurecode = code or 'generation_failed'if not self.wait_image(row, code):- self.finish(row, 'failed', error=dict(code=code, report_id=state.get('report_id')))+ self.finish(row, 'failed', error=dict(code=code, report_id=state.get('report_id'), memory=state.get('memory')))# Local VLM -----------------------------------------------------------------------------------------def start_vlm(self, row):diff --git a/freevideo_engine/image_gen/failure.py b/freevideo_engine/image_gen/failure.pyindex 9101364..57af20d 100644--- a/freevideo_engine/image_gen/failure.py+++ b/freevideo_engine/image_gen/failure.py@@ -56,7 +56,7 @@ _MPS_MEMORY = re.compile(r'MPS backend out of memory', re.I)_LIMIT = 16 * 1024# On a Mac the GPU's memory is the machine's: the same failure, in its words.UNIFIED_MESSAGE_ZH = {'no_memory': '内存不够,最小尺寸也没能生成。关掉其他程序后再试。'}-HOST_MESSAGE_ZH = '电脑内存或虚拟内存不够,模型没能载入。关掉其他程序,或调大系统的虚拟内存后再试。'+HOST_MESSAGE_ZH = '虚拟内存不足,无法载入图像模型。请关闭其他程序,或在系统设置中调大虚拟内存,然后重试。'def host_memory_shortage(error):diff --git a/web/autopilot_chat.js b/web/autopilot_chat.jsindex 4686183..e6a5fbd 100644--- a/web/autopilot_chat.js+++ b/web/autopilot_chat.js@@ -1007,7 +1007,7 @@ export function agentChat(t, api, {open, edit, shown = () => true, changed = ()// A picture takes seconds: the same quiet line while it is made, then the picture.const card = VIDEOS.includes(job.kind || 'generate') || (['image', 'production', 'cast'].includes(job.kind) && !WORKING.includes(job.status));const next = card ? jobMode(job) + (jobMode(job) === 'done' ? `:${job.play}:${job.thumbnail}:${job.work}`- : jobMode(job) === 'failed' && job.kind === 'image' ? `:${job.error?.code}:${job.error?.report_id}` : '')+ : jobMode(job) === 'failed' && job.kind === 'image' ? `:${job.error?.code}:${job.error?.report_id}:${job.error?.memory || ''}` : ''): WORKING.includes(job.status) ? 'quiet' : 'none';if (next !== mode) {mode = next; item.dataset.job = job.id; item.dataset.mode = next.split(':')[0]; item.hidden = next === 'none';@@ -1024,7 +1024,8 @@ export function agentChat(t, api, {open, edit, shown = () => true, changed = ()else if (next.startsWith('failed') && job.kind === 'image') {// Picture failures name their step with the picture's own report card.const host = el('div');- renderImageFailure(host, {error: job.error?.code || 'generation_failed', report_id: job.error?.report_id}, t,+ renderImageFailure(host, {error: job.error?.code || 'generation_failed', report_id: job.error?.report_id,+ memory: job.error?.memory}, t,{productVersion, fetchApi: (path, options) => api.fetchApi(path, options)});item.replaceChildren(host);if (retry) item.append(press('fv-chat-retry', t('Retry', '重试'), retry));diff --git a/web/cast_generate.js b/web/cast_generate.jsindex 396c201..cc2543f 100644--- a/web/cast_generate.js+++ b/web/cast_generate.js@@ -15,7 +15,7 @@ const VIEW_TITLES = Object.freeze({function el(tag, cls, text) { const e = document.createElement(tag); if (cls) e.className = cls; if (text != null) e.textContent = text; return e; }const failureOf = error => ({error: error?.code || 'generation_failed', report_id: error?.report_id || null,- stage: error?.stage || '', fitted: error?.fitted || null});+ stage: error?.stage || '', fitted: error?.fitted || null, memory: error?.memory || ''});const randomSeed = () => crypto.getRandomValues(new Uint32Array(1))[0] >>> 1;// The five pictures of one description. No DOM: the page below draws its state.@@ -32,7 +32,7 @@ export function createCastGenerator({client, onChange = () => {}, schedule = setconst view = plan[index], front = state.pictures[0].file;const row = await client.generate({prompt: view.prompt, width: view.width, height: view.height, seed,images: view.from_front ? [front] : [], ...(view.view === 'back' ? {cast_view: 'back'} : {})});- if (!row.job) throw Object.assign(new Error(row.error || 'generation_failed'), {code: row.error, report_id: row.report_id});+ if (!row.job) throw Object.assign(new Error(row.error || 'generation_failed'), {code: row.error, report_id: row.report_id, memory: row.memory});if (!alive()) { await cancelJob(row.job); return null; }job = row.job;for (;;) {@@ -42,7 +42,7 @@ export function createCastGenerator({client, onChange = () => {}, schedule = setif (!alive()) return null;if (status.state === 'error') {throw Object.assign(new Error(status.error), {code: status.error, report_id: status.report_id,- stage: status.stage, fitted: status.fitted});+ stage: status.stage, fitted: status.fitted, memory: status.memory});}if (status.state === 'done') {if (!status.file) throw new Error('generation_failed');@@ -177,7 +177,7 @@ export function mountCastGenerate({container, api, text, t = text, viewURL, onStcell.fill.style.width = (active ? row.fraction * 100 : 0) + '%';});if (state.error) {- const key = `${state.error}:${state.report_id || ''}:${state.stage || ''}`;+ const key = `${state.error}:${state.report_id || ''}:${state.stage || ''}:${state.memory || ''}`;if (failureKey !== key) { renderImageFailure(note, {...state, info}, tr, {fetchApi: fetcher}); failureKey = key; }} else {failureKey = null;diff --git a/web/image_generation.js b/web/image_generation.jsindex 8bba343..74f174c 100644--- a/web/image_generation.js+++ b/web/image_generation.js@@ -49,7 +49,7 @@ export function blankCanvasSize(ratio, sizes = null, tier = 'standard') {}const failure = (code, info = {}) => Object.assign(new Error(code || 'generation_failed'), {code: code || 'generation_failed', report_id: info.report_id || null, stage: info.stage || '',- fitted: info.fitted || null,+ fitted: info.fitted || null, memory: info.memory || '',});export function createImageGenClient(fetchImpl = globalThis.fetch.bind(globalThis)) {@@ -177,8 +177,8 @@ export function imageGenError(code, info, t) {const say = (en, zh) => t(...memoryWords([en, zh], info?.unified));if (code === 'pack_missing') return imagePackUnavailableMessage(info, t);if (code === 'no_memory' && info?.memory === 'host')- return t('Not enough system memory or virtual memory to load the model. Close other programs, or enlarge the system virtual memory, then try again.',- '电脑内存或虚拟内存不够,模型没能载入。关掉其他程序,或调大系统的虚拟内存后再试。');+ return t('Not enough virtual memory to load the image model. Close other apps, or increase virtual memory in system settings, then try again.',+ '虚拟内存不足,无法载入图像模型。请关闭其他程序,或在系统设置中调大虚拟内存,然后重试。');if (code === 'no_memory') {// Where it ran out decides what helps: the reference pictures are read at a fixed size,// so a smaller canvas does not change that stage.@@ -410,9 +410,9 @@ export function createImageGenSession({client, prepare, apply, onChange = () =>let state = {info: null, checking: false, running: false, job: null, fraction: 0, stage: '', error: '', report_id: null,waiting: '', fitted: null};const emit = patch => { state = {...state, ...patch}; if (!disposed) onChange(state); };- const failed = error => error.code === 'cancelled' ? {error: '', report_id: null, stage: ''}+ const failed = error => error.code === 'cancelled' ? {error: '', report_id: null, stage: '', memory: ''}: {error: error.code || 'generation_failed', report_id: error.report_id || null, stage: error.stage || '',- ...(error.fitted ? {fitted: error.fitted} : {})};+ memory: error.memory || '', ...(error.fitted ? {fitted: error.fitted} : {})};const cancelJob = job => Promise.resolve().then(() => client.cancel(job)).catch(() => {});const forget = () => { try { store?.clear(); } catch { /* the job is only not resumed after a reload */ } };function scheduleInfo() {@@ -469,7 +469,7 @@ export function createImageGenSession({client, prepare, apply, onChange = () =>if (state.running || disposed || !request.prompt.trim() || !state.info?.installed) return;const current = ++epoch;// A picture that is edited sends its reference images first; there is no job to report on yet.- emit({running: true, job: null, fraction: 0, stage: request.mode === 'edit' ? 'upload' : '', error: '', report_id: null, waiting: '', fitted: null});+ emit({running: true, job: null, fraction: 0, stage: request.mode === 'edit' ? 'upload' : '', error: '', report_id: null, memory: '', waiting: '', fitted: null});const alive = () => current === epoch && !disposed;try {const {context, images = [], mask} = await prepare(request, alive);@@ -492,7 +492,7 @@ export function createImageGenSession({client, prepare, apply, onChange = () =>function resume({job, context, withImages = false}) {if (state.running || disposed || !job || !context) return false;const current = ++epoch;- emit({running: true, job, fraction: 0, stage: '', error: '', report_id: null, waiting: '', fitted: null});+ emit({running: true, job, fraction: 0, stage: '', error: '', report_id: null, memory: '', waiting: '', fitted: null});track(current, job, context, withImages, true);return true;}@@ -500,16 +500,16 @@ export function createImageGenSession({client, prepare, apply, onChange = () =>++epoch; unschedule(timer); timer = null;const job = state.job;forget();- emit({running: false, job: null, stage: '', fraction: 0, error: '', report_id: null, waiting: '', fitted: null});+ emit({running: false, job: null, stage: '', fraction: 0, error: '', report_id: null, memory: '', waiting: '', fitted: null});return job ? cancelJob(job) : Promise.resolve();}// Start or pause the download of the image models; the reply is the new state, then polling follows it.async function pack(action) {- try { const info = await (action === 'cancel' ? client.packCancel() : client.packInstall()); if (!disposed) emit({info, error: '', report_id: null}); }+ try { const info = await (action === 'cancel' ? client.packCancel() : client.packInstall()); if (!disposed) emit({info, error: '', report_id: null, memory: ''}); }catch (error) { if (!disposed) emit(failed(error)); }finally { if (!disposed) scheduleInfo(); }}- return {check, start, resume, cancel, pack, clearError: () => emit({error: '', report_id: null}), state: () => state,+ return {check, start, resume, cancel, pack, clearError: () => emit({error: '', report_id: null, memory: ''}), state: () => state,dispose() { disposed = true; unschedule(infoTimer); infoTimer = null; return cancel(); }};}@@ -790,7 +790,7 @@ export function createImageGeneration({client, renderer, t, getDoc, getSelectionaction.hidden = !!missing && !pack;const percent = Math.floor(state.fraction * 100) + '%';if (state.error && !promptRequired) {- const failureKey = `${state.error}:${state.report_id || ''}:${state.stage || ''}`;+ const failureKey = `${state.error}:${state.report_id || ''}:${state.stage || ''}:${state.memory || ''}`;if (mounted.failureKey !== failureKey) {renderImageFailure(note, state, t, {productVersion, fetchApi});mounted.failureKey = failureKey;