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.
Fall back to Torch attention when MLX fails, and settle the Mac memory wording
Bowen Xue23067662491c
diff --git a/freevideo_engine/image_gen/failure.py b/freevideo_engine/image_gen/failure.pyindex 2c90f4b..c7cde20 100644--- a/freevideo_engine/image_gen/failure.py+++ b/freevideo_engine/image_gen/failure.py@@ -21,7 +21,7 @@ STAGES = ('start', 'load', 'text', 'encode', 'denoise', 'decode')KINDS = ('generate', 'edit', 'cast', 'compose', 'download', 'install')MESSAGE_ZH = {'no_memory': '显存不够,最小尺寸也没能生成。关掉其他占用显卡的程序后再试。',- 'small_memory': '这台 Mac 的内存不够生成图片,需要 16 GB 或以上的内存。',+ 'small_memory': '这台 Mac 的内存不足 16 GB,无法生成图片。','busy_video': '视频正在生成,完成后再试。','busy': '已有一张图在生成,请等它完成。','pack_missing': '请先在启动器里下载“图像生成模型”。',diff --git a/freevideo_engine/image_gen/mlx_attention.py b/freevideo_engine/image_gen/mlx_attention.pyindex 3163e11..ad4573d 100644--- a/freevideo_engine/image_gen/mlx_attention.py+++ b/freevideo_engine/image_gen/mlx_attention.py@@ -20,11 +20,22 @@ def available():def routed(fallback, *, min_queries=256):- """``attention`` for image-sized calls; short text segments, where the hand-over costs more, keep ``fallback``."""+ """``attention`` for image-sized calls; short text segments, where the hand-over costs more, keep ``fallback``.++ A call MLX cannot run goes to ``fallback`` instead of failing the picture, and so does+ every later call of the process.+ """+ failed = []+def run(query, key, value, attn_mask=None):- if query.shape[1] < min_queries:+ if failed or query.shape[1] < min_queries:+ return fallback(query, key, value, attn_mask=attn_mask)+ try:+ return attention(query, key, value, attn_mask=attn_mask)+ except Exception as error:+ failed.append(f'{type(error).__name__}: {error}'[:300])return fallback(query, key, value, attn_mask=attn_mask)- return attention(query, key, value, attn_mask=attn_mask)+ run.failed = failedreturn rundiff --git a/web/cast_generate.js b/web/cast_generate.jsindex 0d861dc..396c201 100644--- a/web/cast_generate.js+++ b/web/cast_generate.js@@ -178,7 +178,7 @@ export function mountCastGenerate({container, api, text, t = text, viewURL, onSt});if (state.error) {const key = `${state.error}:${state.report_id || ''}:${state.stage || ''}`;- if (failureKey !== key) { renderImageFailure(note, state, tr, {fetchApi: fetcher}); failureKey = key; }+ if (failureKey !== key) { renderImageFailure(note, {...state, info}, tr, {fetchApi: fetcher}); failureKey = key; }} else {failureKey = null;note.textContent = isMissing ? imagePackUnavailableMessage(info, tr)diff --git a/web/image_generation.js b/web/image_generation.jsindex fb18dcc..bc72090 100644--- a/web/image_generation.js+++ b/web/image_generation.js@@ -169,8 +169,8 @@ export function imageGenError(code, info, t) {invalid_media: ['The reference image cannot be read. Choose another image.', '参考图读不出来,请换一张图。'],reload: ['Image generation was interrupted. Try again.', '图片生成中途被打断,请重试。'],generation_failed: ['Image generation ran into an error. Try again.', '图像生成出错了,请再试一次。'],- small_memory: ['This Mac does not have enough memory to generate pictures. It needs 16 GB or more.',- '这台 Mac 的内存不够生成图片,需要 16 GB 或以上的内存。'],+ small_memory: ['This Mac has less than 16 GB of memory and cannot generate pictures.',+ '这台 Mac 的内存不足 16 GB,无法生成图片。'],};const say = (en, zh) => t(...memoryWords([en, zh], info?.unified));if (code === 'pack_missing') return imagePackUnavailableMessage(info, t);