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.
Use the Git Linux distributions ship, download models after an offline runtime import, show every skipped version's notes (0.3.12) (#115)
Bowen Xuedf149bf203e7
diff --git a/freevideo_engine/bootstrap.py b/freevideo_engine/bootstrap.pyindex a58fc26..7452e8f 100644--- a/freevideo_engine/bootstrap.py+++ b/freevideo_engine/bootstrap.py@@ -209,11 +209,20 @@ def inventory(gpu=None):'git_found': shutil.which('git')}+# Windows reuses a detected Git from 2.35, the oldest tested there, and+# otherwise installs its own MinGit.+WINDOWS_MIN_GIT = (2, 35)+++def git_floor(system=None):+ return WINDOWS_MIN_GIT if (system or platform.system()) == 'Windows' else network.MIN_GIT++def usable_git(path=None, env=None):"""The Git on PATH when it is new enough for clone(); None otherwise."""executable = shutil.which('git', path=path)version = network.git_version(executable, env) if executable else None- return executable if version and version >= network.MIN_GIT else None+ return executable if version and version >= git_floor() else Nonedef existing_parent(path):@@ -320,7 +329,8 @@ def plan(args, *, local_progress=None):if compatibility['error']:errors.append(compatibility['error'])snapshot['cuda_compatibility'] = compatibility- for name in () if windows_target else ('git', 'compiler'):+ # A missing or too old Git is replaced by FreeVideo's own.+ for name in () if windows_target else ('compiler',):if not snapshot.get(name):errors.append('Missing %s. Run ./setup.sh interactively to install basic tools, then review the engine plan.' % name)curl_env = dict(os.environ, FREEVIDEO_HOME=str(root))@@ -508,9 +518,10 @@ def plan(args, *, local_progress=None):'build': build,'kernel_install': 'Pinned Windows Triton / Sage2 wheels; actual kernels checked before readiness' if windows_target else 'Local Sage2 source build / ABI-keyed wheel cache','git_install': ('Reuse detected Git' if snapshot.get('git') else- 'Install verified portable MinGit locally after confirmation' + (- ' (the detected Git is older than %d.%d)' % network.MIN_GIT if snapshot.get('git_found') else '')- if windows_target else 'Git %d.%d or newer required' % network.MIN_GIT),+ ('Install verified portable MinGit locally' if windows_target else+ 'Install verified portable Git from conda-forge locally') + (+ ' (the detected Git is older than %d.%d)' % git_floor(hardware.system)+ if snapshot.get('git_found') else '')),'wheel_cache': str(Path(getattr(args, 'wheel_cache', None) or saved.get('wheel_cache') or root / 'wheels').expanduser().resolve()),'rebuild_sage': getattr(args, 'rebuild_sage', False),'model_download_bytes': sum(r['bytes'] for r in files) - present - (local_reuse or {}).get('reused_bytes', 0),@@ -785,6 +796,8 @@ def setup_task(label):'sage2-wheel-install': ('Install SageAttention 2', 'Install the prepared GPU acceleration package'),'sage2-windows-wheel-install': ('Install SageAttention 2', 'Install the verified Windows acceleration package'),'windows-runtime-check': ('Check GPU runtime', 'Verify CUDA and the Windows runtime libraries'),+ 'portable-git': ('Prepare Git', 'Install the verified Git packages'),+ 'portable-git-check': ('Prepare Git', 'Check the installed Git'),}title, detail = tasks.get(key, ('Prepare dependencies', 'Prepare verified source files'))for prefix, name in (('h3-text-encoder-', 'text encoder'), ('SageAttention-', 'SageAttention 2')):@@ -1128,7 +1141,7 @@ class Installer:def task(name, run, after=(), writes=()):tasks[name] = dict(run=run, after=tuple(after), writes=tuple(writes))task('python', lambda: self.python_install(uv))- task('git', self.install_git_windows if self.system == 'Windows' else lambda: None)+ task('git', self.install_git)# This entry imports only stdlib engine code from the bootstrap Python.# It can fetch the exact source trees while large Torch wheels download.task('vdn-source', lambda: self.command('vdn-source', [sys.executable, '-c',@@ -1197,12 +1210,13 @@ class Installer:'assert torch.cuda.is_available(), "CUDA unavailable; check NVIDIA driver and Windows DLL errors above"; ''print("Windows runtime imports passed; GPU kernel probes follow")']), ('runtime',), ('environment:' + name,))overlap = (self.plan.get('model_transfer') or {}).get('overlap_build', True)- task('sage', lambda: self.install_sage(uv, python), ('runtime',) if overlap else ('runtime', 'models'),+ # Linux builds SageAttention from a Git checkout.+ task('sage', lambda: self.install_sage(uv, python), ('runtime', 'git') if overlap else ('runtime', 'git', 'models'),('environment:' + name,))if self.plan.get('disk_mode') == 'extreme':# Finish all environments before models occupy most of the disk.# In particular retain the uv cache until ComfyUI has reused it.- tasks['sage']['after'] = ('runtime',)+ tasks['sage']['after'] = ('runtime', 'git')prerequisites = tuple(key for key in tasks if key != 'models')frontend = self.plan.get('frontend') or {}if frontend.get('separate'):@@ -1349,6 +1363,82 @@ class Installer:save(self.run_dir / 'sage-wheel.json', record)return manifest+ def install_git(self):+ if self.system == 'Windows':+ self.install_git_windows()+ elif self.system == 'Linux' and not usable_git(self.env['PATH'], self.env):+ self.install_git_linux()++ def install_git_linux(self):+ """Git from conda-forge, pinned by package hashes, when the system has none new enough."""+ spec = json.loads((PACKAGE / 'git_linux.json').read_text(encoding='utf-8'))+ prefix = self.root / 'tools' / ('git-' + spec['version'])+ executable = prefix / 'bin' / 'git'+ receipt, content = prefix / '.freevideo-git.json', {k: spec[k] for k in ('version', 'packages')}+ if not (receipt.is_file() and json.loads(receipt.read_text(encoding='utf-8')) == content and executable.is_file()):+ micromamba, packages = self.fetch_git_linux(spec)+ # conda writes the prefix into the installed files, so the+ # environment is created in place; an interrupted one is replaced.+ if prefix.is_symlink():+ prefix.unlink()+ elif prefix.exists():+ shutil.rmtree(prefix)+ explicit = self.root / 'downloads' / 'git-linux' / 'explicit.txt'+ explicit.write_text('@EXPLICIT\n' + ''.join(path.resolve().as_uri() + '\n' for path in packages), encoding='utf-8')+ cache = self.root / 'tools' / 'micromamba-root'+ env = {k: v for k, v in self.env.items() if not k.upper().startswith(('CONDA', 'MAMBA'))}+ self.command('portable-git', [micromamba, 'create', '--yes', '--no-rc', '--offline',+ '--root-prefix', cache, '--prefix', prefix, '--file', explicit], env=env)+ save(receipt, content)+ # Only the environment is kept; a damaged one is downloaded again.+ shutil.rmtree(cache, ignore_errors=True)+ shutil.rmtree(explicit.parent, ignore_errors=True)+ micromamba.unlink(missing_ok=True)+ # PATH, here and in machine.json for ComfyUI, gains only `git`, not+ # the other tools of the environment.+ links = self.root / 'tools' / 'git-bin'+ links.mkdir(parents=True, exist_ok=True)+ if not (links / 'git').is_symlink() or Path(os.readlink(links / 'git')) != executable:+ (links / 'git').unlink(missing_ok=True)+ (links / 'git').symlink_to(executable)+ self.env['PATH'] = str(links) + os.pathsep + self.env['PATH']+ self.command('portable-git-check', [links / 'git', '--version'])+ self.env['FREEVIDEO_GIT'] = str(links / 'git')++ def fetch_git_linux(self, spec):+ """micromamba and the locked packages, verified by SHA-256, as one step."""+ directory = self.root / 'downloads' / 'git-linux'+ tool = spec['micromamba']+ micromamba = self.root / 'tools' / ('micromamba-' + tool['version'])+ channels = spec['channels']+ # Mainland mirrors first when the measured PyPI ranking prefers one.+ mirrors = [n for n in channels if n != 'official']+ names = (mirrors + ['official'] if network.ordered(self.network, 'pypi')[0] in mirrors else+ ['official'] + mirrors)+ rows = [(micromamba, network.urls(self.network, 'github', tool['url'], self.env), tool)]+ rows += [(directory / row['path'].split('/')[-1], [(n, channels[n] + '/' + row['path']) for n in names], row)+ for row in spec['packages']]+ total = sum(row['bytes'] for _, _, row in rows)+ key = 'download-git-linux'+ self.ui.begin(key, 'Prepare Git', detail='Download and verify Git %s' % spec['version'])+ done = 0+ try:+ for path, candidates, row in rows:+ def progress(current, size, speed, before=done):+ if self.cancel.is_set():+ raise RuntimeError('Installation cancelled; partial download retained.')+ self.ui.update(key, done=before + current, total=total, rate=speed, unit='bytes', scope='git',+ detail='%.1f MiB / %.1f MiB' % ((before + current) / 2**20, total / 2**20))+ network.download(candidates, path, row['sha256'], progress, network=dict(self.network, quiet=True),+ env=self.env, size=row['bytes'], category='github' if path == micromamba else 'download')+ done += row['bytes']+ except BaseException:+ self.ui.end(key, success=False)+ raise+ micromamba.chmod(0o755)+ self.ui.end(key, detail='Verified and ready')+ return micromamba, [path for path, _, _ in rows[1:]]+def install_git_windows(self):# An older Git on PATH cannot fetch the pinned sources; use the portable one.if usable_git(self.env['PATH'], self.env):diff --git a/freevideo_engine/failure_details.py b/freevideo_engine/failure_details.pyindex 751d113..4419f81 100644--- a/freevideo_engine/failure_details.py+++ b/freevideo_engine/failure_details.py@@ -100,8 +100,8 @@ def launcher_failure(value, *, zh=False):rules = ((r'Git \d+\.\d+ is too old to download the pinned sources', 'git-version',('Git is too old', 'Git 版本过旧'),- ('Click Retry installation; on Windows FreeVideo then uses its own Git. On Linux or macOS, update Git to 2.35 or newer.',- '请点击“重试安装”,Windows 上 FreeVideo 会改用自带的 Git;Linux 或 macOS 请把 Git 更新到 2.35 或更高版本。')),+ ('Click Retry installation; FreeVideo then installs its own Git. On macOS, update the Command Line Tools.',+ '请点击“重试安装”,FreeVideo 会改用自带的 Git;macOS 请更新命令行工具(Command Line Tools)。')),# web/health.js lists the failed files and what to do on the page itself.(r'The browser page did not load FreeVideo completely|浏览器页面没有完整加载 FreeVideo', 'page',('FreeVideo did not load completely in the browser', '浏览器里的 FreeVideo 没有完整加载'),diff --git a/freevideo_engine/git_linux.json b/freevideo_engine/git_linux.jsonnew file mode 100644index 0000000..62c2818--- /dev/null+++ b/freevideo_engine/git_linux.json@@ -0,0 +1,146 @@+{+ "version": "2.56.0",+ "micromamba": {+ "version": "2.9.0-0",+ "url": "https://github.com/mamba-org/micromamba-releases/releases/download/2.9.0-0/micromamba-linux-64",+ "sha256": "366cd9cd8be14df1ab8ed50352a82111082a36686b2d389fdb79a92c3fafb3e3",+ "bytes": 18292808+ },+ "channels": {+ "official": "https://conda.anaconda.org/conda-forge",+ "tuna": "https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge",+ "nju": "https://mirror.nju.edu.cn/anaconda/cloud/conda-forge"+ },+ "packages": [+ {+ "path": "linux-64/libzlib-1.3.2-h25fd6f3_3.conda",+ "sha256": "eb8a0db0aa570124f7d2a93d7c7f596e3390df5e047818d873baad32985fc736",+ "bytes": 63713+ },+ {+ "path": "linux-64/libgomp-16.2.0-he0feb66_7.conda",+ "sha256": "92a0bb350c7be6a4eedcb4e111c60aefd176018e6b1c009a6e025dbe9bbcd758",+ "bytes": 640566+ },+ {+ "path": "linux-64/zstd-1.5.7-hb78ec9c_7.conda",+ "sha256": "47d682b9f6d6ec9eb1a6e6c3e75ea6273e899e78fb7fc59f81d39745009fbc60",+ "bytes": 601301+ },+ {+ "path": "linux-64/_openmp_mutex-4.5-20_gnu.conda",+ "sha256": "1dd3fffd892081df9726d7eb7e0dea6198962ba775bd88842135a4ddb4deb3c9",+ "bytes": 28948+ },+ {+ "path": "linux-64/libgcc-16.2.0-ha9f2e26_7.conda",+ "sha256": "e031634c3a928f9594eba868bc46ef5230d6571a364a0c63215b06c4563bfcea",+ "bytes": 1058444+ },+ {+ "path": "linux-64/ncurses-6.6-hdb14827_1.conda",+ "sha256": "5d46557214ed184381dafe835b7c94a474a1c3b307a08a250b1ea4779b44ffb3",+ "bytes": 911196+ },+ {+ "path": "linux-64/c-ares-1.34.8-hebe6cf0_2.conda",+ "sha256": "9c37cc233238adf366ea75b0e845662a5be07ceadf62e458183516369340274b",+ "bytes": 228700+ },+ {+ "path": "linux-64/libev-4.33-h280c20c_3.conda",+ "sha256": "e4418f68d01a6307c4431b585c71b584f40189877364e542ee87deb777f5e85b",+ "bytes": 43220+ },+ {+ "path": "linux-64/keyutils-1.6.3-h7cc23a3_1.conda",+ "sha256": "dd053c96dcb0dcfd59422aefea9d2fe937a190167f34fba7893ec1e10a7e8963",+ "bytes": 135295+ },+ {+ "path": "linux-64/bzip2-1.0.8-hda65f42_10.conda",+ "sha256": "1a0d382c515ebf55f8ee1f38c8b81bc95af5c2acc42ad53b66bc5df932032f96",+ "bytes": 257808+ },+ {+ "path": "linux-64/libstdcxx-16.2.0-h934c35e_7.conda",+ "sha256": "fa7018298629fc429971fffd6ecba3d27a7b02e4e890d6a93ea01ffebe8cb745",+ "bytes": 6615436+ },+ {+ "path": "linux-64/libiconv-1.18-h0cb94f2_3.conda",+ "sha256": "f943117edb9cd4d9c61cc972eee5a34291dc55ea7a6e9e38da104995841cbcb6",+ "bytes": 789471+ },+ {+ "path": "linux-64/libxcrypt-4.4.38-h280c20c_0.conda",+ "sha256": "f7e9292dd219a6435bbb1223da9586c3e70d66d169c5a92f08db3f2127df04e9",+ "bytes": 101957+ },+ {+ "path": "linux-64/libexpat-2.8.5-hd2095e1_0.conda",+ "sha256": "6de73033a7c5f712c9c5a54124e4581e025691029835e5bceaf10a333a7e7bc0",+ "bytes": 77893+ },+ {+ "path": "linux-64/libedit-3.1.20260512-pl5321h373387f_0.conda",+ "sha256": "45301f14f4eb66da57cfaf2d265f3eeee73f8b07e99614ee3afc5b26eea91126",+ "bytes": 135877+ },+ {+ "path": "linux-64/pcre2-10.47-h8b3dc9c_1.conda",+ "sha256": "9ebb10a4eb3be51ae67d85c679f5a7a50cb040ed25c783e6331a225ea09991d4",+ "bytes": 1218833+ },+ {+ "path": "linux-64/icu-78.3-py310h44b86e0_2.conda",+ "sha256": "9f07834f0c546ab14d885ce0366285f61f44e326c0edd1fc63b8294e113ae432",+ "bytes": 14459115+ },+ {+ "path": "linux-64/perl-5.44.0-1_h7cc23a3_perl5.conda",+ "sha256": "43afad1c27c24ccc40d98461ab7e1648ccac876421a8783167861ae19c4edc83",+ "bytes": 11438995+ },+ {+ "path": "linux-64/libpsl-0.23.1-hd9e3e90_1.conda",+ "sha256": "09e8effdc89bc5d021349318d32b85594f5b8d8e3ab8f90a85b81f8fe695a566",+ "bytes": 72519+ },+ {+ "path": "noarch/ca-certificates-2026.7.22-hbd8a1cb_0.conda",+ "sha256": "0a0544cf95f64394fe4959286f5c71f5444ad58feb0602e53becb27448d24da6",+ "bytes": 131780+ },+ {+ "path": "linux-64/openssl-3.6.5-h781a0a9_0.conda",+ "sha256": "9c1533f1cf784f0e250919c0c9762d0b0e6bc727a79290ffb7cea1ceca1d038c",+ "bytes": 3195299+ },+ {+ "path": "linux-64/libssh2-1.11.1-h6154650_1.conda",+ "sha256": "7e463000fa1cba3f3a6597b776f6ab301d425a96e3bc20d0d9d76a3b9f237aa3",+ "bytes": 306045+ },+ {+ "path": "linux-64/krb5-1.22.2-hbc21106_2.conda",+ "sha256": "2a5c38c85e63df84c4e69ee71439841ce570d259ae3060627bb9a49a938d66f4",+ "bytes": 1394333+ },+ {+ "path": "linux-64/libnghttp2-1.68.1-h74cf4be_1.conda",+ "sha256": "11a2f54a6f391e25738bce0023e6ef499600147bbcf21c1fa69d2e251b03cc6a",+ "bytes": 649974+ },+ {+ "path": "linux-64/libcurl-8.22.0-ha042cf0_0.conda",+ "sha256": "483b7eb97f56fbb3a9cb7190d33012dfa0a5aaed99ede61465563cd97dd82504",+ "bytes": 499651+ },+ {+ "path": "linux-64/git-2.56.0-pl5440h3795e67_0.conda",+ "sha256": "d5654608f2bed18580fa05e22d80093fc746cc70dea1d6a208e7a9f65b1888e0",+ "bytes": 11920563+ }+ ]+}diff --git a/freevideo_engine/launcher/FReleaseNotes.qml b/freevideo_engine/launcher/FReleaseNotes.qmlindex e46914c..a8c7ddb 100644--- a/freevideo_engine/launcher/FReleaseNotes.qml+++ b/freevideo_engine/launcher/FReleaseNotes.qml@@ -2,7 +2,10 @@ import QtQuickimport QtQuick.LayoutsColumnLayout {+ id: notesRootproperty var release: ({})+ // Versions between the installed one and `release`, newest first.+ property var earlier: []property bool zh: falseproperty string heading: ""readonly property var notes: release && release.release_notes ? release.release_notes[zh ? "zh" : "en"] : null@@ -17,4 +20,19 @@ ColumnLayout {model: notes ? notes.changes : []delegate: FText { required property string modelData; text: "• " + modelData; color: theme.muted; Layout.fillWidth: true }}+ Repeater {+ model: earlier+ delegate: ColumnLayout {+ id: version+ required property var modelData+ readonly property var notes: modelData.release_notes ? modelData.release_notes[notesRoot.zh ? "zh" : "en"] : null+ Layout.fillWidth: true; Layout.topMargin: 6; spacing: 4+ FText { text: "v" + version.modelData.product_version; font.weight: Font.DemiBold; Layout.fillWidth: true }+ FText { text: version.notes ? version.notes.summary : ""; Layout.fillWidth: true }+ Repeater {+ model: version.notes ? version.notes.changes : []+ delegate: FText { required property string modelData; text: "• " + modelData; color: theme.muted; Layout.fillWidth: true }+ }+ }+ }}diff --git a/freevideo_engine/launcher/Main.qml b/freevideo_engine/launcher/Main.qmlindex a0e989b..4d30581 100644--- a/freevideo_engine/launcher/Main.qml+++ b/freevideo_engine/launcher/Main.qml@@ -29,7 +29,8 @@ ApplicationWindow {readonly property bool manualEnvironment: s.offline.runtime_supported !== false && s.form.new_comfy && s.form.environment_method === "manual"readonly property bool usingRuntime: manualEnvironment && s.offline.runtimereadonly property bool needsRuntime: s.page === "comfy" && manualEnvironment && !s.offline.runtime- readonly property bool offlineSelected: usingRuntime || s.form.model_method === "manual"+ // An imported environment can take its models from packages or download them.+ readonly property bool offlineSelected: s.form.model_method === "manual"readonly property bool needsPackages: s.page === "models" && offlineSelected && s.offline.models === 0 && (usingRuntime || s.form.model_dirs.length === 0)readonly property int step: s.page === "comfy" ? 0 : s.page === "models" ? 1 : 2property string previousPage: ""@@ -40,6 +41,7 @@ ApplicationWindow {function releaseSummary(value) { return value && value.release_notes ? value.release_notes[s.zh ? "zh" : "en"].summary : "" }readonly property var currentRelease: s.update.current_release || {version: s.update.current}readonly property var availableRelease: s.update.candidate || (s.update.engine ? currentRelease : null)+ readonly property var availableEarlier: s.update.candidate ? (s.update.candidate_earlier || []) : s.update.engine ? (s.update.engine_earlier || []) : []function sourceName(value) { return ({"auto": t("Automatic", "自动选择"), "official": "Hugging Face", "hf-mirror": t("HF Mirror", "HF 镜像"), "modelscope": t("ModelScope", "魔搭")})[value] || value }function number(n) { return typeof n === "number" && isFinite(n) }function fraction(row) { return row && number(row.total) && row.total > 0 && number(row.done) && row.done <= row.total ? row.done / row.total : -1 }@@ -138,7 +140,7 @@ ApplicationWindow {if (needsRuntime) return t("Choose environment package", "选择运行环境包")if (s.page === "comfy") return t("Continue", "继续")if (needsPackages) return t("Choose offline packages", "选择离线包")- if (s.page === "models") return t("Check & continue", "检查并继续")+ if (s.page === "models") return usingRuntime && !offlineSelected ? t("Download models & continue", "下载模型并继续") : t("Check & continue", "检查并继续")if (updateFirst) return t("Update & launch", "更新并启动")if (s.page === "launcher") return s.status === "open" ? t("Open FreeVideo", "打开 FreeVideo") : s.status === "restart-required" ? t("Connect again", "重新连接") : t("Launch FreeVideo", "启动 FreeVideo")return s.status === "review" ? t("Install & launch", "安装并启动") : s.status === "restart-required" ? t("Connect again", "重新连接") : t("Check & resume", "检查并继续")@@ -146,6 +148,7 @@ ApplicationWindow {function retryText() {if (s.retry_kind === "check") return t("Check again", "重新检查")if (s.retry_kind === "launch") return t("Retry launch", "重试启动")+ if (s.retry_kind === "prepare" && usingRuntime && !offlineSelected) return t("Retry download", "重试下载")if (s.retry_kind === "import" || s.retry_kind === "prepare") return t("Retry import", "重试导入")return t("Retry installation", "重试安装")}@@ -457,16 +460,16 @@ ApplicationWindow {}RowLayout {visible: usingRuntime; Layout.fillWidth: true- FText { objectName: "runtimeReadyOnModels"; text: t("✓ Environment ready · add your model packages", "✓ 运行环境已就绪 · 继续导入模型包"); color: theme.success; Layout.fillWidth: true }+ FText { objectName: "runtimeReadyOnModels"; text: t("✓ Environment ready · now the models", "✓ 运行环境已就绪 · 接下来准备模型"); color: theme.success; Layout.fillWidth: true }FButton { text: t("Change", "更改"); flat: true; enabled: !s.busy; onClicked: backend.action("back", false) }}- FText { visible: !usingRuntime; text: t("How would you like to get the rest?", "选择下载方式"); font.pixelSize: theme.strong; font.weight: Font.DemiBold; Layout.fillWidth: true; Layout.topMargin: 6 }+ FText { text: usingRuntime ? t("Where should the models come from?", "选择模型来源") : t("How would you like to get the rest?", "选择下载方式"); font.pixelSize: theme.strong; font.weight: Font.DemiBold; Layout.fillWidth: true; Layout.topMargin: 6 }RowLayout {- visible: !usingRuntime; Layout.fillWidth: true; spacing: 12+ Layout.fillWidth: true; spacing: 12FChoice {objectName: "automaticMethod"; Layout.fillWidth: true; Layout.minimumWidth: 0; Layout.preferredWidth: 1; Layout.fillHeight: truetext: t("Automatic download", "自动下载")- detail: t("Download only what's missing.", "自动补齐缺少的文件。")+ detail: usingRuntime ? t("Download the models into this offline installation.", "把模型下载到这个离线安装里。") : t("Download only what's missing.", "自动补齐缺少的文件。")checked: !offlineSelected; enabled: !s.busyonClicked: backend.edit("model_method", "auto")}@@ -488,6 +491,9 @@ ApplicationWindow {}FButton { objectName: "downloadSource"; text: s.source_name + " ›"; flat: true; implicitHeight: theme.heightSm; font.pixelSize: theme.micro + 1; onClicked: { settingsTab = "downloads"; settingsOpen = true } }}+ FText { visible: usingRuntime; text: t("An interrupted download resumes; downloaded files are kept.", "下载中断后可以接着下载,已下载的文件不会丢。"); color: theme.muted; font.pixelSize: theme.micro; Layout.fillWidth: true }+ FMeter { visible: usingRuntime && s.offline.status === "downloading"; Layout.fillWidth: true; fraction: win.fraction(s.offline); active: visible }+ FText { visible: usingRuntime && s.offline.status === "downloading"; text: t("Downloading models", "下载模型") + (number(s.offline.total) ? " · " + bytes(s.offline.done) + " / " + bytes(s.offline.total) : ""); color: theme.muted; font.pixelSize: theme.micro; Layout.fillWidth: true }}FCard {objectName: "offlineImportCard"; visible: offlineSelected; reveal: true; Layout.fillWidth: true; padding: 20; spacing: 14@@ -1050,7 +1056,7 @@ ApplicationWindow {FText { text: s.update.candidate ? t("Update available", "有可用更新") : s.update.engine ? t("Engine update", "引擎更新") : t("Updates", "更新"); font.pixelSize: theme.section + 2; font.weight: Font.DemiBold }FText { objectName: "updateDialogText"; text: s.update.phase === "waiting" ? t("A video is still generating. FreeVideo restarts and updates as soon as it finishes.", "还有视频正在生成,完成后会自动重启并更新。") : s.update.status === "ready" && s.update.candidate ? t("Downloaded. Restart to finish; models and settings are kept.", "下载完成,重启即可完成更新,模型和设置都会保留。") : s.update.candidate ? t("FreeVideo ", "FreeVideo ") + releaseVersion(s.update.candidate) + t(" is available (current ", " 已发布(当前 ") + releaseVersion(currentRelease) + t("). Updating keeps your models and settings. FreeVideo restarts after the download; running videos finish first.", ")。更新会保留模型和设置,下载完成后自动重启;正在生成的视频会先完成。") : s.update.engine ? t("This launcher already includes engine ", "启动器已带有新版引擎 ") + releaseVersion(currentRelease) + t(" (installed ", "(已安装 ") + (s.update.installed || "—") + (s.status === "open" ? t("). Updating takes about a minute, restarts ComfyUI once and keeps your models and settings.", ")。更新约需 1 分钟,会重启一次 ComfyUI,模型和设置都会保留。") : t("). Updating takes about a minute, then FreeVideo starts; models and settings are kept.", ")。更新约需 1 分钟,完成后自动启动,模型和设置都会保留。")) : s.update.status === "current" ? t("You're up to date.", "已是最新版本。") : s.update.status === "development" ? t("Running from source. Update with Git.", "当前从源码运行,请通过 Git 更新。") : s.update.status === "error" ? t("Couldn't check for updates. Try again below.", "暂时无法检查更新,请重试。") : t("Checking the latest release…", "正在检查最新版本…"); color: theme.muted; Layout.fillWidth: true }FMeter { Layout.fillWidth: true; visible: s.update.status === "downloading"; active: true; fraction: s.update.progress && s.update.progress.total ? s.update.progress.done/s.update.progress.total : -1 }- FReleaseNotes { objectName: "updateReleaseNotes"; visible: !!availableRelease; Layout.fillWidth: true; release: availableRelease; zh: s.zh; heading: t("What's new", "更新内容") + " · " + releaseVersion(availableRelease) }+ FReleaseNotes { objectName: "updateReleaseNotes"; visible: !!availableRelease; Layout.fillWidth: true; release: availableRelease; earlier: availableEarlier; zh: s.zh; heading: t("What's new", "更新内容") + " · " + releaseVersion(availableRelease) }FButton { text: t("Version & release notes", "版本与更新说明"); flat: true; onClicked: releaseNotesOpen = true }FText { visible: !!s.update.error; text: s.update.error || ""; color: theme.danger; Layout.fillWidth: true; font.pixelSize: theme.micro }FField { id: githubToken; visible: !!s.update.error; Layout.fillWidth: true; echoMode: TextInput.Password; placeholderText: t("GitHub token · optional", "GitHub Token · 可选") }@@ -1077,7 +1083,7 @@ ApplicationWindow {ColumnLayout {id: releaseContents; width: releaseScroll.availableWidth; spacing: 18FText { text: t("Version & release notes", "版本与更新说明"); font.pixelSize: theme.section + 2; font.weight: Font.DemiBold; Layout.fillWidth: true }- FReleaseNotes { visible: !!s.update.candidate; Layout.fillWidth: true; release: s.update.candidate; zh: s.zh; heading: t("Available update", "可用更新") + " · " + releaseVersion(s.update.candidate) }+ FReleaseNotes { visible: !!s.update.candidate; Layout.fillWidth: true; release: s.update.candidate; earlier: s.update.candidate_earlier || []; zh: s.zh; heading: t("Available update", "可用更新") + " · " + releaseVersion(s.update.candidate) }FDivider { visible: !!s.update.candidate }FReleaseNotes { objectName: "currentReleaseNotes"; Layout.fillWidth: true; release: currentRelease; zh: s.zh; heading: t("Current version", "当前版本") + " · " + releaseVersion(currentRelease) }FText { visible: !!s.update.installed; text: t("Installed engine build: ", "已安装引擎构建号:") + (s.update.installed || ""); color: theme.muted; font.pixelSize: theme.micro; Layout.fillWidth: true }diff --git a/freevideo_engine/launcher_copy.py b/freevideo_engine/launcher_copy.pyindex 02e1c9e..0b2249d 100644--- a/freevideo_engine/launcher_copy.py+++ b/freevideo_engine/launcher_copy.py@@ -119,7 +119,7 @@ def source_name(value, zh=False):def display(value, zh=False):value = clean(value)if not zh:- return {'检查配套包': 'Checking packages'}.get(value, value)+ return {'检查配套包': 'Checking packages', '下载模型': 'Downloading models'}.get(value, value)if value in ZH:return ZH[value]if value in SOURCES:diff --git a/freevideo_engine/launcher_session.py b/freevideo_engine/launcher_session.pyindex 415665d..a161d5a 100644--- a/freevideo_engine/launcher_session.py+++ b/freevideo_engine/launcher_session.py@@ -220,6 +220,17 @@ class Session:self.imported_batch = Noneself.error = ''+ def prepare_offline(self):+ """Models from imported packages, or downloaded into the imported environment.++ Imported model packages are always used; the download is for an+ environment imported without any.+ """+ if self.form['model_method'] == 'auto' and not self.form['offline_models']:+ self.importer.download(self.form['offline_runtime'], self.source, self.form['sampling_caches'])+ else:+ self.importer.prepare(self.form['offline_runtime'], self.form['offline_models'], self.source)+def activate_offline(self, root):from .offline_packages import check_runtime_platformcheck_runtime_platform()@@ -257,7 +268,7 @@ class Session:self.importer.start(paths, destination)self.imported_batch = Noneelif kind == 'prepare':- self.importer.prepare(self.form['offline_runtime'], self.form['offline_models'], self.source)+ self.prepare_offline()self.imported_batch = Noneelif kind == 'launch':self.action('launch', accepted)@@ -298,7 +309,7 @@ class Session:if (self.page == 'models' and self.form['new_comfy']and self.form['environment_method'] == 'manual' and self.form['offline_runtime']):self.import_retry = ('prepare',)- self.importer.prepare(self.form['offline_runtime'], self.form['offline_models'], self.source)+ self.prepare_offline()returnif self.page == 'comfy':if self.form['new_comfy'] and self.form['environment_method'] == 'manual' and not self.form['offline_runtime']:@@ -830,6 +841,15 @@ class Session:def installed_version(self):return self.source_stamp((self.selected or {}).get('source'))[0]+ def installed_product_version(self):+ """The product version of the engine the selected installation runs, if it says."""+ source = (self.selected or {}).get('source')+ try:+ value = json.loads((Path(source) / 'freevideo_engine/release_notes.json').read_text(encoding='utf-8'))+ except (OSError, ValueError, TypeError):+ return None+ return value.get('product_version') if isinstance(value, dict) else None+def update_view(self):from .release_notes import installed_details, public_detailsif self.release_details is None:@@ -844,6 +864,11 @@ class Session:channel=self.updater.current.get('channel') if self.updater else None,track=self.updater.current.get('track', 'stable') if self.updater else 'stable',manual=bool(self.updater and self.updater.current.get('packaging') in ('onedir', 'app')))+ # Versions between the one in use and the update, so skipped notes are not lost.+ from .release_notes import since+ current = view['current_release'] or {}+ view['candidate_earlier'] = since(view.get('candidate'), current.get('product_version')) if view.get('candidate') else []+ view['engine_earlier'] = since(current, self.installed_product_version()) if view['engine'] else []due = ((view.get('candidate') and row['status'] in ('available', 'ready', 'error'))or (view['engine'] and self.page == 'launcher'))view['remind'] = bool(key and due and self.update_snoozed.get(key, 0) <= time.monotonic()@@ -1009,7 +1034,9 @@ class Session:if self.importer.busy:# The sidebar's Working card follows the offline import, not the idle installer.state = self.importer.state- if state.get('status') == 'preparing':+ if state.get('status') == 'downloading':+ label = self.t('Downloading models', '下载模型')+ elif state.get('status') == 'preparing':label = self.t('Checking packages', '检查配套包')else:label = self.t('Importing offline packages', '导入离线包')diff --git a/freevideo_engine/network.py b/freevideo_engine/network.pyindex 4c4f00b..946e451 100644--- a/freevideo_engine/network.py+++ b/freevideo_engine/network.py@@ -873,10 +873,11 @@ def download(candidates, path, expected, progress=None, *, network=None, env=Nonraise DownloadError('Every download source failed for %s. Check your network or choose another connection mode in Downloads. Partial files retained' % path.name)-# clone() passes the remote through GIT_CONFIG_* (Git 2.31) and narrows-# references with `sparse-checkout set --no-cone` (Git 2.35). Older Git fails-# with "'origin' does not appear to be a git repository".-MIN_GIT = (2, 35)+# clone() passes the remote through GIT_CONFIG_PARAMETERS and writes the sparse+# patterns itself instead of using GIT_CONFIG_COUNT (Git 2.31) or+# `sparse-checkout set --no-cone` (Git 2.35), so the Git that current Linux+# distributions ship works. MIN_GIT is the oldest Git this sequence is tested on.+MIN_GIT = (2, 17)def git_version(executable, env=None):@@ -892,8 +893,12 @@ def git_version(executable, env=None):def old_git_message(version):return ('Git %d.%d is too old to download the pinned sources; FreeVideo needs Git %d.%d or newer. '- 'On Windows, click Retry installation to use FreeVideo\'s own Git; elsewhere, update Git.'- % (*version, *MIN_GIT))+ 'Click Retry installation to use FreeVideo\'s own Git.' % (*version, *MIN_GIT))+++def git_parameter(value):+ """A `-c` setting quoted as Git quotes it in GIT_CONFIG_PARAMETERS."""+ return "'" + value.replace("'", "'\\''").replace('!', "'\\!'") + "'"def clone(target, url, commit, *, sparse=None, run=None, network=None, env=None):@@ -933,20 +938,24 @@ def clone(target, url, commit, *, sparse=None, run=None, network=None, env=None)# settings when constructing the exact official patched tree.execute(target.name + '-line-endings', ['git', '-C', temporary, 'config', 'core.autocrlf', 'false'])execute(target.name + '-long-paths', ['git', '-C', temporary, 'config', 'core.longpaths', 'true'])- # URL via environment keeps credentials out of process arguments/logs.- config_index = int(env.get('GIT_CONFIG_COUNT', 0))- fetch_env = dict(env, GIT_CONFIG_COUNT=str(config_index + 1))- fetch_env.update({'GIT_CONFIG_KEY_' + str(config_index): 'remote.origin.url',- 'GIT_CONFIG_VALUE_' + str(config_index): endpoint})+ if sparse:+ # The patterns file with cone mode off is what `sparse-checkout+ # set --no-cone` writes; every Git reads it at checkout.+ execute(target.name + '-sparse', ['git', '-C', temporary, 'config', 'core.sparseCheckout', 'true'])+ execute(target.name + '-sparse-cone', ['git', '-C', temporary, 'config', 'core.sparseCheckoutCone', 'false'])+ (temporary / '.git' / 'info').mkdir(exist_ok=True)+ (temporary / '.git' / 'info' / 'sparse-checkout').write_text(''.join(p + '\n' for p in sparse), encoding='utf-8')+ # The URL reaches Git the way `git -c` hands settings to its own+ # children, in every Git version: never in process arguments, logs+ # or the repository's config, even if the fetch is killed.original = env- env = fetch_env+ env = dict(env, GIT_CONFIG_PARAMETERS=' '.join(filter(None, (+ env.get('GIT_CONFIG_PARAMETERS', '').strip(), git_parameter('remote.origin.url=' + endpoint)))))try:execute(target.name + '-fetch-' + name, ['git', '-C', temporary, '-c', 'fetch.fsckObjects=true', 'fetch', '--depth=1', '--no-tags', 'origin', commit])- if sparse:- execute(target.name + '-sparse', ['git', '-C', temporary, 'sparse-checkout', 'set', '--no-cone', *sparse])- execute(target.name + '-checkout', ['git', '-C', temporary, 'checkout', '--detach', commit])finally:env = original+ execute(target.name + '-checkout', ['git', '-C', temporary, 'checkout', '--detach', commit])actual = subprocess.check_output([git, '-C', str(temporary), 'rev-parse', 'HEAD'], env=env, text=True, **hidden_console()).strip()if actual != commit:raise ValueError('Downloaded source did not match its pinned commit')diff --git a/freevideo_engine/offline_packages.py b/freevideo_engine/offline_packages.pyindex a30da1e..ad5bf23 100644--- a/freevideo_engine/offline_packages.py+++ b/freevideo_engine/offline_packages.py@@ -10,7 +10,7 @@ import timeimport zipfilefrom .monitoring import save-from .portable import bundle_name, inside, listing+from .portable import ENCODER_LIBRARY, bundle_name, inside, listingPREFIX = 'FreeVideo-Windows/'# Optional packs (reference-audio tables) carry sampling tables outside the@@ -264,14 +264,43 @@ def import_archive(path, destination, progress=lambda **kw: None, cancelled=lambreturn dict(root=str(root), kind=value['kind'], variant=value['variant'], name=path.name)+ENCODER_COPY = 'engine/vendor/h3-text-encoder'+++def encoder_library(runtime, config, present):+ """Give the text encoder its own copy of ComfyUI's library, as the ZIP had it.++ Updating the bundled ComfyUI then cannot change how prompts are encoded,+ as with the automatic installation's separate checkout. Made once, from+ files unchanged since import; if any changed, the bundled ComfyUI is used+ as before. Returns the copy's folder (or None) and its inventory rows.+ """+ comfy = config['configuration']['comfy'].rstrip('/') + '/'+ known = stamps(runtime)+ rows = []+ for row in config['files']:+ inner = row['path'][len(comfy):] if row['path'].startswith(comfy) else None+ if inner and any(inner == item or (item.endswith('/') and inner.startswith(item)) for item in ENCODER_LIBRARY):+ rows.append((row, dict(row, path=ENCODER_COPY + '/' + inner)))+ if not rows:+ return None, []+ pending = [(row, copy) for row, copy in rows if copy['path'] not in present]+ if not all(row['path'] in present and unchanged(runtime / row['path'], row, known, present[row['path']])+ for row, _ in pending):+ return None, []+ for row, copy in pending:+ target = runtime / copy['path']+ target.parent.mkdir(parents=True, exist_ok=True)+ partial = target.with_name(target.name + '.copying')+ shutil.copyfile(runtime / row['path'], partial) # A copy, not a link: an update replaces neither.+ partial.replace(target)+ return ENCODER_COPY, [copy for _, copy in rows]++def assemble(runtime, models, source, progress=lambda **kw: None):"""Bind imported components to the current EXE's engine, without running it."""- from .desktop_runtime import materialize_source- check_runtime_platform()runtime = Path(runtime)- config = json.loads((runtime / 'runtime.json').read_text(encoding='utf-8'))- if not runtime_fits(config):- raise RuntimeMismatch(SKIPPED_RUNTIME)+ config = runtime_config(runtime)candidates = []for root in models:path = Path(root) / 'models/model-pack.json'@@ -331,19 +360,35 @@ def assemble(runtime, models, source, progress=lambda **kw: None):continue # The engine fetches a table it cannot find when a request needs it.place(Path(root) / row['path'], runtime / row['path'])listed.add(row['path'])+ return finish(runtime, config, model, source, here)+++def runtime_config(runtime):+ check_runtime_platform()+ config = json.loads((Path(runtime) / 'runtime.json').read_text(encoding='utf-8'))+ if not runtime_fits(config):+ raise RuntimeMismatch(SKIPPED_RUNTIME)+ return config+++def finish(runtime, config, model, source, here=None):+ """Write portable.json for verified models, give the encoder its library copy and trust both."""+ from .desktop_runtime import materialize_source+ runtime = Path(runtime)+ library, copies = encoder_library(runtime, config, listing(runtime) if here is None else here)code = materialize_source(source, runtime / 'engine/launcher/source')variant = model['variant']from .prepared_model import catalogvalue = dict(config['configuration'], schema_version=1, variant=variant,source=str(code.relative_to(runtime).as_posix()),source_commit=code.name, cache='models/edge/' + catalog()['variants'][variant]['cache_prefix'],- files=config['files'] + model['files'])+ files=config['files'] + model['files'] + copies, **({'encoder_library': library} if library else {}))inventory(value['files'])save(runtime / 'portable.json', value)# Every model file was verified above and the environment's files at import;# the first start takes that instead of reading tens of GiB once more.imported, final = stamps(runtime), listing(runtime)- trusted = {row['path'] for row in model['files']}+ trusted = {row['path'] for row in model['files'] + copies}trusted |= {row['path'] for row in config['files'] if imported.get(row['path']) == final.get(row['path'])}save(runtime / 'engine' / 'portable-verified.json',{row['path']: dict(bytes=final[row['path']][0], mtime_ns=final[row['path']][1], sha256=row['sha256'])@@ -351,6 +396,65 @@ def assemble(runtime, models, source, progress=lambda **kw: None):return runtime+DOWNLOADING = '下载模型'+++def download(runtime, source, sampling_caches, progress=lambda **kw: None, cancelled=lambda: False):+ """Fill an imported environment's model folders from the network, then assemble it.++ The installation's own Python runs the automatic installer's downloader+ (fastest source, resume, verification); its reports drive the progress.+ """+ import subprocess+ from .comfy_environment import isolated_environment+ from .desktop_runtime import materialize_source+ from . import processes+ runtime = Path(runtime)+ config = runtime_config(runtime)+ code = materialize_source(source, runtime / 'engine/launcher/source')+ out = runtime / 'engine' / 'downloaded-models.json'+ out.unlink(missing_ok=True)+ env = isolated_environment(runtime / 'engine', code)+ for key in ('HF_HUB_OFFLINE', 'TRANSFORMERS_OFFLINE', 'PYTHONHOME'):+ env.pop(key, None)+ env.update(PYTHONPATH=str(code), PYTHONNOUSERSITE='1', PYTHONIOENCODING='utf-8',+ HF_HOME=str(runtime / 'engine/cache/huggingface'))+ command = [str(inside(runtime, config['configuration']['python'])), '-B', '-m', 'freevideo_engine.portable_models',+ '--root', str(runtime), '--out', str(out)] + (['--sampling-caches'] if sampling_caches else [])+ log = runtime / 'engine' / 'model-download.log'+ log.parent.mkdir(parents=True, exist_ok=True)+ progress(done=0, total=None, detail=DOWNLOADING)+ tail = ''+ with log.open('w', encoding='utf-8') as stream:+ child = processes.popen(command, env=env, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, text=True,+ encoding='utf-8', errors='replace', start_new_session=True, supervise=True)+ try:+ for line in child.stdout:+ stream.write(line); stream.flush()+ tail = (tail + line)[-4000:]+ if cancelled():+ processes.stop(child)+ raise InterruptedError('已暂停下载,已下载的文件保留,再次开始会接着下载。')+ try:+ event = json.loads(line)+ except ValueError:+ continue+ if isinstance(event, dict) and event.get('event') == 'model_groups':+ groups = event.get('groups') or []+ total = sum(g.get('total_bytes') or 0 for g in groups)+ done = sum(max(g.get('ready_bytes') or 0, g.get('downloaded_bytes') or 0) for g in groups)+ progress(done=min(done, total), total=total or None, detail=DOWNLOADING)+ finally:+ if child.poll() is None:+ processes.stop(child)+ child.stdout.close()+ if child.wait() != 0 or not out.is_file():+ raise RuntimeError('模型下载未完成,已下载的文件保留,可以重试。日志:%s\n%s' % (log, tail[-1500:]))+ model = json.loads(out.read_text(encoding='utf-8'))+ inventory(model['files'])+ return finish(runtime, config, model, source)++class Importer:def __init__(self):self.thread = None@@ -379,6 +483,24 @@ class Importer:self.thread = threading.Thread(target=work, name='freevideo-offline-prepare', daemon=True)self.thread.start()+ def download(self, runtime, source, sampling_caches):+ if self.busy:+ return+ self.cancelled.clear()+ self.state = dict(status='downloading', done=0, total=None, detail=DOWNLOADING, packages=[])+ def update(**row):+ self.state = dict(self.state, **row)+ def work():+ try:+ root = download(runtime, source, sampling_caches, update, self.cancelled.is_set)+ self.state = dict(self.state, status='prepared', ready_root=str(root))+ except RuntimeMismatch as error:+ self.state = dict(self.state, status='complete', runtime_skipped=True, detail=str(error))+ except Exception as error:+ self.state = dict(self.state, status='error', error=str(error))+ self.thread = threading.Thread(target=work, name='freevideo-model-download', daemon=True)+ self.thread.start()+def start(self, paths, destination):if self.busy:returndiff --git a/freevideo_engine/portable.py b/freevideo_engine/portable.pyindex 7a1cea3..78c12ab 100644--- a/freevideo_engine/portable.py+++ b/freevideo_engine/portable.py@@ -26,6 +26,11 @@ def child_lease(descriptor):os.environ[LOCK_ENV] = previous+# What the native text encoder library needs from ComfyUI: the same paths as+# the automatic installation's sparse checkout (bootstrap encoder-source).+ENCODER_LIBRARY = ('comfy/', 'utils/', 'folder_paths.py', 'node_helpers.py', 'LICENSE')++def bundle_name(name):"""The lexical rules for a file inside a bundle, without touching the disk.@@ -141,7 +146,7 @@ def environment(root, value, environ=None):env = isolated_environment(root/'engine', inside(root, value['source']), environ)env.update(FREEVIDEO_MODEL_ROOT=str(inside(root, value['model_root'])),FREEVIDEO_VDN_ROOT=str(inside(root, value['vdn'])),- FREEVIDEO_COMFY_ROOT=str(inside(root, value['comfy'])),+ FREEVIDEO_COMFY_ROOT=str(inside(root, value.get('encoder_library') or value['comfy'])),TORCHINDUCTOR_CACHE_DIR=str(root/'engine/cache/inductor'),TRITON_CACHE_DIR=str(root/'engine/cache/triton'),HF_HOME=str(root/'engine/cache/huggingface'),@@ -172,7 +177,8 @@ def configuration(root, value, hardware):return dict(schema_version=1, root=str(root/'engine'), source=str(inside(root, value['source'])),environment_layout='unified', system=hardware.system, engine_version=__version__,python=str(inside(root, value['python'])), comfy_python=str(inside(root, value['python'])),- comfy_root=str(inside(root, value['comfy'])), vdn_root=str(inside(root, value['vdn'])),+ # The encoder's own copy when assembly made one; the bundled ComfyUI otherwise.+ comfy_root=str(inside(root, value.get('encoder_library') or value['comfy'])), vdn_root=str(inside(root, value['vdn'])),model_root=str(models), encoder_model_root=str(inside(root, value['encoder_root'])),base=str(models/'h3-base'), checkpoint=str(models/'stage-dmd-step-250'),cache=str(inside(root, value['cache'])), encoder=spec['models']['encoder_file'].split('/')[-1],@@ -229,7 +235,7 @@ def connect(root, value, machine, progress=lambda **kw: None, cancelled=None, *,controller.cancelled = cancelledif cancelled.is_set():raise RuntimeError('Startup cancelled')- controller.selection = dict(ready=True, root=machine['comfy_root'], engine=machine['root'],+ controller.selection = dict(ready=True, root=str(inside(root, value['comfy'])), engine=machine['root'],source=machine['source'], python=machine['python'], url=url,portable=False, separate=False)controller.restore_terminal(machine['root'])diff --git a/freevideo_engine/portable_models.py b/freevideo_engine/portable_models.pynew file mode 100644index 0000000..f2f091a--- /dev/null+++ b/freevideo_engine/portable_models.py@@ -0,0 +1,78 @@+"""Download an offline installation's models with the automatic installer's downloader.++Runs with the installation's own Python after an Environment ZIP was imported+without model packages. It writes the folders model packages would have filled+and a model inventory the launcher then assembles, exactly as for packages.+"""+import argparse+import json+import os+from pathlib import Path++PACKAGE = Path(__file__).resolve().parent+++def selection(runtime, hardware):+ """The model this GPU runs, in the folders an offline installation reads."""+ from .prepared_model import catalog, preferred_format, select+ scale = ('int8_convrot' if preferred_format(hardware) == 'int8_convrot'+ else 'per_tensor' if hardware.capability[0] >= 10 else 'rowwise')+ edge = Path(runtime) / 'models' / 'edge'+ chosen = select(hardware.capability, runtime, scale_granularity=scale)+ if chosen is None:+ raise ValueError('No prepared model matches this GPU')+ return dict(chosen, directory=str(edge), cache=str(edge / catalog()['variants'][scale]['cache_prefix']))+++def plan(runtime, hardware, sampling_caches):+ from . import network+ from .download_settings import read+ from .environments import bootstrap_versions+ runtime = Path(runtime)+ engine = runtime / 'engine'+ networking = network.plan(json.loads((PACKAGE / 'dependencies.json').read_text(encoding='utf-8')),+ bootstrap_versions(json.loads((PACKAGE / 'bootstrap_versions.json').read_text(encoding='utf-8')), hardware.system),+ 'unified', model_only=True, env=dict(os.environ, FREEVIDEO_HOME=str(engine)),+ proxy_mode=read(engine / 'download-settings.json')['proxy_mode'])+ networking['download_settings_path'] = str(engine / 'download-settings.json')+ return dict(root=str(engine), model_dir=str(runtime / 'models' / 'base'), encoder_dir=str(runtime / 'models' / 'encoder'),+ prepared_model=selection(runtime, hardware), sampling_caches=bool(sampling_caches),+ network=networking, verification='auto')+++def inventory(runtime, value):+ """What was downloaded, as a model package lists it: paths under the installation."""+ from .bootstrap import model_target+ from .install_tuning import required_models+ from .network import hash_file+ from .prepared_model import files+ from .sampling_assets import install_files+ runtime = Path(runtime).resolve()+ prepared = value['prepared_model']+ rows = list(required_models(json.loads((PACKAGE / 'model_files.json').read_text(encoding='utf-8')), prepared))+ rows += files(prepared) + install_files(value['sampling_caches'])+ result = []+ for row in rows:+ path = model_target(row, Path(value['model_dir']), Path(value['encoder_dir']), prepared['directory']).resolve()+ # Small files pinned by git blob carry no sha256; the inventory needs one.+ result.append(dict(path=path.relative_to(runtime).as_posix(), bytes=row['bytes'],+ sha256=row.get('sha256') or hash_file(path)))+ return dict(variant=prepared['scale_granularity'], files=sorted(result, key=lambda r: r['path']))+++def main(argv=None):+ parser = argparse.ArgumentParser(description=__doc__)+ parser.add_argument('--root', type=Path, required=True)+ parser.add_argument('--out', type=Path, required=True)+ parser.add_argument('--sampling-caches', action='store_true')+ args = parser.parse_args(argv)+ from .hardware import detect+ from .monitoring import save+ from .provision import models+ value = plan(args.root, detect(), args.sampling_caches)+ models(value)+ save(args.out, inventory(args.root, value))+++if __name__ == '__main__':+ main()diff --git a/freevideo_engine/release_notes.json b/freevideo_engine/release_notes.jsonindex 7e8d44e..a47fd15 100644--- a/freevideo_engine/release_notes.json+++ b/freevideo_engine/release_notes.json@@ -1,24 +1,255 @@{"schema": 1,- "product_version": "0.3.11",+ "product_version": "0.3.12","en": {- "summary": "Importing offline packages is faster and shows its progress throughout, setup works with an older Git, and a GPU slowed down by heat is named on the result.",+ "summary": "Linux setup accepts the Git that current distributions ship and installs its own when needed, offline installs can download the models, the offline text encoder no longer depends on your ComfyUI, and update notes cover every version since yours.","changes": [- "Offline packages are checked once, while they are unpacked. Importing a package again, Checking packages before installing and the first start no longer read every file again.",- "The Working card shows which package is being imported and how far it is; Checking packages and Verify local files show their progress as well.",- "After the Environment package is imported, the model step no longer asks for it again.",- "On Windows, when the Git already installed is older than 2.35, setup uses FreeVideo's own verified Git instead of stopping with \"'origin' does not appear to be a git repository\". On Linux and macOS, setup names the Git version and asks for 2.35 or newer.",- "When the GPU spends most of a generation in thermal slowdown, the result says so, with the temperature and how far the clock dropped, and diagnostic reports include it."+ "Linux setup no longer stops with \"Missing git\" when Git is older than 2.35. Git 2.17 or newer on the system is used as it is (Ubuntu 22.04 ships 2.34, Ubuntu 20.04 ships 2.25). Without Git, or with an older one, setup downloads Git 2.56 from conda-forge (about 75 MB, every file checked against a pinned SHA-256) into the installation folder; the system is not changed.",+ "After importing the Environment package, the models step can download the models (49.1 GB) instead of importing model packages. Downloads resume after a stop, and model packages already imported are used first.",+ "An offline installation's text encoder uses its own copy of ComfyUI's library from the Environment package, so updating or editing that ComfyUI no longer changes prompt encoding.",+ "When an update skips versions, its notes include each version since the one you have, newest first.",+ "Downloading the report from the node panel names the file by when it was saved, as the creation panel does."]},"zh": {- "summary": "离线包导入更快,全程都能看到进度;装有旧版 Git 的电脑可以正常安装;显卡因过热降频变慢时,结果下方会说明。",+ "summary": "Linux 安装可直接使用各发行版自带的 Git,必要时自行安装;离线安装可以改为自动下载模型;离线安装的文本编码器不再受 ComfyUI 改动影响;更新说明会列出从当前版本以来的每个版本。","changes": [- "离线包只在解压时校验一次;再次导入同一个包、安装前「检查配套包」和首次启动都不再把所有文件重读一遍。",- "左侧「正在处理」卡片会显示正在导入第几个包和进度;「检查配套包」和「校验本地文件」也有进度条。",- "导入运行环境包后,模型这一步不再提示还需要运行环境包。",- "Windows 上如果已安装的 Git 低于 2.35,安装时会改用 FreeVideo 自带并校验过的 Git,不再因“'origin' does not appear to be a git repository”中断;Linux 和 macOS 会写明 Git 版本,并提示更新到 2.35 或更高版本。",- "显卡在生成过程中大部分时间因过热降频时,结果下方会说明温度和降频幅度,诊断报告中也会包含。"+ "Linux 安装不再因 Git 低于 2.35 而提示「缺少 git」。系统中 2.17 及以上的 Git 直接使用(Ubuntu 22.04 自带 2.34,Ubuntu 20.04 自带 2.25);没有 Git 或版本更低时,安装程序从 conda-forge 下载 Git 2.56(约 75 MB,每个文件按固定的 SHA-256 校验)装到安装目录内,不改动系统。",+ "导入运行环境包后,模型这一步可以选择自动下载(49.1 GB),不必再导入模型包。下载中断后可以续传,已导入的模型包优先使用。",+ "离线安装的文本编码器改用运行环境包内 ComfyUI 库的独立副本,更新或修改该 ComfyUI 不再影响提示词编码。",+ "跨版本更新时,更新说明会按从新到旧列出当前版本之后的每个版本。",+ "在节点视图下载报告时,文件按保存时间命名,与创作面板一致。"]- }+ },+ "history": [+ {+ "product_version": "0.3.11",+ "en": {+ "summary": "Importing offline packages is faster and shows its progress throughout, setup works with an older Git, and a GPU slowed down by heat is named on the result.",+ "changes": [+ "Offline packages are checked once, while they are unpacked. Importing a package again, Checking packages before installing and the first start no longer read every file again.",+ "The Working card shows which package is being imported and how far it is; Checking packages and Verify local files show their progress as well.",+ "After the Environment package is imported, the model step no longer asks for it again.",+ "On Windows, when the Git already installed is older than 2.35, setup uses FreeVideo's own verified Git instead of stopping with \"'origin' does not appear to be a git repository\". On Linux and macOS, setup names the Git version and asks for 2.35 or newer.",+ "When the GPU spends most of a generation in thermal slowdown, the result says so, with the temperature and how far the clock dropped, and diagnostic reports include it."+ ]+ },+ "zh": {+ "summary": "离线包导入更快,全程都能看到进度;装有旧版 Git 的电脑可以正常安装;显卡因过热降频变慢时,结果下方会说明。",+ "changes": [+ "离线包只在解压时校验一次;再次导入同一个包、安装前「检查配套包」和首次启动都不再把所有文件重读一遍。",+ "左侧「正在处理」卡片会显示正在导入第几个包和进度;「检查配套包」和「校验本地文件」也有进度条。",+ "导入运行环境包后,模型这一步不再提示还需要运行环境包。",+ "Windows 上如果已安装的 Git 低于 2.35,安装时会改用 FreeVideo 自带并校验过的 Git,不再因“'origin' does not appear to be a git repository”中断;Linux 和 macOS 会写明 Git 版本,并提示更新到 2.35 或更高版本。",+ "显卡在生成过程中大部分时间因过热降频时,结果下方会说明温度和降频幅度,诊断报告中也会包含。"+ ]+ }+ },+ {+ "product_version": "0.3.10",+ "en": {+ "summary": "Long videos on Windows cards with 6–16 GB run faster, Environment ZIPs from earlier versions import again, and creations made with prompt enhancement can be deleted.",+ "changes": [+ "On Windows, int8 attention needs about a quarter less GPU memory. More long or large videos now keep attention results on the graphics card instead of in system memory, which makes their steps faster. The output is unchanged.",+ "When little system memory is free, weights are now read ahead while the previous ones compute, from 1 GB of spare memory instead of 3 GB. Steps that read weights from disk get faster.",+ "An offline Environment ZIP from an earlier version is accepted again. It now only has to contain the environment this version needs, whichever version it came with.",+ "When several offline ZIPs are imported together, every one that fits is imported. One that cannot be used no longer stops the others; an environment that does not fit is installed automatically, and the imported models are still used.",+ "Creations made with prompt enhancement can be deleted from Your creations again.",+ "Each downloaded diagnostic report is named by when it was saved (FreeVideo-report-date-time.json), so downloading several no longer produces \"video.debug (1).json\", \"(2)\" and so on."+ ]+ },+ "zh": {+ "summary": "Windows 上 6–16 GB 显卡生成长视频更快;早先版本的运行环境包重新可以导入;用过提示词增强的作品可以正常删除。",+ "changes": [+ "Windows 上 int8 注意力占用的显存减少约四分之一,更多长视频或大尺寸视频的注意力结果可以留在显卡上,不再放到内存里,每步更快。生成结果不变。",+ "内存余量较少时,现在只要有 1 GB 空闲(原来需要 3 GB)就会在计算的同时预读下一批权重,需要从硬盘读权重的步骤会更快。",+ "早先版本附带的离线运行环境包重新可以导入。现在只检查包里的运行环境是否符合当前版本,不再看它来自哪个版本。",+ "同时导入多个离线包时,能用的都会导入,某个包用不了也不会再挡住其他包;运行环境不符合时会改为自动安装,已导入的模型照常使用。",+ "用过提示词增强的作品,现在可以在「你的作品」里正常删除。",+ "下载的诊断报告按保存时间命名(FreeVideo-report-日期-时间.json),多次下载不会再出现「video.debug (1).json」「(2)」这样的文件名。"+ ]+ }+ },+ {+ "product_version": "0.3.9",+ "en": {+ "summary": "Updates no longer leave earlier versions behind, updating your ComfyUI no longer reinstalls PyTorch, and a FreeVideo page that does not load completely now says why.",+ "changes": [+ "After an update, the launcher removes the earlier launcher copies and FreeVideo files it no longer uses, and shows how much space was freed. Models, outputs, files you changed and the copies your shortcuts or pinned icons open are kept.",+ "On Windows, the downloaded PyTorch packages (about 1.8 GB) are removed once every environment has them installed. They are only needed to create an environment again.",+ "When ComfyUI runs in FreeVideo's separate environment and you update ComfyUI, the launcher updates that environment before starting it, instead of downloading another one with PyTorch.",+ "An engine folder inside an existing ComfyUI is now ignored by git, so ComfyUI updaters that stash or clean untracked files no longer copy or move its models and environments.",+ "If FreeVideo’s page does not load completely in the browser, for example its styles or the creative workspace are missing, the page now says which file failed, why, and what to do. The launcher shows the same problem, and diagnostic reports include it.",+ "Opening FreeVideo from the launcher now always brings its workflow to the front, even when ComfyUI reopens the tabs from your last session."+ ]+ },+ "zh": {+ "summary": "更新后不再残留旧版本文件;升级 ComfyUI 后不再重新安装 PyTorch;FreeVideo 页面没有完整加载时会说明原因。",+ "changes": [+ "更新完成后,启动器会自动删除不再使用的旧版启动器和 FreeVideo 文件,并显示释放的空间。模型、生成结果、你改动过的文件,以及快捷方式或固定图标会打开的副本都会保留。",+ "Windows 上,所有环境都装好 PyTorch 后,会删除已下载的 PyTorch 安装包(约 1.8 GB),这些安装包只在重新创建环境时才需要。",+ "ComfyUI 在 FreeVideo 准备的独立环境中运行时,升级 ComfyUI 后,启动器会在启动前更新这个环境,不再另外下载一整套带 PyTorch 的环境。",+ "放在已有 ComfyUI 里的引擎文件夹现在会被 git 忽略,ComfyUI 更新工具暂存或清理未跟踪文件时,不会再复制或移走其中的模型和环境。",+ "浏览器里的 FreeVideo 页面没有完整加载时(例如样式丢失或创作面板打不开),页面会写明是哪个文件、什么原因、该怎么处理;启动器也会显示同样的问题,诊断报告中也会包含。",+ "从启动器打开 FreeVideo 时,即使 ComfyUI 恢复了上次的标签页,FreeVideo 工作流也会显示在最前面。"+ ]+ }+ },+ {+ "product_version": "0.3.8",+ "en": {+ "summary": "Downloads that cannot resume now start again by themselves, and the ComfyUI setup panel explains why Install / repair is unavailable.",+ "changes": [+ "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 内的安装面板会说明「安装/修复」暂不可用的原因。",+ "changes": [+ "模型下载中断且无法续传时,安装会自动从头重新下载该文件,不再每次重试都停下;未完成的文件会另行保留。",+ "模型准备停止时,提示会写明具体的文件和原因,而不是笼统的「准备已停止」。",+ "ComfyUI 内的安装面板会在按钮下方说明「安装/修复」暂不可用的原因:需要先「检测并预览」、勾选同意,或先解决计划中标红的问题;修改设置后会清除过期的计划。"+ ]+ }+ },+ {+ "product_version": "0.3.7",+ "en": {+ "summary": "Installation no longer stops with \"Select at most 64 model libraries\" when ComfyUI has many model folders.",+ "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."+ ]+ },+ "zh": {+ "summary": "修复 ComfyUI 模型目录较多时,安装提示「Select at most 64 model libraries」的问题。",+ "changes": [+ "修复 ComfyUI 模型目录超过十个时,安装停在「Select at most 64 model libraries」的问题。同一个目录现在只计一次;找到的目录超过 64 个时使用前 64 个,安装照常进行。",+ "已保存的模型文件夹如果已被删除(例如删除了离线包目录),会自动跳过,不再阻止安装或离线导入。"+ ]+ }+ },+ {+ "product_version": "0.3.6",+ "en": {+ "summary": "int8 generation keeps more of its work on the graphics card: 8 to 24 GB cards render longer and larger videos faster, and running out of graphics memory once no longer slows later videos.",+ "changes": [+ "int8 attention needs 1 to 2.7 GB less graphics memory, with identical results. Videos that used to keep attention in system memory now stay on the card where they fit, for example 1344x768 for 10 s on 8 GB cards, 20 s on 12 GB cards and 1920x1088 on 16 GB cards. Their refinement steps run up to about 1.3x faster on Windows and 2x on Linux.",+ "Long 1920x1088 videos on 16 GB cards keep attention on the card and stage only the residual stream in system memory, which also leaves about 6 GB more system memory free.",+ "After running out of graphics memory, the retry only halves the attention head group instead of shrinking every work partition. If the retry had memory to spare, the next video tries the planned settings again.",+ "On Windows the first pass keeps half a gigabyte below the graphics memory budget, so its weight cache no longer spills into shared memory.",+ "Offline installation also takes the optional Reference audio pack. Imported with the other packs, it lets audio references work without downloading their tables first."+ ]+ },+ "zh": {+ "summary": "int8 生成更多地留在显卡上:8 到 24 GB 显卡能更快地生成更长、更大的视频;偶尔显存不足也不再拖慢之后的视频。",+ "changes": [+ "int8 注意力少用 1 到 2.7 GB 显存,生成结果完全相同。以前需要把注意力放到内存的视频,现在放得下就留在显卡上,例如 8 GB 显卡的 1344×768 10 秒、12 GB 显卡的 20 秒、16 GB 显卡的 1920×1088。这些视频的精修步骤在 Windows 上最多快约 1.3 倍,在 Linux 上约 2 倍。",+ "16 GB 显卡生成 1920×1088 长视频时,注意力留在显卡上,只把残差放到内存,内存也多空出约 6 GB。",+ "显存不足时,重试只把注意力分组减半,不再把所有分块都降到最小;如果重试时显存还有富余,下一个视频会重新使用原来的设置。",+ "Windows 上第一遍会在显存预算下留出 0.5 GB 余量,权重缓存不再溢出到共享内存。",+ "离线安装可以一起导入可选的「音频参考缓存」包,用音频做参考时不必再联网下载对应的缓存。"+ ]+ }+ },+ {+ "product_version": "0.3.5",+ "en": {+ "summary": "Audio references now guide the voice and sound of the generated video much more closely.",+ "changes": [+ "Audio references work as intended: a reference voice or soundtrack, including the sound of a reference video, now guides the generated audio. In our tests, the generated voice matched the reference voice far more closely.",+ "Audio references use an updated sampling cache (0.3–0.7 GB per quality level). It downloads automatically the first time you use an audio reference, so there is nothing to do before then; the previous cache is removed afterwards.",+ "Mono reference audio keeps its original volume."+ ]+ },+ "zh": {+ "summary": "音频参考效果大幅改进,生成的声音会更贴近参考音频的音色。",+ "changes": [+ "改进音频参考:参考音频(包括参考视频自带的声音)现在能正确引导生成的声音。我们的测试中,生成的人声与参考音色明显更接近。",+ "使用音频参考需要更新采样缓存(每个质量档 0.3–0.7 GB),首次使用音频参考时会自动下载,不使用可以忽略;下载完成后会自动删除旧缓存。",+ "单声道参考音频保持原有音量。"+ ]+ }+ },+ {+ "product_version": "0.3.4",+ "en": {+ "summary": "Diagnostic report saves the diagnostic report in one click. If you submit it on GitHub, we'll optimize FreeVideo specifically for your setup.",+ "changes": [+ "Diagnostic report saves the redacted diagnostic report in one click. If you submit it on GitHub, we'll optimize FreeVideo specifically for your setup, and it helps other users too. The report has hardware details, settings and timings only, with no prompts, reference images or videos.",+ "After a video finishes, a card under the buttons invites you to submit the report. Once closed, it does not come back, and it never covers the video."+ ]+ },+ "zh": {+ "summary": "新增「诊断报告」按钮,一键保存诊断报告;欢迎在 GitHub 提交,我们会针对您的硬件配置进行专门优化。",+ "changes": [+ "新增「诊断报告」按钮,一键保存脱敏的诊断报告。欢迎在 GitHub 提交,我们会针对您的硬件配置进行专门优化,也能帮助其他用户。报告仅包含硬件信息、生成参数和耗时,不含提示词、参考图或视频。",+ "视频生成完成后,按钮下方会显示提交诊断报告的提示;关闭后不再出现,也不会遮挡视频。"+ ]+ }+ },+ {+ "product_version": "0.3.3",+ "en": {+ "summary": "Runs the int8 model on 6 GB graphics cards and imports the int8 offline packs.",+ "changes": [+ "Graphics cards with 6 GB of memory, such as a laptop RTX 3060, can now generate with the int8 model instead of being refused, and 8 to 12 GB cards can make longer videos. These runs use a low-memory mode, which is slower, and FreeVideo says so while generating. When a request still does not fit, the message names sizes and lengths that fit now.",+ "The launcher imports the new int8 offline packs: video model, text encoder, video & audio decoder, and sampling caches."+ ]+ },+ "zh": {+ "summary": "6 GB 显存的显卡可以用 int8 模型生成,并支持导入 int8 离线包。",+ "changes": [+ "6 GB 显存的显卡(例如笔记本 RTX 3060)现在可以用 int8 模型生成,不再被拒绝;8 到 12 GB 的显卡也能生成更长的视频。这时会改用省显存方式,速度会慢一些,生成时会提示。如果仍然放不下,提示里会给出这台电脑现在能生成的尺寸和时长。",+ "启动器支持导入新的 int8 离线包:视频模型、文本编码器、视频与音频解码器、采样缓存。"+ ]+ }+ },+ {+ "product_version": "0.3.2",+ "en": {+ "summary": "Adds Preview first to two-pass sampling, deleting in Your creations and prompt box improvements (the example prompt as a placeholder, the last prompt restored on reopening), and fixes installing into folders with spaces.",+ "changes": [+ "Two-pass sampling can stop at a quick half-resolution preview: choose Two-pass: Preview first. When a preview looks right, choose Run second pass; the finished video is identical to generating it directly. Make several previews in a batch and pick one in Your creations.",+ "Your creations can delete videos you no longer need, after a confirmation.",+ "The example prompt is shown greyed out as a placeholder. Typing replaces it without clearing the box first, and a box that was never typed in generates the example. A box emptied after typing stays empty.",+ "Prompt enhancement rewrites the prompt that was typed. With an empty box, turning it on asks for a prompt first.",+ "Replacing or clearing all of the enhanced text starts a new prompt, which is enhanced before generating. Small edits still adjust the enhanced version.",+ "FreeVideo reopens with the last prompt, finished, unfinished or emptied, and its enhancement setting.",+ "Installing into a folder whose path contains a space, such as \"Comfy UI\", stopped at the PyTorch step with \"File not found\". It installs normally now."+ ]+ },+ "zh": {+ "summary": "二次采样新增「先出预览」,作品可以删除,提示词框改进(示例提示词以灰色占位显示,重新打开时恢复上次的提示词),并修复安装路径含空格时无法安装的问题。",+ "changes": [+ "二次采样新增「先出预览」:先用半分辨率快速出一版预览,满意后点「继续二采」,成片与直接生成完全一致。可以批量出几版预览,在「作品」里挑一版继续二采。",+ "「作品」里可以删除不需要的视频,删除前会确认。",+ "示例提示词以灰色占位显示,直接输入即可替换,无需先清空;未输入过时按示例生成,输入后再清空则保持为空。",+ "提示词增强改写已输入的提示词。提示词框为空时开启增强,会提示先输入提示词。",+ "在改写版中全选替换或清空后重新输入,会作为新的提示词,生成前自动改写;局部修改仍只调整改写版。",+ "重新打开 FreeVideo 时恢复上次编写的提示词(包括未写完或已清空的内容)及增强设置。",+ "安装位置的路径中有空格(例如「Comfy UI」)时,安装会停在 PyTorch 步骤并报「File not found」。现在可以正常安装。"+ ]+ }+ },+ {+ "product_version": "0.3.1",+ "en": {+ "summary": "Fixes the int8 upgrade on older installations and importing the Environment ZIP.",+ "changes": [+ "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.",+ "Importing the Environment ZIP failed with \"No such file or directory: windows-portable.txt\". It imports again."+ ]+ },+ "zh": {+ "summary": "修复较早安装的用户无法升级到 int8 模型,以及运行环境包无法导入的问题。",+ "changes": [+ "较早安装的用户升级到 int8 模型时,会停在「下载比显示的大」。现在显示的下载量包含升级要下载的全部文件(例如采样表),可以正常完成升级。",+ "导入运行环境包时会报「找不到 windows-portable.txt」,现在可以正常导入。"+ ]+ }+ }+ ]}diff --git a/freevideo_engine/release_notes.py b/freevideo_engine/release_notes.pyindex 625e168..2926092 100644--- a/freevideo_engine/release_notes.py+++ b/freevideo_engine/release_notes.py@@ -38,6 +38,39 @@ def notes(value):return result if len(json.dumps(result).encode('utf-8')) <= MAX_NOTES_BYTES else None+MAX_HISTORY = 12+++def version_key(value):+ return tuple(int(part) for part in value.split('.'))+++def history(value, before=None):+ """Earlier versions' notes, newest first; a malformed entry is left out.++ An update can skip versions; their notes travel with the newest build so+ the dialog can show everything since the installed version.+ """+ rows = []+ for row in value[:MAX_HISTORY] if isinstance(value, list) else []:+ version = product_version(row.get('product_version')) if isinstance(row, dict) else None+ # release_notes.json lists en/zh beside the version; manifests nest them.+ release = (notes(row.get('release_notes') if 'release_notes' in row else dict(row, schema=1))+ if version else None)+ if release and (before is None or version_key(version) < version_key(before)):+ rows.append(dict(product_version=version, release_notes=release))+ return sorted(rows, key=lambda r: version_key(r['product_version']), reverse=True)+++def since(release, installed):+ """The notes of every version after the installed one, up to and excluding `release` itself."""+ current = product_version(installed) if installed else None+ rows = (release or {}).get('release_history') or []+ if not current:+ return []+ return [row for row in rows if version_key(row['product_version']) > version_key(current)]++def optional_fields(value):result = {}if not isinstance(value, dict):@@ -47,6 +80,9 @@ def optional_fields(value):result['product_version'] = versionif release:result['release_notes'] = release+ earlier = history(value.get('release_history'), before=version)+ if version and earlier:+ result['release_history'] = earlierreturn result@@ -57,7 +93,10 @@ def catalog(package=None):version, release = product_version(value.get('product_version')), notes(value)if not version or not release:raise ValueError('Release notes need a product version and complete English/Chinese text')- return dict(product_version=version, release_notes=release)+ earlier = history(value.get('history'), before=version)+ if len(earlier) != len(value.get('history') or []):+ raise ValueError('Every earlier version in release_notes.json needs complete English/Chinese text')+ return dict(product_version=version, release_notes=release, **({'release_history': earlier} if earlier else {}))def public_details(value):diff --git a/pyproject.toml b/pyproject.tomlindex 7953ac9..dcc4114 100644--- a/pyproject.toml+++ b/pyproject.toml@@ -32,4 +32,4 @@ include = ["freevideo_engine*"][tool.setuptools.package-data]"freevideo_engine.prompt_vlm" = ["model.json"]-freevideo_engine = ["build-version.txt", "build-identity.json", "release_notes.json", "dependencies.json", "model_files.json", "model_shares.json", "prepared_models.json", "macos_reference_catalog.json", "superseded_tables.json", "bootstrap_versions.json", "uv_downloads.json", "torch_downloads.json", "test_prompts.json", "windows_bootstrap.ps1", "assets/*.png", "assets/*.ico", "launcher/*.qml", "launcher/licenses/*.txt", "licenses/*.txt"]+freevideo_engine = ["build-version.txt", "build-identity.json", "release_notes.json", "dependencies.json", "model_files.json", "model_shares.json", "prepared_models.json", "macos_reference_catalog.json", "superseded_tables.json", "bootstrap_versions.json", "git_linux.json", "uv_downloads.json", "torch_downloads.json", "test_prompts.json", "windows_bootstrap.ps1", "assets/*.png", "assets/*.ico", "launcher/*.qml", "launcher/licenses/*.txt", "licenses/*.txt"]diff --git a/scripts/test_freevideo_entry.mjs b/scripts/test_freevideo_entry.mjsindex bd738e6..a1c8da3 100644--- a/scripts/test_freevideo_entry.mjs+++ b/scripts/test_freevideo_entry.mjs@@ -43,7 +43,7 @@ test('main browser entry registers both views and preserves node hooks', async (installNavigation: callback => installed.push(callback),refreshNavigation: () => refreshed++, preferredView: () => null,attachReferencePicker() {}, referenceItems: () => [], syncReferencePrompt() {},- shareButton: () => new Element('button'),+ shareButton: () => new Element('button'), reportFileName: () => 'FreeVideo-report-20261008-101530.json',rememberPromptDraft() {}, savePromptDraft: async () => false,};const previous = new Map();@@ -69,6 +69,7 @@ test('main browser entry registers both views and preserves node hooks', async (.replace("import { attachReferencePicker, referenceItems, syncReferencePrompt } from './prompt_references.js';", 'const {attachReferencePicker,referenceItems,syncReferencePrompt} = globalThis.__freevideoEntryTest;').replace("import { outputDownloadURL } from './output_download.js';", 'const {outputDownloadURL} = globalThis.__freevideoEntryTest;').replace("import { shareButton } from './share.js';", 'const {shareButton} = globalThis.__freevideoEntryTest;')+ .replace("import { reportFileName } from './report_issue.js';", 'const {reportFileName} = globalThis.__freevideoEntryTest;').replace("import { rememberPromptDraft, savePromptDraft } from './prompt_draft.js';", 'const {rememberPromptDraft,savePromptDraft} = globalThis.__freevideoEntryTest;').replace("import { regenerateResult, upscaleResult } from './studio_queue.js';", 'const {regenerateResult,upscaleResult} = globalThis.__freevideoEntryTest;').replace("import { installNavigation, refreshNavigation, preferredView } from './view_navigation.js';", 'const {installNavigation,refreshNavigation,preferredView} = globalThis.__freevideoEntryTest;');diff --git a/web/freevideo.js b/web/freevideo.jsindex cfbe04a..cdf9f06 100644--- a/web/freevideo.js+++ b/web/freevideo.js@@ -10,6 +10,7 @@ import { installNavigation, refreshNavigation, preferredView } from './view_naviimport { attachReferencePicker, referenceItems, syncReferencePrompt } from './prompt_references.js';import { outputDownloadURL } from './output_download.js';import { shareButton } from './share.js';+import { reportFileName } from './report_issue.js';import { rememberPromptDraft, savePromptDraft } from './prompt_draft.js';import { regenerateResult, upscaleResult } from './studio_queue.js';@@ -310,7 +311,10 @@ function resultPanel(node) {const links = el("div", undefined, "fv-links");for (const [label, file] of [[text("Download video", "下载视频"), value.video], [text("Report", "报告"), value.report]]) {if (!file) continue;- const link = el("a", label); link.href = outputDownloadURL(api, file); link.download = file === value.video ? '' : file.split("/").pop(); links.append(link);+ const link = el("a", label); link.href = outputDownloadURL(api, file); link.download = file === value.video ? '' : reportFileName();+ // Named when clicked, like the creation panel's report: saving it again is not "video.debug (1).json".+ if (file !== value.video) link.onclick = () => { link.download = reportFileName(); };+ links.append(link);}links.append(shareButton(value, text));links.append(el("span", value.result_cache_hit ? text("Reused previous result", "已复用上次结果") : value.conditioning_cache_hit ? text("Input cache reused", "已复用输入缓存") : text("Inputs encoded", "已编码输入"), "fv-mode"));diff --git a/web/updates.css b/web/updates.cssindex d3c2f00..126cbd1 100644--- a/web/updates.css+++ b/web/updates.css@@ -14,5 +14,5 @@.fv-version-info{font:inherit;font-size:12px;color:var(--fv-muted);background:transparent;border:0;border-radius:6px;padding:6px 10px;cursor:pointer;white-space:nowrap}.fv-version-info:hover{background:var(--fv-hover);color:var(--fv-ink)}.fv-release-notes{box-sizing:border-box;width:min(580px,calc(100vw - 32px));max-height:calc(100dvh - 48px);padding:24px;border:1px solid var(--fv-border,#354152);border-radius:16px;background:var(--fv-canvas,#161e29);color:var(--fv-ink,#e7edf7);font:14px/1.7 var(--fv-font,system-ui);overflow:auto;overflow-wrap:anywhere}-.fv-release-notes::backdrop{background:#0009}.fv-release-notes h2{margin:0 0 20px;font-size:20px}.fv-release-notes h3{font-size:16px;margin:0 0 4px}.fv-release-notes section+section{border-top:1px solid var(--fv-border,#354152);margin-top:24px;padding-top:20px}.fv-release-notes p{margin:8px 0}.fv-release-notes .fv-release-build{font-size:12px;color:var(--fv-muted,#a5b3c6)}.fv-release-notes ul{padding-left:22px}.fv-release-notes li+li{margin-top:8px}+.fv-release-notes::backdrop{background:#0009}.fv-release-notes h2{margin:0 0 20px;font-size:20px}.fv-release-notes h3{font-size:16px;margin:0 0 4px}.fv-release-notes h4{font-size:14px;margin:18px 0 0;color:var(--fv-ink,#e7edf7)}.fv-release-notes section+section{border-top:1px solid var(--fv-border,#354152);margin-top:24px;padding-top:20px}.fv-release-notes p{margin:8px 0}.fv-release-notes .fv-release-build{font-size:12px;color:var(--fv-muted,#a5b3c6)}.fv-release-notes ul{padding-left:22px}.fv-release-notes li+li{margin-top:8px}.fv-release-notes button{font:inherit;color:inherit;background:var(--fv-hover,#2a3341);border:0;border-radius:8px;padding:6px 18px;cursor:pointer}.fv-release-notes :focus-visible,.fv-version-info:focus-visible{outline:2px solid var(--fv-accent,#8eb8fb);outline-offset:2px}diff --git a/web/updates.js b/web/updates.jsindex 85e9aed..d58dd87 100644--- a/web/updates.js+++ b/web/updates.js@@ -18,6 +18,16 @@ const displayVersion = release => release?.product_version ? 'v' + release.produ// The running release's product version ("0.3.4"), once the first check has answered.export const productVersion = () => value?.current_release?.product_version || null;const localizedNotes = (release, cn) => release?.release_notes?.[cn ? 'zh' : 'en'];+const versionParts = value => String(value || '').split('.').map(Number);+const newerThan = (a, b) => {+ const [x, y] = [versionParts(a), versionParts(b)];+ for (let i = 0; i < 3; i++) if (x[i] !== y[i]) return x[i] > y[i];+ return false;+};+// Versions between the installed one and the update, newest first: an+// update that skips versions still shows what each of them changed.+export const earlierNotes = (release, installed) => installed+ ? (release?.release_history || []).filter(row => newerThan(row.product_version, installed)) : [];const publish = () => { for (const render of listeners) render(); };const later = ms => { clearTimeout(timer); timer = setTimeout(checkUpdates, ms); };@@ -156,7 +166,9 @@ export function createUpdateNotice(cn) {element.hidden = !text;element.classList.toggle('fv-update-working', busy);label.textContent = text;- summary.textContent = actions ? localizedNotes(candidate, cn)?.summary || '' : '';+ const skipped = actions ? earlierNotes(candidate, productVersion()).length : 0;+ summary.textContent = actions ? (localizedNotes(candidate, cn)?.summary || '')+ + (skipped ? ' ' + t(`Includes the changes of ${skipped} earlier version${skipped > 1 ? 's' : ''}.`, `另含此前 ${skipped} 个版本的更新。`) : '') : '';summary.hidden = !summary.textContent;details.hidden = !actions;const direct = !!launcher && !launcher.manual && !failure;@@ -194,7 +206,20 @@ function showReleaseNotes(cn) {for (const item of notes?.changes || []) {const row = document.createElement('li'); row.textContent = item; list.append(row);}- section.append(list); body.append(section);+ section.append(list);+ if (release === value?.available) {+ for (const row of earlierNotes(release, value?.current_release?.product_version)) {+ const earlier = localizedNotes(row, cn);+ const name = document.createElement('h4'); name.textContent = 'v' + row.product_version;+ const text = document.createElement('p'); text.textContent = earlier?.summary || '';+ const items = document.createElement('ul');+ for (const item of earlier?.changes || []) {+ const entry = document.createElement('li'); entry.textContent = item; items.append(entry);+ }+ section.append(name, text, items);+ }+ }+ body.append(section);}if (!body.childElementCount) body.textContent = t('Version information is not available yet.', '暂时无法获取版本信息。');};