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.

Restart downloads that cannot resume and explain a disabled Install / repair (0.3.8) (#99)

Bowen Xueac3e6f54a1dd
diff --git a/freevideo_engine/comfy_setup.py b/freevideo_engine/comfy_setup.py
index a4dd6cf..c439874 100644
--- a/freevideo_engine/comfy_setup.py
+++ b/freevideo_engine/comfy_setup.py
@@ -245,7 +245,9 @@ class Setup:
self.logs.mkdir(parents=True, exist_ok=True)
manifest = self.logs / ('libraries-' + uuid.uuid4().hex + '.json')
save(manifest, dict(version=1, roots=libraries))
- arguments = ['setup', '--reuse-models-manifest', str(manifest)]
+ # A download that cannot resume (for example a Xet partial) starts again
+ # instead of pausing every retry; the old partial is set aside.
+ arguments = ['setup', '--reuse-models-manifest', str(manifest), '--allow-model-restart']
frontend = value.get('frontend')
if frontend:
arguments += ['--frontend-root', str(Path(frontend['root']).expanduser().resolve())]
diff --git a/freevideo_engine/network.py b/freevideo_engine/network.py
index cf3f06b..767877b 100644
--- a/freevideo_engine/network.py
+++ b/freevideo_engine/network.py
@@ -662,8 +662,8 @@ def pause_download(network, name, path, retained, reason, *, details=None):
details['file'], details['observed_bytes'], details['allowed_bytes'], details['expected_model_bytes'])
raise RuntimeError('Model download paused: %s (%s). Temporary files retained. '
'%s'
- 'Retry setup to continue the same source. If resume is unavailable, enable '
- '"Allow restarting incomplete downloads" or --allow-model-restart to permit a fresh download.' %
+ 'Retry setup to continue the same source. If resume is unavailable, run setup '
+ 'with --allow-model-restart to download the file again from the start.' %
(Path(path).name, reason, explanation))
diff --git a/freevideo_engine/provision.py b/freevideo_engine/provision.py
index bc83f04..1ec1b9c 100644
--- a/freevideo_engine/provision.py
+++ b/freevideo_engine/provision.py
@@ -354,11 +354,14 @@ def models(plan):
download_missing()
if verification is not None:
verification.result()
- except BaseException:
+ except BaseException as error:
stopped.set()
model_progress.update(phase='paused')
- if failures:
- raise failures[0]
+ # The first worker to fail stops the other, which then raises a
+ # cancellation. Report the failure that stopped preparation.
+ cause = next((f for f in failures if not isinstance(f, CancelledError)), None)
+ if cause is not None and isinstance(error, CancelledError):
+ raise cause
raise
# JSON is valid YAML and safely represents spaces and punctuation in paths.
save(root / 'encoder-paths.yaml', {'freevideo': {'base_path': str(encoder_dir), 'text_encoders': 'text_encoders/'}})
diff --git a/freevideo_engine/release_notes.json b/freevideo_engine/release_notes.json
index 8406bb7..d35a94d 100644
--- a/freevideo_engine/release_notes.json
+++ b/freevideo_engine/release_notes.json
@@ -1,18 +1,20 @@
{
"schema": 1,
- "product_version": "0.3.7",
+ "product_version": "0.3.8",
"en": {
- "summary": "Installation no longer stops with \"Select at most 64 model libraries\" when ComfyUI has many model folders.",
+ "summary": "Downloads that cannot resume now start again by themselves, and the ComfyUI setup panel explains why Install / repair is unavailable.",
"changes": [
- "Fixed installation stopping with \"Select at most 64 model libraries\" when ComfyUI has more than ten model folders. Each folder now counts once, and when more than 64 are found, the first 64 are used and installation continues.",
- "A saved model folder that has since been deleted, such as a removed offline package folder, is skipped instead of blocking installation or offline import."
+ "When an interrupted model download cannot be resumed, installation now downloads that file again from the start instead of stopping at every retry. The incomplete copy is kept aside.",
+ "If model preparation stops, the message now names the file and the reason instead of a generic \"preparation stopped\".",
+ "In the ComfyUI setup panel, a short note under the buttons explains why Install / repair is unavailable: run Detect & review, tick the agreement, or resolve the problems shown in the plan. Changing a setting clears the outdated plan."
]
},
"zh": {
- "summary": "修复 ComfyUI 模型目录较多时,安装提示「Select at most 64 model libraries」的问题。",
+ "summary": "无法续传的下载会自动从头重新下载;ComfyUI 内的安装面板会说明「安装/修复」暂不可用的原因。",
"changes": [
- "修复 ComfyUI 模型目录超过十个时,安装停在「Select at most 64 model libraries」的问题。同一个目录现在只计一次;找到的目录超过 64 个时使用前 64 个,安装照常进行。",
- "已保存的模型文件夹如果已被删除(例如删除了离线包目录),会自动跳过,不再阻止安装或离线导入。"
+ "模型下载中断且无法续传时,安装会自动从头重新下载该文件,不再每次重试都停下;未完成的文件会另行保留。",
+ "模型准备停止时,提示会写明具体的文件和原因,而不是笼统的「准备已停止」。",
+ "ComfyUI 内的安装面板会在按钮下方说明「安装/修复」暂不可用的原因:需要先「检测并预览」、勾选同意,或先解决计划中标红的问题;修改设置后会清除过期的计划。"
]
}
}
diff --git a/web/setup.css b/web/setup.css
index 48de74f..1a3c039 100644
--- a/web/setup.css
+++ b/web/setup.css
@@ -58,6 +58,7 @@
.fv-setup a{color:var(--fv-accent);text-underline-offset:3px}
.fv-setup .fv-actions{display:flex;align-items:center;gap:8px;flex-wrap:wrap;margin-top:16px}
.fv-setup .fv-actions.fv-end{justify-content:flex-end}
+.fv-setup .fv-setup-why{margin:8px 0 0;font-size:12.5px;line-height:1.5;text-align:center;text-wrap:balance}
/* Text, plans and measurements. */
.fv-setup p{margin:8px 0}
diff --git a/web/setup.js b/web/setup.js
index 8aa74dd..56c2c77 100644
--- a/web/setup.js
+++ b/web/setup.js
@@ -129,11 +129,14 @@ export async function openSetup() {
const install = node("button", t("Install / repair", "安装/修复")); install.disabled = true;
const cancel = node("button", t("Stop setup", "停止安装")); cancel.disabled = true;
actions.append(inspect, use, install, cancel); installation.append(actions);
+ // Why Install / repair is unavailable, so it never looks like a broken button.
+ const blocked = note(""); blocked.classList.add("fv-setup-why"); blocked.setAttribute("aria-live", "polite"); blocked.hidden = true;
+ installation.append(blocked);
dialog.append(heading, installation, downloads, advanced);
const motions = [...dialog.querySelectorAll('details')].map(animateDetails);
dialog.addEventListener('cancel', e => { e.preventDefault(); closeDialog(dialog); });
document.body.append(dialog); dialog.showModal();
- let token, planId, busy = false, probeBusy = false, pollTimer, lastPlanId;
+ let token, planId, busy = false, probeBusy = false, pollTimer, lastPlanId, planErrors = false, planStale = false, ready = false;
const fail = error => { installation.open = true; state.textContent = error.message; state.className = "fv-failure"; state.scrollIntoView({block:'nearest'}); };
const request = async (action, value) => {
const response = await api.fetchApi("/freevideo/setup" + (action ? "/" + action : root.value ? '?root='+encodeURIComponent(root.value) : ""), action ? {
@@ -233,19 +236,28 @@ export async function openSetup() {
const controls = () => {
for (const e of [root, extra, copy, samplingCaches, inspect, use, hfToken, applyToken, clearToken]) e.disabled = busy;
cancel.disabled = !busy; install.disabled = busy || !planId || !accept.checked; accept.disabled = busy; inspect.classList.toggle("fv-primary", !planId); install.classList.toggle("fv-primary", Boolean(planId));
+ const why = busy || (ready && !planId) ? "" : planStale ? t("Settings changed. Click Detect & review again to update the plan.", "设置已更改,请重新点击「检测并预览」更新安装计划。")
+ : planErrors ? t("The plan has problems shown in red above. Please resolve them, then click Detect & review again.", "安装计划中有标红的问题,请解决后重新点击「检测并预览」。")
+ : !planId ? t("Click Detect & review first. Install / repair becomes available once the plan is ready.", "请先点击「检测并预览」,生成安装计划后即可安装。")
+ : !accept.checked ? t("Tick the agreement above to enable Install / repair.", "勾选上方的同意选项后,即可点击「安装/修复」。") : "";
+ blocked.textContent = why; blocked.hidden = !why;
+ };
+ // A changed setting makes a shown plan outdated: clear it rather than leave it beside a disabled button.
+ const invalidate = (stale = false) => {
+ if (stale && lastPlanId && !busy) { planStale = true; planErrors = false; plan.replaceChildren(); if (!state.classList.contains("fv-failure")) state.textContent = ""; }
+ planId = undefined; accept.checked = false; acceptLabel.hidden = true; controls();
};
- const invalidate = () => { planId = undefined; accept.checked = false; acceptLabel.hidden = true; controls(); };
async function setToken(value) {
applyToken.disabled = clearToken.disabled = true;
try {
await request('network-token', {hf_token:value}); hfToken.value = '';
- invalidate(); await poll();
+ invalidate(true); await poll();
} catch(error) { fail(error); }
finally { controls(); }
}
applyToken.onclick = () => setToken(hfToken.value);
clearToken.onclick = () => setToken('');
- for (const e of [root, extra, copy, samplingCaches]) e.oninput = invalidate;
+ for (const e of [root, extra, copy, samplingCaches]) e.oninput = () => invalidate(true);
accept.onchange = controls;
function showPlan(value) {
plan.replaceChildren();
@@ -269,16 +281,18 @@ export async function openSetup() {
if (value.errors?.length) { const e = node("p", value.errors.join("\n")); e.className = "fv-failure"; plan.append(e); }
}
function render(task) {
- busy = Boolean(task.busy);
+ busy = Boolean(task.busy); ready = Boolean(task.ready) || ready && task.status !== 'failed';
inputs.hidden = busy; plan.hidden = busy;
if (task.plan_id && task.plan_id !== lastPlanId) {
- lastPlanId = task.plan_id; planId = task.plan?.errors?.length ? undefined : task.plan_id;
+ lastPlanId = task.plan_id; planErrors = Boolean(task.plan?.errors?.length); planStale = false;
+ planId = planErrors ? undefined : task.plan_id;
accept.checked = false; acceptLabel.hidden = !planId; showPlan(task.plan);
+ if (planErrors) plan.querySelector('.fv-failure')?.scrollIntoView({block: 'nearest'});
}
acceptLabel.hidden = busy || !planId;
const p = task.progress || {};
state.className = task.status === "failed" ? "fv-failure" : task.ready ? "fv-ready" : "";
- state.textContent = task.error || (task.ready ? t("Ready. Generate with your existing workflow.", "准备就绪,可使用现有工作流生成。") : busy ? p.label || t("Checking configuration and local models…", "正在检查配置和本地模型…") : task.status === "complete" && task.action === "plan" ? t("Review the plan, then install.", "请确认计划后安装。") : task.status === "cancelled" ? t("Stopped. Files retained for resuming.", "已停止,文件保留,可继续安装。") : "");
+ state.textContent = task.error || (task.ready ? t("Ready. Generate with your existing workflow.", "准备就绪,可使用现有工作流生成。") : busy ? p.label || t("Checking configuration and local models…", "正在检查配置和本地模型…") : task.status === "complete" && task.action === "plan" ? (planId ? t("Review the plan, then install.", "请确认计划后安装。") : "") : task.status === "cancelled" ? t("Stopped. Files retained for resuming.", "已停止,文件保留,可继续安装。") : "");
const phases = task.phase_progress || {}, valid = Number.isFinite(p.total) && p.total > 0 && Number.isFinite(p.done) && p.done >= 0 && p.done <= p.total;
overall.hidden = !busy;
overallBar.max = phases.total > 0 ? phases.total : 1; overallBar.value = phases.done || 0;
@@ -308,7 +322,7 @@ export async function openSetup() {
catch (error) { fail(error); }
};
use.onclick = async () => {
- try { const result = await request("use", {root: root.value}); state.textContent = result.ready ? t("Existing engine connected. Ready to generate.", "已连接现有引擎,可以生成。") : result.detail; state.className = "fv-ready"; invalidate(); }
+ try { const result = await request("use", {root: root.value}); ready = Boolean(result.ready); state.textContent = result.ready ? t("Existing engine connected. Ready to generate.", "已连接现有引擎,可以生成。") : result.detail; state.className = "fv-ready"; invalidate(); }
catch (error) { fail(error); }
};
cancel.onclick = async () => { try { render(await request("cancel")); poll(); } catch (error) { fail(error); } };
@@ -322,6 +336,7 @@ export async function openSetup() {
// New installations prepare every quality level; a ready one adds them only when chosen.
samplingCaches.checked = !info.discovery.ready;
paths.textContent = info.discovery.libraries.join("\n") || t("No model libraries found; add a folder above.", "没有发现模型目录,可在上方添加。");
+ ready = Boolean(info.discovery.ready);
render(info.task);
installation.open = !info.discovery.ready || busy;
if (info.discovery.ready && !busy) state.textContent = t("Ready to generate.", "已就绪,可以开始生成。");