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.

Show the whole download on the int8 upgrade card (0.3.1) (#81)

Bowen Xue627b0ffa0662
diff --git a/freevideo_engine/launcher/Main.qml b/freevideo_engine/launcher/Main.qml
index 3d90876..1e81e1d 100644
--- a/freevideo_engine/launcher/Main.qml
+++ b/freevideo_engine/launcher/Main.qml
@@ -79,7 +79,8 @@ ApplicationWindow {
var speed = u.architecture === "ampere" ? t("about twice as fast on this GPU", "在这张显卡上预计快约 2 倍")
: t("about 10–30% faster on this GPU", "在这张显卡上预计快约 10–30%")
if (u.status === "available")
- return t("The int8 model is ", "int8 模型") + speed + t(" and closer to the original quality. It downloads ", ",画质也更接近原版。需要下载约 ") + bytes(u.download_bytes)
+ return (u.resized ? t("Recounted with the other model files this installation still needs. ", "下载量已按实际重新计算,包含这份安装还缺的其他模型文件。") : "")
+ + t("The int8 model is ", "int8 模型") + speed + t(" and closer to the original quality. It downloads ", ",画质也更接近原版。需要下载约 ") + bytes(u.download_bytes)
+ (lora ? t("; your old model stays for the fused LoRAs that int8 cannot merge yet.", ";你有需要合并的 LoRA,int8 暂不支持,旧模型会保留,不释放空间。")
: t(", then removes the old model and frees about ", ",完成后删除旧模型,释放约 ") + bytes(u.release_bytes) + t(".", "。"))
+ t(" You can keep generating while it downloads.", "下载期间可以继续生成。")
diff --git a/freevideo_engine/model_upgrade.py b/freevideo_engine/model_upgrade.py
index bfbff79..9670b46 100644
--- a/freevideo_engine/model_upgrade.py
+++ b/freevideo_engine/model_upgrade.py
@@ -70,17 +70,7 @@ def offer(root):
# For example an int8 download this GPU then failed to run.
return unused(root, catalog, current) or dict(status='unavailable', reason=reason, receipt=stamp)
selection = select(hardware.capability, root, scale_granularity=TARGET)
- directory = Path(selection['directory'])
- rows = files(selection)
- present = 0
- for row in rows:
- path = directory / row['file']
- try:
- if path.is_file() and path.stat().st_size == row['bytes']:
- present += row['bytes']
- except OSError:
- pass
- download = sum(row['bytes'] for row in rows) - present
+ download = setup_download(root, machine, selection)
fused = variant_cleanup.fused_lora_variants(root, catalog, current)
release = 0 if fused else variant_cleanup.retire(root, catalog, current)['bytes']
free = shutil.disk_usage(root).free
@@ -90,6 +80,43 @@ def offer(root):
required_bytes=download + MARGIN, lora_variants=fused, int8_checked=checked)
+def setup_download(root, machine, selection):
+ """Bytes the int8 setup run will download, counted as bootstrap.plan counts them.
+
+ Besides the int8 model, setup installs every model file the installation
+ lacks: for example the latent upscaler and the sampling tables, which an
+ engine update never installs, so older installations fetch them here too.
+ """
+ from .bootstrap import PACKAGE, model_target
+ from .install_tuning import required_models
+ from .prepared_model import files
+ from .sampling_assets import install_files
+ rows = required_models(json.loads((PACKAGE / 'model_files.json').read_text(encoding='utf-8')), selection)
+ rows += files(selection)
+ prior = {}
+ if machine.get('setup_run'):
+ try:
+ prior = json.loads((Path(machine['setup_run']) / 'plan.json').read_text(encoding='utf-8'))
+ except (OSError, ValueError):
+ prior = {}
+ # The same choice setup makes without --sampling-caches: the previous
+ # setup's, otherwise none for an installation that is already ready.
+ everything = prior['sampling_caches'] if isinstance(prior.get('sampling_caches'), bool) else not machine.get('ready')
+ rows += install_files(bool(everything))
+ model_dir = Path(machine.get('model_root') or root / 'models' / 'vdn').expanduser().resolve()
+ encoder_dir = Path(machine.get('encoder_model_root') or prior.get('encoder_dir')
+ or root / 'models' / 'encoder').expanduser().resolve()
+ present = 0
+ for row in rows:
+ try:
+ path = model_target(row, model_dir, encoder_dir, selection['directory'])
+ if path.is_file() and path.stat().st_size == row['bytes']:
+ present += row['bytes']
+ except (OSError, ValueError):
+ pass
+ return sum(row['bytes'] for row in rows) - present
+
+
def kernel_receipt(root):
"""Identifies the GPU check receipt as written; it changes when the checks run again."""
try:
@@ -203,9 +230,15 @@ class ModelUpgrade:
if value.get('prepared_format') != TARGET or not value.get('prepared_model'):
raise ValueError('The setup plan does not move this installation to int8.')
# Nothing beyond what the user agreed to: the approval receipt
- # makes the run refuse a larger download or a changed model.
- if value['model_download_bytes'] > offered['download_bytes'] + 64 * (1 << 20):
- raise ValueError('The download is larger than shown; check again.')
+ # makes the run refuse a larger download or a changed model. A
+ # larger plan is shown on the card and confirmed again first.
+ planned_bytes = value['model_download_bytes']
+ if planned_bytes > offered['download_bytes'] + 64 * (1 << 20):
+ free = shutil.disk_usage(root).free
+ self.state = dict(offered, status='available' if free >= planned_bytes + MARGIN else 'low-disk',
+ download_bytes=planned_bytes, required_bytes=planned_bytes + MARGIN,
+ free_bytes=free, resized=True)
+ return
receipt = root / 'launcher' / 'model-upgrade-plan.json'
save(receipt, value)
fetched = self._run(runner, events, 'setup', root,
diff --git a/freevideo_engine/release_notes.json b/freevideo_engine/release_notes.json
index 9a4bdd9..4a1ba74 100644
--- a/freevideo_engine/release_notes.json
+++ b/freevideo_engine/release_notes.json
@@ -1,22 +1,16 @@
{
"schema": 1,
- "product_version": "0.3.0",
+ "product_version": "0.3.1",
"en": {
- "summary": "A faster int8 model for GeForce and RTX 30-series cards with a one-click upgrade, and optional prompt enhancement.",
+ "summary": "Fixes the int8 upgrade on older installations.",
"changes": [
- "GeForce RTX 40/50-series and RTX 30-series cards use a faster int8 model, closer to the original quality.",
- "Optional prompt enhancement in the creation panel: a local model rewrites your prompt for MiniMax H3, and you choose the original or the enhanced version. It is off by default and asks before downloading its model (8.3 GiB).",
- "Faster generation on 8 GB cards.",
- "Failed installations and updates can be retried in place, and download caches can be cleaned from Settings."
+ "Older installations could not upgrade to the int8 model: the upgrade stopped with \"The download is larger than shown\". The size shown now includes every file the upgrade downloads, such as the sampling tables, so the upgrade goes through."
]
},
"zh": {
- "summary": "GeForce 和 RTX 30 系显卡改用更快的 int8 模型,老用户一键升级;新增可选的提示词增强。",
+ "summary": "修复较早安装的用户无法升级到 int8 模型的问题。",
"changes": [
- "GeForce RTX 40/50 系和 RTX 30 系显卡换用更快的 int8 模型,画质也更接近原版。",
- "创作面板新增可选的提示词增强:用本地模型把提示词改写成适合 MiniMax H3 的写法,原文和改写版可任选其一生成。默认关闭,首次使用会先询问再下载模型(8.3 GiB)。",
- "8 GB 显卡生成更快。",
- "安装或更新失败可直接重试,设置中可以清理下载缓存。"
+ "较早安装的用户升级到 int8 模型时,会停在「下载比显示的大」。现在显示的下载量包含升级要下载的全部文件(例如采样表),可以正常完成升级。"
]
}
}