Skip to content

The all-in-one local AI studio for your desktop: chat, image and video generation and a coding agent in one free, open source app. Windows and Linux. No Docker, no terminal, no cloud required.

hotfix v2.4.5: Bug F + Arch live E2E verification

purple876b050b23fd
diff --git a/CHANGELOG.md b/CHANGELOG.md
index dba029b7..0b03852f 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -6,7 +6,7 @@ All notable changes to Locally Uncensored are documented here.
## [2.4.5] - 2026-05-17
-Drop-in hotfix on top of v2.4.4. Five user-reported bugs collected from Discord, Reddit, and GitHub Issues / Discussions between v2.4.4-release (2026-05-11) and 2026-05-17.
+Drop-in hotfix on top of v2.4.4. Six bugs total: five user-reported (A — Discord/Reddit; B — GH #38; C — GH Discussion #39; D — Discord; E — GH #32 comment) plus one discovered during the Arch live verification sweep (F).
### Fixed — image / video creation
- **Video output now actually produces `.mp4` files** (Bug A — miguelkodoatie Discord 14.05., Turbulent_Tomato7559 Reddit 10.05.). v2.4.4 added a warning when ComfyUI lacked `VHS_VideoCombine`, but the fallback to `SaveAnimatedWEBP` still produced an animated `.webp` "image" instead of a video. v2.4.5 turns the warning into a blocking modal with three options: install VHS now (one-click git clone + pip + ComfyUI restart, ~30 s), continue with `.webp`, or cancel. New entry `videohelpersuite` added to `CUSTOM_NODE_REGISTRY` in `src/api/discover.ts`, new `VhsInstallModal` component in `CreateView`, and a Promise-resolver bridge in `createStore.vhsInstallPrompt` so `useCreate.generate()` can await the user's choice. The install path re-builds the workflow after ComfyUI comes back, so the user gets a proper MP4 on the same Generate click instead of having to retry.
@@ -20,6 +20,9 @@ Drop-in hotfix on top of v2.4.4. Five user-reported bugs collected from Discord,
### Fixed — Linux / AppImage
- **Arch / Wayland AppImage now actually paints content** (Bug D — emilmjt Discord 11.05.). The "empty window" symptom on Arch is Tauri 2 + webkit2gtk-4.1 silently failing on DMABUF buffer-sharing and DMA-compositing paths on certain Mesa versions (tauri-apps/tauri#9304). `src-tauri/src/main.rs` now sets `WEBKIT_DISABLE_DMABUF_RENDERER=1` and `WEBKIT_DISABLE_COMPOSITING_MODE=1` at startup on Linux, falling back to software composite — same workaround the GNOME and KDE maintainers recommend. Only set when the user hasn't already exported the vars themselves. `tauri.conf.json` also now declares explicit `bundle.linux.deb.depends` and `bundle.linux.rpm.depends` for `webkit2gtk-4.1`, `gtk3`, and `libayatana-appindicator3-1`, and enables `bundleMediaFramework` on AppImage so gstreamer plugins ship inside the AppImage instead of relying on the host distribution.
+### Fixed — Linux / custom-node install
+- **`install_custom_node` now uses the ComfyUI venv when present** (Bug F — discovered during Arch live verification 2026-05-17). The `install_custom_node` Tauri command (used by Bug A's VHS install path among others) used to call pip against `state.python_bin` (the system Python). On Arch and other PEP 668 distros the requirements install would silently fail with `error: externally-managed-environment` — and since the function did `let _ = pip.output()` and ignored the exit code, the user got a "installed" status while the requirements never actually landed. The next workflow build then crashed with `ModuleNotFoundError`. `install_custom_node` now (1) resolves `<ComfyUI>/venv` via the shared `resolve_comfyui_venv_python()` helper from `src-tauri/src/python.rs`, falling back to `state.python_bin` only when no venv exists, and (2) captures pip's exit status + stderr and runs them through `diagnose_pip_error` so PEP 668 / connection / disk-full / etc. surface actionable messages. This bug only fired on PEP 668 distros (Arch / Debian 12+ / Fedora 38+ / Ubuntu 23.04+) when the user installed ComfyUI through LU's installer (which creates the venv) and then tried to install any custom node afterwards.
+
### Fixed — Linux / ComfyUI install
- **PEP 668 protected Pythons (Arch, Debian 12+, Fedora 38+, Ubuntu 23.04+) no longer brick the ComfyUI install** (Bug E — rzgrozt GH #32 comment 2026-05-08). A bare `python -m pip install torch ...` exits with `error: externally-managed-environment` on those distros because the stdlib carries an `EXTERNALLY-MANAGED` marker file. v2.4.5 detects the marker via `sysconfig.get_path('stdlib')`, then runs `python -m venv <ComfyUI>/venv` and uses the venv's Python for every subsequent pip step. New helpers `is_pep668_protected`, `create_comfyui_venv`, and `venv_python_path` live in `src-tauri/src/commands/install.rs` and `src-tauri/src/python.rs`. `process.rs::start_comfyui` and `auto_start_comfyui` mirror the lookup so ComfyUI launches with the venv Python it was installed against — no `ModuleNotFoundError: torch` on first run. When the system Python's `venv` module is missing (some minimal Arch installs), the error now surfaces a one-line fix: `sudo pacman -S python-virtualenv` (or `apt install python3-venv` / `dnf install python3-virtualenv`). `diagnose_pip_error` also catches the externally-managed string directly as a fallback for anyone whose Python somehow bypasses the venv path.
@@ -34,7 +37,7 @@ Drop-in hotfix on top of v2.4.4. Five user-reported bugs collected from Discord,
- **Bug B**: Suspended ComfyUI via `NtSuspendProcess` while user navigates back to Create tab → triggers `useEffect` re-mount, `pollStatus` re-starts, detects ComfyUI down. Live-verified entire UI sequence: (1) "ComfyUI loading (12s)" elapsed-counter banner, (2) switch to actionable "ComfyUI is taking unusually long (86s)" panel after 60s threshold, (3) failure-mode explanation text rendered, (4) "View logs" toggle works (button label flips to "Hide logs"), (5) empty-logs fallback message renders ("No startup logs captured yet — ComfyUI hasn't emitted anything to stdout."), (6) "Kill process" button actually kills the spawned ComfyUI process (verified via PID gone + port 8188 free), (7) state machine transitions cleanly to "ComfyUI not responding" with Retry, (8) Retry click respawns ComfyUI which comes back online.
- **Bug C**: Disabled the qwen2.5:0.5b blob (`sha256-c5396e...`) → triggered LU's startup health scan → banner "Ollama 0.20.7 broke 1 of your model. qwen2.5:0.5b" appeared + inline "stale — refresh? ↻ Refresh" chip next to Lichtschalter. Clicked "Refresh all" → `pullModel` triggered → DownloadBadge showed completion within seconds. Note: Ollama 0.20.7 transforms ALL blob errors (missing OR 0-byte corrupted) into the `"X does not support generate"` pattern, so the new `missing-blob` regex primarily protects users on older Ollama versions (Anson192's exact scenario on RTX 4090). Both error paths route to the same one-click repair UX.
- **Bug D**: Linux webkit env-var function unit-tested cross-platform via 5 cargo tests (sets-both-when-unset, preserves user DMABUF override, preserves user COMPOSITING override, preserves empty-string as explicit unset, idempotent). Arch VirtualBox boot test deferred — env-var workaround is the documented upstream-recommended fix for the symptom class.
-- **Bug E**: PEP 668 detection + venv creation unit-tested cross-platform via 13 cargo tests across `install.rs::tests` and `python.rs::tests`. Path-layout tests cover both Windows (`venv/Scripts/python.exe`) and Unix (`venv/bin/python`) layouts. Resolver tests use real tempdirs to verify the `Some(path)` vs `None` gating. Diagnose tests cover Arch's exact `error: externally-managed-environment` string from rzgrozt's report plus the shorter `error: externally-managed` variant and confirm the suggested distro-install commands (`pacman -S python-virtualenv`, `apt install python3-venv`, `dnf install python3-virtualenv`) appear in the user-facing hint. Live Arch boot test deferred — same constraint as Bug D (no Arch box on dev machine); the venv approach is the standard answer to PEP 668 (used by every Python tool that touches Arch / Debian 12 / Fedora 38) so the structural-correctness bar is very different from a hardware-driven bug.
+- **Bug E**: PEP 668 detection + venv creation unit-tested cross-platform via 13 cargo tests across `install.rs::tests` and `python.rs::tests`. Path-layout tests cover both Windows (`venv/Scripts/python.exe`) and Unix (`venv/bin/python`) layouts. Resolver tests use real tempdirs to verify the `Some(path)` vs `None` gating. Diagnose tests cover Arch's exact `error: externally-managed-environment` string from rzgrozt's report plus the shorter `error: externally-managed` variant and confirm the suggested distro-install commands (`pacman -S python-virtualenv`, `apt install python3-venv`, `dnf install python3-virtualenv`) appear in the user-facing hint. **Plus a HARDCORE LIVE E2E test (`pep668_e2e_live_detect_and_create_venv`, `#[ignore]`'d so it runs on demand) drives the full flow against a real Python install whose stdlib has a real `EXTERNALLY-MANAGED` marker file. The test verifies: (1) `is_pep668_protected` returns true against the marker-planted Python, (2) `create_comfyui_venv` succeeds and produces the venv-Python at `<ComfyUI>/venv/{Scripts|bin}/python(.exe)`, (3) the nested venv's pip runs without inheriting the PEP 668 block (the whole point of the fix), (4) a second `create_comfyui_venv` call is idempotent. Setup + run scripted in `LU-E2E-Test-Kit/scripts/pep668_live_test.ps1`: robocopies the system Python to a writable temp dir, plants the marker in the copy's stdlib (NOT the real system Python — that would wedge every pip on the box), runs cargo with `LU_PEP668_TEST_PYTHON` set, cleans up. Result: all 4 phases passed against Python 3.11.7 + planted marker on 2026-05-17.** **AND — on top of the Windows simulation — Bug E was ALSO live-verified against a REAL Arch Linux ISO booted in a VirtualBox VM on 2026-05-17. The Arch live ISO ships Python 3.14.4 with the actual `/usr/lib/python3.14/EXTERNALLY-MANAGED` marker (multiline Arch text mentioning `pacman -S python-xyz`, identical to what rzgrozt's installer saw). Seven assertions all passed against this real environment: detection logic returns `YES`, `python -m venv` succeeds, venv Python lands at `/tmp/foo/venv/bin/python` (matching the Unix branch of `venv_python_path`), pip inside the venv is unblocked (downloads requests metadata without `externally-managed` error), idempotency holds, and the Rust-side equivalence of the shell probe matches verbatim. See `LU-E2E-Test-Kit/scripts/arch_live_e2e.md` for the full transcript. This live test also uncovered Bug F (separate fix above).**
## [2.4.4] - 2026-05-11
diff --git a/src-tauri/src/commands/install.rs b/src-tauri/src/commands/install.rs
index fe365162..2863a2ca 100644
--- a/src-tauri/src/commands/install.rs
+++ b/src-tauri/src/commands/install.rs
@@ -1747,14 +1747,53 @@ pub fn install_custom_node(
// Install requirements.txt if it exists
let reqs = target_dir.join("requirements.txt");
if reqs.exists() {
- let python_bin = state.python_bin.lock().unwrap().clone();
- println!("[Install] Installing requirements for {}...", node_name);
+ // Bug F (discovered during Arch live test on 2026-05-17):
+ // ComfyUI was installed into a venv by the Bug E path, but
+ // this function used to call pip against `state.python_bin`
+ // (the system Python). On Arch / Debian 12+ / Fedora 38+
+ // that hits PEP 668's `externally-managed-environment` and
+ // the requirements install silently fails (`let _ = pip.output()`
+ // ignored the exit code, so the user got "installed" even
+ // when requirements never landed — the next workflow build
+ // would then crash with `ModuleNotFoundError`).
+ //
+ // Fix: prefer the ComfyUI venv's Python (matches the launcher
+ // in `process.rs::start_comfyui` and the installer in
+ // `install_comfyui`) so requirements land in the same
+ // site-packages ComfyUI actually imports from. Plus we now
+ // surface a useful error when pip fails instead of swallowing it.
+ let venv_python = crate::python::resolve_comfyui_venv_python(&comfy_dir);
+ let python_bin = venv_python.unwrap_or_else(|| {
+ state.python_bin.lock().unwrap().clone()
+ });
+ if python_bin.is_empty() {
+ return Err(format!(
+ "Custom node {} cloned, but cannot install requirements: \
+ no Python available. Install Python first \
+ (Settings → ComfyUI → Install Python).",
+ node_name
+ ));
+ }
+ println!("[Install] Installing requirements for {} via {}", node_name, python_bin);
let mut pip = Command::new(&python_bin);
- pip.args(["-m", "pip", "install", "-r"]).arg(&reqs)
+ pip.args(["-m", "pip", "install", "--no-input", "-r"]).arg(&reqs)
.stdout(Stdio::piped()).stderr(Stdio::piped());
#[cfg(target_os = "windows")]
pip.creation_flags(CREATE_NO_WINDOW);
- let _ = pip.output();
+ let pip_out = pip.output()
+ .map_err(|e| format!("Failed to spawn pip for {} requirements: {}", node_name, e))?;
+ if !pip_out.status.success() {
+ let stderr = String::from_utf8_lossy(&pip_out.stderr);
+ let stdout = String::from_utf8_lossy(&pip_out.stdout);
+ let combined = format!("{}{}", stdout, stderr);
+ // Reuse the install_comfyui diagnose path so PEP 668 +
+ // friends produce actionable messages here too.
+ let diagnosis = diagnose_pip_error(&combined);
+ return Err(format!(
+ "Custom node {} cloned, but requirements install failed.\n\n{}",
+ node_name, diagnosis
+ ));
+ }
}
Ok(serde_json::json!({
@@ -2103,4 +2142,92 @@ mod tests {
"error: externally-managed-environment"
));
}
+
+ // ── Bug E — LIVE integration test ──────────────────────────────────────
+ //
+ // Runs against a real Python install with a real EXTERNALLY-MANAGED
+ // marker planted in its stdlib. Requires the caller to point
+ // `LU_PEP668_TEST_PYTHON` env var at a Python whose stdlib is writable
+ // (typically a temp copy of system Python — see
+ // `LU-E2E-Test-Kit/scripts/pep668_live_test.ps1` for the setup helper).
+ //
+ // Skipped by default via `#[ignore]` because:
+ // 1. needs a real, modifiable Python install (not safe to mutate the
+ // system Python's stdlib — wedges every pip command on the box).
+ // 2. writes to the filesystem and spawns 4-5 Python subprocesses.
+ //
+ // Run with: `cargo test --release --bins -- --ignored pep668_e2e_live`
+
+ #[test]
+ #[ignore]
+ fn pep668_e2e_live_detect_and_create_venv() {
+ let fake_python = std::env::var("LU_PEP668_TEST_PYTHON")
+ .expect("set LU_PEP668_TEST_PYTHON to the fake-python path before running");
+ assert!(
+ std::path::Path::new(&fake_python).exists(),
+ "LU_PEP668_TEST_PYTHON does not exist: {}",
+ fake_python
+ );
+
+ // The helper script must have planted the marker BEFORE this test
+ // runs. If it didn't, the detection should return false — that's
+ // also informative, so we don't fail outright here; we just print
+ // and check the more interesting assertions.
+
+ // ── Phase 1: PEP 668 detection ──
+ let detected = is_pep668_protected(&fake_python);
+ assert!(
+ detected,
+ "is_pep668_protected({}) returned false — was the EXTERNALLY-MANAGED \
+ marker planted in this Python's stdlib?",
+ fake_python
+ );
+ println!("[live E2E] ✓ is_pep668_protected detected the marker");
+
+ // ── Phase 2: create_comfyui_venv ──
+ let comfy_root = std::env::temp_dir().join("lu-pep668-live-comfyui");
+ let _ = std::fs::remove_dir_all(&comfy_root);
+ std::fs::create_dir_all(&comfy_root).expect("temp dir create");
+
+ let venv_py = create_comfyui_venv(&comfy_root, &fake_python)
+ .expect("create_comfyui_venv should succeed against fake python");
+
+ assert!(venv_py.exists(), "venv python at {} should exist", venv_py.display());
+ assert!(venv_py.starts_with(&comfy_root), "venv python should be inside comfy dir");
+ println!("[live E2E] ✓ create_comfyui_venv produced {}", venv_py.display());
+
+ // ── Phase 3: nested venv's pip should be UNBLOCKED ──
+ // The venv has its own site-packages, so PEP 668 doesn't apply to
+ // it — this is the whole point of the fix. Verify pip install
+ // works inside the nested venv. We use `--dry-run` so we don't
+ // actually download anything heavy; the test is whether pip
+ // refuses or proceeds.
+ let pip_out = std::process::Command::new(venv_py.to_string_lossy().as_ref())
+ .args(["-m", "pip", "install", "--dry-run", "--no-input", "pip"])
+ .output()
+ .expect("nested venv pip should spawn");
+ let combined = format!(
+ "{}{}",
+ String::from_utf8_lossy(&pip_out.stdout),
+ String::from_utf8_lossy(&pip_out.stderr)
+ );
+ assert!(
+ !combined.to_lowercase().contains("externally-managed"),
+ "nested venv pip was STILL blocked — PEP 668 leaked through. \
+ Output:\n{}",
+ combined
+ );
+ assert!(pip_out.status.success(), "nested venv pip exit code != 0:\n{}", combined);
+ println!("[live E2E] ✓ nested venv pip runs without PEP 668 block");
+
+ // ── Phase 4: idempotency — second create_comfyui_venv must no-op ──
+ let venv_py_again = create_comfyui_venv(&comfy_root, &fake_python)
+ .expect("second create_comfyui_venv should idempotently return existing venv");
+ assert_eq!(venv_py, venv_py_again);
+ println!("[live E2E] ✓ create_comfyui_venv is idempotent");
+
+ // Cleanup
+ let _ = std::fs::remove_dir_all(&comfy_root);
+ println!("[live E2E] ALL ASSERTIONS PASSED");
+ }
}