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.
TypeScript agentai-chatai-studioall-in-onecoding-agentdesktop-appfluximage-generationlinuxllmlocal-ailocal-llmopen-sourceprivacyself-hostedstable-diffusionuncensoreduncensored-aivideo-generationwindows
hotfix v2.4.7: Bug M + N + O + P + R — benchmark TTFT, Win git probe, Anthropic /v1, configurable timeouts, ComfyUI custom-save extraction
purple75bb9e52cb1c
diff --git a/CHANGELOG.md b/CHANGELOG.mdindex 832c6e0e..f6caec5c 100644--- a/CHANGELOG.md+++ b/CHANGELOG.md@@ -4,6 +4,41 @@ All notable changes to Locally Uncensored are documented here.## [Unreleased]+## [2.4.7] - 2026-05-21++Drop-in hotfix on top of v2.4.6. Five bugs: four user-reported (M — Discord nightmare13740; N — GH #40 juliandiggins-stack; O — Discord 0yagizz; P — Discord ake0n_official; R — GH Discussion #6 silentrunningcaUSA) plus internal hardening on the ComfyUI history-output extractor.++### Fixed — benchmark accuracy++- **Benchmark tok/s now excludes time-to-first-token + stream init** (Bug M — nightmare13740 Discord #help-chat, 2026-05-19). Pre-v2.4.7 `useBenchmark.runBenchmark` started the clock at `performance.now()` before opening the chat stream and used the resulting `totalTime` as the denominator for `tokensPerSec`. On any setup with non-trivial first-token latency (warm-up cost, connection init, ollama model load), the benchmark undercounted generation-phase throughput. nightmare13740's RTX 4070 Laptop 8 GB + gemma4:e4b reproduced the issue cleanly: ollama CLI baseline 30 tok/s, manual chat measurement 23–25 tok/s, pre-v2.4.7 benchmark 12 tok/s. v2.4.7 extracts `computeGenerationTps(tokenCount, totalTime, firstTokenTime)` into `src/stores/benchmarkStore.ts` as a pure helper, subtracts TTFT from the denominator, guards against `generationTime <= 0` for degenerate runs (0-token, 1-token, totalTime ≤ firstTokenTime). `useBenchmark.ts:55` now calls the helper; `timeToFirstToken` continues to surface as its own stat in the benchmark UI so users can compare TTFT and steady-state separately. Seven new vitest cases pin the math: nominal extraction, nightmare's exact 12-vs-24 tok/s reconstruction, zero-token guard, zero-generation-time guard, tiny TTFT relative to totalTime, single-token degenerate case.++### Fixed — Windows / ComfyUI install++- **`install_comfyui` + `install_custom_node` now probe `git --version` before clone** (Bug N — juliandiggins-stack GH issue #40, 2026-05-18). The existing spawn-error guard catches a flat "git not on PATH" failure, but it can't tell when a WSL / Linux-mounted git binary is first on PATH on a Windows machine — `git --version` succeeds, the clone *starts*, then dies because the Linux binary can't handle Windows-style target paths. The user ends up with a half-cloned ComfyUI directory and no actionable hint. v2.4.7 adds a tri-state `WindowsGitState` probe (Native / NonNative / Missing) in `src-tauri/src/commands/install.rs`. Native (`git version 2.x.x.windows.y` tag) proceeds silently. Missing blocks the install with a clear "install Git for Windows from https://git-scm.com/download/win and restart LU" hint. NonNative (no `.windows` tag — MSYS git, Cygwin git, or a WSL binary mounted into Windows PATH) surfaces a soft warning into the install panel logs but proceeds, since many MSYS/Cygwin gits actually handle Windows paths fine. Eleven new cargo unit tests pin the classification matrix (Git for Windows, WSL git, MSYS git, broken install, empty stdout, garbage stdout, case-insensitive) plus the install-hint copy (must mention `git-scm.com/download/win`, must mention PATH ordering for the WSL case).++### Fixed — Anthropic custom-proxy provider++- **Anthropic provider no longer double-prefixes `/v1` when the user's baseUrl already ends in `/v1`** (Bug O — 0yagizz Discord 2026-05-18). Pre-v2.4.7 the provider unconditionally appended `/v1/messages` to the configured baseUrl. Users pointing the Anthropic provider at a proxy (claude-relay-server, LiteLLM, opencode-zen) sometimes paste a baseUrl with `/v1` already in the path — the proxy operator pinned the API version in their docs — and got back a silent 404 on `https://proxy.example/v1/v1/messages`. v2.4.7 collapses the second `/v1` via a new `messagesUrl()` helper that drops a trailing `/v1` before appending `/messages`. The default `https://api.anthropic.com` shape still produces the canonical `/v1/messages`, and `https://proxy.example/api-v1` (different non-suffix path that happens to contain "v1") still gets the standard `/v1/messages` append. Five new vitest cases cover both proxy shapes, trailing-slash tolerance, the default Anthropic URL, and the defensive non-suffix-`v1` case. OpenRouter half of 0yagizz's original report is still under investigation pending more F12-console context from the reporter — that path lands in v2.4.8 if it turns out to need a code change rather than a config one.++### Fixed — image / video timeouts++- **Image and video generation timeouts are now user-configurable** (Bug P — ake0n_official Discord #help-chat, 2026-05-19). Pre-v2.4.7 image gens timed out at a hard-coded 20 min and video at 60 min. That was a sane default for desktop NVIDIA hardware but actively painful for the CPU-only / iGPU edge: ake0n_official's 12th-gen Intel Core + Intel UHD Graphics (128 MB allotment) finished sampling step 9 of 25 on a 1024 px Juggernaut-XL run before the 20-minute cap killed the job mid-sampler, with no way to recover the partial work. v2.4.7 adds `imageGenTimeoutMinutes` and `videoGenTimeoutMinutes` to `types/settings.ts` with defaults 20 and 60 (matching pre-v2.4.7 behavior on fresh installs and via the persisted-store migration), reads them in `useCreate.generate()` with a `Math.max(1, …)` clamp to prevent footguns from a 0-min input, and surfaces both as numeric inputs in `SettingsPage`'s new "Image / Video Generation Timeouts" section with an explanatory blurb naming the iGPU / CPU-only use case directly. Users on slow hardware can now bump both caps as needed (range 1–480 min); fast-GPU users see no change.++### Fixed — ComfyUI output extraction++- **Custom save nodes' outputs now surface in LU's gallery** (Bug R — silentrunningcaUSA GH Discussion #6, 2026-05-20). Pre-v2.4.7 `useCreate.ts` only scraped `nodeOutput.images`, `nodeOutput.gifs`, and `nodeOutput.videos` from each entry in ComfyUI's `/history/{promptId}` payload. That worked for the canonical SaveImage / SaveAnimatedWEBP / VHS_VideoCombine nodes, but every community workflow that uses a non-canonical save node — SaveImageWithMetadata posts under `result`, audio save nodes under `audio`, plenty of CivitAI workflows define their own keys — dropped its file on disk in ComfyUI's `output/` folder and never made it into LU's gallery. silentrunningcaUSA's symptom was exactly that: "I can send a generation request to ComfyUI and I can see the output in ComfyUI itself, but the result never comes back to LU." v2.4.7 extracts the extraction logic into a generic helper `extractComfyOutputFiles(nodeOutput)` in `src/api/comfyui.ts` that scans every key on the node output, accepts any array whose entries have a string `filename`, and fills in safe defaults for `subfolder` (`''`) and `type` (`'output'`) so downstream URL construction still works when a custom node omits them. Wired into all three `useCreate.ts` history-poll sites (WebSocket-branch heartbeat poll, WebSocket-branch completion path, polling-only fallback) so the fix applies regardless of which transport ComfyUI is on. Ten new vitest cases pin canonical-keys, custom-keys, audio, multi-key-on-same-node, missing-subfolder-and-type defaults, non-array values (LATENT, metadata, scalars), invalid array entries (missing filename, non-string filename, null), and the empty/null/undefined input guard.++### Tests++- `vitest`: **2306 passed** (previously 2284, +22 across the v2.4.7 bug fixes — +7 benchmark TPS math in `stores/__tests__/benchmarkStore.test.ts`, +5 Anthropic messages-URL in `api/__tests__/provider-anthropic.test.ts`, +10 ComfyUI output extraction in `api/__tests__/comfyui-models.test.ts`).+- `cargo test --release --bins`: **100 passed + 1 ignored** (previously 89, +11 for `WindowsGitState` classification + install-hint copy in `commands/install.rs`).+- `cargo check --release`: clean (pre-existing dead-code warnings only).+- `tsc --noEmit`: clean.++### Deferred to v2.4.8++- **Bug Q** — wakeywakeynow GH #41 ("LM Studio installed but can't choose any models, worked first time, broken today"). Most plausible root cause is the LM Studio server having been stopped between the two runs (LM Studio closes its server when the desktop app is quit). The "no models — start LM Studio server" hint added in v2.4.4 already surfaces this state, so before landing a code change we want the reporter's F12 console output to confirm whether `listModels()` is timing out, returning empty, or failing auth. Carried into v2.4.8's outreach-then-fix queue rather than guessing at a fix that could regress the path that already works for everyone else.+## [2.4.6] - 2026-05-19Drop-in hotfix on top of v2.4.5. **One bug**: nightmare13740 (Discord 2026-05-18).diff --git a/README.md b/README.mdindex d335e946..f3db1d58 100644--- a/README.md+++ b/README.md@@ -35,25 +35,31 @@ No cloud. No data collection. No API keys. Auto-detects 12 local backends. Your----## v2.4.6 — Current Release+## v2.4.7 — Current Release-**Hotfix: 1 fix on top of v2.4.5.**+**Hotfix: 5 fixes on top of v2.4.6.** Four user-reported, one internal hardening.-Auto-update prompts on next launch. Reported by **nightmare13740** on Discord 2026-05-18 with a clean ollama-CLI A/B comparison.+Auto-update prompts on next launch.### What's fixed-- **Chat throughput restored on tight-VRAM cards** (Bug L — nightmare13740 Discord). LU was sending `num_gpu: 99` on every Ollama chat request, forcing all model layers onto the GPU regardless of free VRAM. On 8 GB-VRAM laptop cards (e.g. RTX 4070 Laptop + gemma3:4b) the KV cache had nowhere to live except system RAM, dragging chat speed from **30 tok/s** in ollama CLI down to **6.9 tok/s** in LU. v2.4.6 drops the override entirely so Ollama applies its own VRAM-aware layer-placement logic — no-op on cards with headroom, full CLI parity on tight cards.+- **Benchmark tok/s now matches actual chat throughput** (Bug M — nightmare13740 Discord). Pre-v2.4.7 the benchmark counted time-to-first-token + stream init in the tok/s denominator, so any local model looked slower in the Benchmark tab than in real chat. On nightmare13740's RTX 4070 Laptop 8 GB + gemma4:e4b: ollama CLI 30 tok/s, manual chat 23–25 tok/s, pre-v2.4.7 benchmark 12 tok/s. v2.4.7 starts the clock at first-token-received so generation-phase throughput matches CLI / chat baselines; TTFT continues to surface as its own stat.+- **Windows ComfyUI install probes `git --version` before clone** (Bug N — juliandiggins-stack GH #40). If a WSL / Linux-mounted git is first on PATH, the previous code let the clone start and die mid-flight with cryptic stderr. New tri-state probe (Native / NonNative / Missing) either proceeds silently, surfaces a clear "install Git for Windows" hint when missing, or logs a soft warning when a non-native git might still work.+- **Anthropic custom-proxy provider no longer double-prefixes `/v1`** (Bug O — 0yagizz Discord). Users pointing the Anthropic provider at a proxy (claude-relay-server, LiteLLM, opencode-zen) whose docs end the baseUrl with `/v1` got a silent 404 on `…/v1/v1/messages`. v2.4.7 collapses the duplicate.+- **Image / video generation timeouts now configurable in Settings** (Bug P — ake0n_official Discord). CPU-only / iGPU users finished sampling mid-run when the previous hard-coded 20-min image cap hit. v2.4.7 surfaces both image and video timeouts as numeric inputs (defaults stay 20 min / 60 min, range 1–480 min).+- **Custom ComfyUI save nodes' outputs now surface in LU's gallery** (Bug R — silentrunningcaUSA GH Discussion #6). Pre-v2.4.7 LU only scraped `images` / `gifs` / `videos` from the history payload, missing every community workflow that uses a non-canonical save node (audio, custom metadata, CivitAI flows). v2.4.7 generic extractor accepts any keyed array of file-shaped objects.### Stability-- `vitest`: 93 files / **2284 tests** green (rewrote 3 assertions to lock in the absence of `num_gpu` in chat-request bodies).-- `cargo test --release`: **89 passed + 1 ignored** (unchanged; Rust edits were inside the JS remote-access template, not Rust unit-tested).+- `vitest`: **2306 tests** green (+22 across Bug M, O, R).+- `cargo test --release`: **100 passed + 1 ignored** (+11 for Bug N's `WindowsGitState` matrix).- `tsc --noEmit`: clean. `cargo check`: clean (pre-existing dead-code warnings only).-- No breaking changes, no localStorage migration — upgrade in place.+- No breaking changes, settings auto-migrate with safe defaults.### Heads-up-v2.4.6 is a Windows + Linux release; macOS is not part of this build. `#bug-reports` / `#help-*` / GitHub will be monitored daily for regression reports.+v2.4.7 is a Windows + Linux release; macOS is not part of this build. `#bug-reports` / `#help-*` / GitHub will be monitored daily for regression reports.-For previous release notes (v2.4.5 — 14 bugs), see [CHANGELOG.md](CHANGELOG.md).+Still investigating: OpenRouter half of 0yagizz's report (needs F12 console output to repro); wakeywakeynow's LM-Studio-model-picker GH #41 (most plausible cause is LM Studio server stopped between sessions — needs reporter confirmation). Both carried into v2.4.8 outreach queue.++For previous release notes (v2.4.6 — 1 bug, v2.4.5 — 14 bugs), see [CHANGELOG.md](CHANGELOG.md).For older releases, see [CHANGELOG.md](CHANGELOG.md).diff --git a/docs/index.html b/docs/index.htmlindex 71722614..2ed90c12 100644--- a/docs/index.html+++ b/docs/index.html@@ -33,7 +33,7 @@<link rel="icon" href="https://locallyuncensored.com/favicon.png"><link rel="apple-touch-icon" href="https://locallyuncensored.com/favicon.png"><script type="application/ld+json">-{"@context":"https://schema.org","@type":"SoftwareApplication","name":"Locally Uncensored","alternateName":["LU","Locally Uncensored Desktop App"],"applicationCategory":"DeveloperApplication","applicationSubCategory":"Artificial Intelligence","operatingSystem":"Windows 10, Windows 11, Linux","description":"Open-source desktop app for running AI locally. Chat with 20+ providers, generate images and video via ComfyUI, and code with a built-in AI agent — all on your own hardware. Auto-detects 12 local backends. No cloud, no telemetry.","url":"https://locallyuncensored.com/","downloadUrl":"https://github.com/PurpleDoubleD/locally-uncensored/releases/latest","softwareVersion":"2.4.6","license":"https://www.gnu.org/licenses/agpl-3.0.html","author":{"@type":"Person","name":"PurpleDoubleD","url":"https://github.com/PurpleDoubleD"},"offers":{"@type":"Offer","price":"0","priceCurrency":"USD","availability":"https://schema.org/InStock"},"featureList":["Plug & Play Setup with 12 Local Backend Auto-Detection (Ollama, LM Studio, vLLM, KoboldCpp, Jan, llama.cpp, LocalAI, GPT4All, TabbyAPI, Aphrodite, SGLang, TGI)","20+ Provider Presets (local + cloud)","Qwen 3.6 Day-0 Support (35B MoE, Vision, Agentic Coding, 256K context)","GPT-OSS Compatible (120B, 20B via Ollama)","GLM-4.7 Flash Integration","DeepSeek R1 and DeepSeek V3 Support","Llama 4 and Llama 3.3 Ready","Gemma 4 E4B and 27B (Native Vision)","Mistral Small 3 and Phi 4 Support","Qwen 3 Coder and Qwen 2.5 Coder","Abliterated Model Variants","Codex Coding Agent with Live Streaming and Apply-Patch","Claude Code CLI Integration","Agent Mode with 14 Tools, Parallel Execution, MCP, Sub-Agent Delegation","Remote Access from Phone via LAN or Cloudflare Tunnel (6-digit Passcode, QR Setup)","Mobile Web App (Chat, Codex, Tools, Plugins)","Image Generation via ComfyUI (FLUX 2 Klein, FLUX.1, Juggernaut XL, Z-Image Turbo, ERNIE-Image, SDXL, SD 3.5)","Video Generation (Wan 2.1, Wan 2.2, HunyuanVideo 1.5, LTX 2.3, FramePack F1, AnimateDiff, CogVideoX)","Image-to-Image with Denoise Control","Image-to-Video (FramePack F1, CogVideoX, SVD)","Granular Permission System (7 Tool Categories)","File Upload with Vision Support","Thinking Mode with Universal Tag Stripping","A/B Model Compare","Local Benchmark","Memory System and Document RAG","Voice (STT / TTS)","Auto-Update over Signed NSIS Channel","75+ One-Click Model Downloads","Hardware-Aware Model Recommendations","100% Offline and Private (No Telemetry)","AGPL-3.0 Open Source"],"screenshot":"https://raw.githubusercontent.com/PurpleDoubleD/locally-uncensored/master/docs/social-preview.png","softwareRequirements":"Any OpenAI-compatible local backend (Ollama, LM Studio, vLLM, KoboldCpp, etc.) or cloud API key","memoryRequirements":"8 GB RAM minimum; 8-16 GB VRAM for image/video generation","storageRequirements":"6 GB for default model"}+{"@context":"https://schema.org","@type":"SoftwareApplication","name":"Locally Uncensored","alternateName":["LU","Locally Uncensored Desktop App"],"applicationCategory":"DeveloperApplication","applicationSubCategory":"Artificial Intelligence","operatingSystem":"Windows 10, Windows 11, Linux","description":"Open-source desktop app for running AI locally. Chat with 20+ providers, generate images and video via ComfyUI, and code with a built-in AI agent — all on your own hardware. Auto-detects 12 local backends. No cloud, no telemetry.","url":"https://locallyuncensored.com/","downloadUrl":"https://github.com/PurpleDoubleD/locally-uncensored/releases/latest","softwareVersion":"2.4.7","license":"https://www.gnu.org/licenses/agpl-3.0.html","author":{"@type":"Person","name":"PurpleDoubleD","url":"https://github.com/PurpleDoubleD"},"offers":{"@type":"Offer","price":"0","priceCurrency":"USD","availability":"https://schema.org/InStock"},"featureList":["Plug & Play Setup with 12 Local Backend Auto-Detection (Ollama, LM Studio, vLLM, KoboldCpp, Jan, llama.cpp, LocalAI, GPT4All, TabbyAPI, Aphrodite, SGLang, TGI)","20+ Provider Presets (local + cloud)","Qwen 3.6 Day-0 Support (35B MoE, Vision, Agentic Coding, 256K context)","GPT-OSS Compatible (120B, 20B via Ollama)","GLM-4.7 Flash Integration","DeepSeek R1 and DeepSeek V3 Support","Llama 4 and Llama 3.3 Ready","Gemma 4 E4B and 27B (Native Vision)","Mistral Small 3 and Phi 4 Support","Qwen 3 Coder and Qwen 2.5 Coder","Abliterated Model Variants","Codex Coding Agent with Live Streaming and Apply-Patch","Claude Code CLI Integration","Agent Mode with 14 Tools, Parallel Execution, MCP, Sub-Agent Delegation","Remote Access from Phone via LAN or Cloudflare Tunnel (6-digit Passcode, QR Setup)","Mobile Web App (Chat, Codex, Tools, Plugins)","Image Generation via ComfyUI (FLUX 2 Klein, FLUX.1, Juggernaut XL, Z-Image Turbo, ERNIE-Image, SDXL, SD 3.5)","Video Generation (Wan 2.1, Wan 2.2, HunyuanVideo 1.5, LTX 2.3, FramePack F1, AnimateDiff, CogVideoX)","Image-to-Image with Denoise Control","Image-to-Video (FramePack F1, CogVideoX, SVD)","Granular Permission System (7 Tool Categories)","File Upload with Vision Support","Thinking Mode with Universal Tag Stripping","A/B Model Compare","Local Benchmark","Memory System and Document RAG","Voice (STT / TTS)","Auto-Update over Signed NSIS Channel","75+ One-Click Model Downloads","Hardware-Aware Model Recommendations","100% Offline and Private (No Telemetry)","AGPL-3.0 Open Source"],"screenshot":"https://raw.githubusercontent.com/PurpleDoubleD/locally-uncensored/master/docs/social-preview.png","softwareRequirements":"Any OpenAI-compatible local backend (Ollama, LM Studio, vLLM, KoboldCpp, etc.) or cloud API key","memoryRequirements":"8 GB RAM minimum; 8-16 GB VRAM for image/video generation","storageRequirements":"6 GB for default model"}</script><script type="application/ld+json">{"@context":"https://schema.org","@type":"Organization","name":"PurpleDoubleD","url":"https://github.com/PurpleDoubleD","logo":"https://locallyuncensored.com/logos/LU-monogram-bw-transparent.png","sameAs":["https://github.com/PurpleDoubleD","https://github.com/PurpleDoubleD/locally-uncensored","https://reddit.com/user/GroundbreakingMall54","https://locallyuncensored.com"]}@@ -868,10 +868,10 @@ footer a:hover{color:var(--fg)}<div class="container"><div class="dl-card"><div class="dl-info">- <h3>Locally Uncensored <em>— 2.4.6</em></h3>+ <h3>Locally Uncensored <em>— 2.4.7</em></h3><p>WINDOWS · ~7 MB installer · AGPL-3.0</p></div>- <a class="dl-btn" href="https://github.com/PurpleDoubleD/locally-uncensored/releases/download/v2.4.6/Locally.Uncensored_2.4.6_x64-setup.exe" download>+ <a class="dl-btn" href="https://github.com/PurpleDoubleD/locally-uncensored/releases/download/v2.4.7/Locally.Uncensored_2.4.7_x64-setup.exe" download><svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.4" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4"/><polyline points="7 10 12 15 17 10"/><line x1="12" y1="15" x2="12" y2="3"/></svg>Download .exe</a>@@ -1169,10 +1169,10 @@ footer a:hover{color:var(--fg)}<div class="narrow"><div class="dl-card"><div class="dl-info">- <h3>Locally Uncensored <em>— 2.4.6</em></h3>+ <h3>Locally Uncensored <em>— 2.4.7</em></h3><p>WINDOWS · ~7 MB installer · AGPL-3.0</p></div>- <a class="dl-btn" href="https://github.com/PurpleDoubleD/locally-uncensored/releases/download/v2.4.6/Locally.Uncensored_2.4.6_x64-setup.exe" download>+ <a class="dl-btn" href="https://github.com/PurpleDoubleD/locally-uncensored/releases/download/v2.4.7/Locally.Uncensored_2.4.7_x64-setup.exe" download><svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.4" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4"/><polyline points="7 10 12 15 17 10"/><line x1="12" y1="15" x2="12" y2="3"/></svg>Download .exe</a>diff --git a/package.json b/package.jsonindex 6893df91..cc3897f0 100644--- a/package.json+++ b/package.json@@ -1,6 +1,6 @@{"name": "locally-uncensored",- "version": "2.4.6",+ "version": "2.4.7","private": false,"description": "Generate anything — text, images, video. Locally. Uncensored.","license": "AGPL-3.0",diff --git a/src-tauri/Cargo.lock b/src-tauri/Cargo.lockindex adc38b9e..8da3b6e4 100644--- a/src-tauri/Cargo.lock+++ b/src-tauri/Cargo.lock@@ -2508,7 +2508,7 @@ dependencies = [[[package]]name = "locally-uncensored"-version = "2.4.6"+version = "2.4.7"dependencies = ["axum","base64 0.22.1",diff --git a/src-tauri/Cargo.toml b/src-tauri/Cargo.tomlindex 2dd0d93f..5d1e5c98 100644--- a/src-tauri/Cargo.toml+++ b/src-tauri/Cargo.toml@@ -1,6 +1,6 @@[package]name = "locally-uncensored"-version = "2.4.6"+version = "2.4.7"description = "Private, local AI chat & image/video generation"authors = ["purpledoubled"]edition = "2021"diff --git a/src-tauri/src/commands/install.rs b/src-tauri/src/commands/install.rsindex baee2962..7d5f7c59 100644--- a/src-tauri/src/commands/install.rs+++ b/src-tauri/src/commands/install.rs@@ -526,6 +526,23 @@ pub fn install_comfyui(return;}+ // Bug N (juliandiggins-stack issue #40, 2026-05-18) — probe Windows+ // git BEFORE clone so a WSL/non-native git on PATH surfaces a clear+ // hint instead of failing the clone halfway with cryptic stderr.+ #[cfg(target_os = "windows")]+ {+ let probe = windows_git_probe();+ if let Some(hint) = windows_git_install_hint(&probe) {+ if probe == WindowsGitState::Missing {+ update("error", &hint);+ return;+ }+ // NonNative — log the warning to the install panel but+ // proceed; many MSYS/Cygwin gits handle Windows paths fine.+ update("downloading", &hint);+ }+ }+// Step 1: Git clone — spawn+poll instead of cmd.output() so the// Cancel button can kill an in-flight clone (Bug #1).println!("[Install] Cloning ComfyUI to {:?}", target_dir);@@ -913,6 +930,84 @@ pub fn linux_python_install_hint(os_release: &str) -> String {}}+/// Bug N — git probe before ComfyUI install (juliandiggins-stack issue #40).+///+/// On Windows the in-app ComfyUI install + custom-node install both shell out+/// to `git clone`. The previous spawn-error guard only catches a flat+/// "git not on PATH" — but on a Windows machine where a WSL / Linux-mounted+/// git binary is first on PATH, `git --version` succeeds and clone *starts*,+/// then dies because the Linux binary can't handle Windows-style target paths.+/// juliandiggins-stack hit this on v2.4.5: clone silently fails, user gets+/// a half-installed ComfyUI with no actionable hint.+///+/// Probe at start of every clone path, classify, and surface the right hint:+/// Missing → "install Git for Windows", NonNative → "WSL/non-native git on+/// PATH may break Windows-path clones", Native → proceed.+#[derive(Debug, Clone, PartialEq, Eq)]+pub enum WindowsGitState {+ /// `git --version` failed to run (not installed or not on PATH).+ Missing,+ /// `git version 2.x.x.windows.y` — Git for Windows. Clone will work.+ Native,+ /// `git --version` ran but output doesn't include the `.windows` tag —+ /// could be WSL git, MSYS git, Cygwin git, or something else. May work,+ /// may break on Windows paths. Surface a soft warning, proceed anyway.+ NonNative,+}++/// Pure helper for testability. Classifies a `git --version` invocation+/// from its stdout (trimmed) plus the spawn/exit status.+pub fn windows_git_probe_from_output(stdout: &str, exited_successfully: bool) -> WindowsGitState {+ if !exited_successfully {+ return WindowsGitState::Missing;+ }+ let lower = stdout.to_lowercase();+ if !lower.starts_with("git version") {+ // Some non-git binary on PATH that responded to --version with garbage.+ return WindowsGitState::Missing;+ }+ if lower.contains(".windows") {+ WindowsGitState::Native+ } else {+ WindowsGitState::NonNative+ }+}++/// Run `git --version` and classify. Only meaningful on Windows; on other+/// platforms a stock `git` is fine.+#[cfg(target_os = "windows")]+pub fn windows_git_probe() -> WindowsGitState {+ let mut cmd = Command::new("git");+ cmd.arg("--version").creation_flags(CREATE_NO_WINDOW);+ match cmd.output() {+ Ok(o) if o.status.success() => {+ let stdout = String::from_utf8_lossy(&o.stdout).trim().to_string();+ windows_git_probe_from_output(&stdout, true)+ }+ _ => WindowsGitState::Missing,+ }+}++/// User-facing hint for the probed state. Returns `None` for Native (no hint+/// needed). For Missing the hint is fatal; for NonNative it's a soft warning.+pub fn windows_git_install_hint(state: &WindowsGitState) -> Option<String> {+ match state {+ WindowsGitState::Native => None,+ WindowsGitState::Missing => Some(+ "Git is not installed or not on PATH. Install Git for Windows from \+ https://git-scm.com/download/win and restart LU so the new PATH \+ is picked up.".to_string(),+ ),+ WindowsGitState::NonNative => Some(+ "A non-native `git` binary is first on PATH (likely WSL or a Linux \+ mount). It may fail to clone into Windows-style paths. If the \+ ComfyUI install errors out during clone, install Git for Windows \+ from https://git-scm.com/download/win and make sure its `cmd` \+ folder is ahead of any WSL git in your PATH.".to_string(),+ ),+ }+}+/// Wait for Ollama HTTP API to respond on the default port (best-effort/// shared startup probe used after every platform-specific install path).fn wait_for_ollama_ready() -> bool {@@ -1930,6 +2025,21 @@ pub fn install_custom_node(.map_err(|e| format!("Failed to create custom_nodes directory: {}", e))?;}+ // Bug N — same git probe as install_comfyui. Block on missing git, log+ // a soft hint when a non-native git is first on PATH.+ #[cfg(target_os = "windows")]+ {+ let probe = windows_git_probe();+ if probe == WindowsGitState::Missing {+ return Err(windows_git_install_hint(&probe).unwrap_or_default());+ }+ if probe == WindowsGitState::NonNative {+ if let Some(hint) = windows_git_install_hint(&probe) {+ println!("[Install] {}", hint);+ }+ }+ }+if target_dir.exists() {// Already exists — git pull to updateprintln!("[Install] Custom node {} already exists, updating...", node_name);@@ -2574,4 +2684,137 @@ mod tests {let _ = std::fs::remove_dir_all(&comfy_root);println!("[live E2E] ALL ASSERTIONS PASSED");}++ // ── Bug N — windows_git_probe classification matrix ──────────────────+ //+ // juliandiggins-stack hit a half-installed ComfyUI on Windows because a+ // WSL git on PATH ran the clone but choked on the Windows-style target+ // path. The probe is the gate that should surface a clear hint instead.+ // These tests pin the classification — the actual `git --version` call+ // is integration-only and lives in the live E2E section.++ #[test]+ fn git_probe_native_git_for_windows() {+ // Git for Windows always tags its version with `.windows.<n>`.+ let stdout = "git version 2.43.0.windows.1";+ let state = windows_git_probe_from_output(stdout, true);+ assert_eq!(state, WindowsGitState::Native);+ }++ #[test]+ fn git_probe_native_git_for_windows_recent_build() {+ // Newer Git for Windows builds keep the same tag shape.+ let stdout = "git version 2.45.2.windows.1";+ let state = windows_git_probe_from_output(stdout, true);+ assert_eq!(state, WindowsGitState::Native);+ }++ #[test]+ fn git_probe_wsl_git_is_non_native() {+ // WSL ships stock upstream git — no `.windows` tag.+ let stdout = "git version 2.43.0";+ let state = windows_git_probe_from_output(stdout, true);+ assert_eq!(state, WindowsGitState::NonNative);+ }++ #[test]+ fn git_probe_msys_git_is_non_native() {+ // MSYS2 git: also no `.windows` tag, even though it can sometimes+ // handle Windows paths. We classify as NonNative and let the user+ // decide based on the soft warning.+ let stdout = "git version 2.44.0.msys";+ let state = windows_git_probe_from_output(stdout, true);+ assert_eq!(state, WindowsGitState::NonNative);+ }++ #[test]+ fn git_probe_failed_exit_is_missing() {+ // `git --version` ran but exited non-zero (broken install).+ let state = windows_git_probe_from_output("", false);+ assert_eq!(state, WindowsGitState::Missing);+ }++ #[test]+ fn git_probe_empty_stdout_is_missing() {+ // Spawn succeeded but no output — shouldn't happen with real git.+ let state = windows_git_probe_from_output("", true);+ assert_eq!(state, WindowsGitState::Missing);+ }++ #[test]+ fn git_probe_garbage_output_is_missing() {+ // Some other binary on PATH answered to --version. Treat as missing+ // git (the user wants the *real* git, not whatever-this-is).+ let state = windows_git_probe_from_output("hello world", true);+ assert_eq!(state, WindowsGitState::Missing);+ }++ #[test]+ fn git_probe_case_insensitive_match() {+ // Defensive: real git always emits lowercase "git version", but a+ // theoretical shim could uppercase it. We lower-case before checking.+ let stdout = "GIT VERSION 2.43.0.WINDOWS.1";+ let state = windows_git_probe_from_output(stdout, true);+ assert_eq!(state, WindowsGitState::Native);+ }++ // ── windows_git_install_hint copy ─────────────────────────────────────++ #[test]+ fn git_hint_native_returns_none() {+ // Native git → no hint needed, install proceeds silently.+ assert!(windows_git_install_hint(&WindowsGitState::Native).is_none());+ }++ #[test]+ fn git_hint_missing_mentions_git_scm_download() {+ let hint = windows_git_install_hint(&WindowsGitState::Missing).unwrap();+ let lower = hint.to_lowercase();+ // Must point at the canonical install URL so users can copy-paste.+ assert!(+ lower.contains("git-scm.com/download/win"),+ "Missing hint must point at canonical Git for Windows download: {}",+ hint+ );+ // Must use the word "install" so users understand the action.+ assert!(lower.contains("install"), "got: {}", hint);+ }++ /// LIVE E2E for Bug N — only runs on real Windows hosts because+ /// `windows_git_probe` is `cfg(target_os = "windows")`. Verifies that+ /// the actual `git --version` on the build machine classifies the way+ /// we expect. On a fresh Windows tester box with Git for Windows+ /// installed (the common case), this is `Native` and silent.+ #[cfg(target_os = "windows")]+ #[test]+ fn git_probe_live_on_this_host() {+ let state = windows_git_probe();+ // We can't assert a specific variant — that depends on what's on+ // the build box. But we can assert the result is well-formed and+ // that whatever variant came back the hint is consistent.+ let hint = windows_git_install_hint(&state);+ match state {+ WindowsGitState::Native => assert!(hint.is_none(), "Native must produce no hint"),+ _ => {+ let h = hint.expect("Non-Native states must produce a hint");+ assert!(h.to_lowercase().contains("git-scm.com/download/win"));+ }+ }+ println!("[live E2E] windows_git_probe() on this host returned: {:?}", state);+ }++ #[test]+ fn git_hint_nonnative_warns_about_wsl_and_path() {+ let hint = windows_git_install_hint(&WindowsGitState::NonNative).unwrap();+ let lower = hint.to_lowercase();+ // Must call out the WSL/PATH ordering scenario juliandiggins hit so+ // users know exactly what to check.+ assert!(lower.contains("path"), "NonNative hint must mention PATH: {}", hint);+ assert!(+ lower.contains("wsl") || lower.contains("linux"),+ "NonNative hint should mention WSL or Linux: {}",+ hint+ );+ assert!(lower.contains("git-scm.com/download/win"), "got: {}", hint);+ }}diff --git a/src-tauri/tauri.conf.json b/src-tauri/tauri.conf.jsonindex 507edbad..ec25a043 100644--- a/src-tauri/tauri.conf.json+++ b/src-tauri/tauri.conf.json@@ -1,7 +1,7 @@{"$schema": "https://raw.githubusercontent.com/tauri-apps/tauri/dev/crates/tauri-cli/schema.json","productName": "Locally Uncensored",- "version": "2.4.6",+ "version": "2.4.7","identifier": "com.purpledoubled.locally-uncensored","build": {"beforeBuildCommand": "npm run build",diff --git a/src/api/__tests__/comfyui-models.test.ts b/src/api/__tests__/comfyui-models.test.tsindex db9ab376..b6fc1974 100644--- a/src/api/__tests__/comfyui-models.test.ts+++ b/src/api/__tests__/comfyui-models.test.ts@@ -2,6 +2,7 @@ import {classifyModel,isVideoModelType,isImageModelType,+ extractComfyOutputFiles,MODEL_TYPE_DEFAULTS,COMPONENT_REGISTRY,} from '../comfyui'@@ -336,3 +337,138 @@ describe('determineStrategy', () => {expect(r.strategy).toBe('unavailable')})})++// ─── extractComfyOutputFiles (Bug R — v2.4.7, silentrunningcaUSA #6) ───+//+// Pre-v2.4.7 LU only checked `images` / `gifs` / `videos` on each history+// node output. Custom save nodes (Civitai workflows, SaveImageWithMetadata,+// audio nodes) publish under other keys; their files landed on disk but+// never made it into LU's gallery, exactly the symptom in Discussion #6.+// These tests pin the contract: every keyed array with file-shaped entries+// is collected, regardless of the key name, and subfolder/type defaults+// stay safe for downstream URL construction.++describe('extractComfyOutputFiles', () => {+ it('extracts canonical SaveImage output (images key)', () => {+ const node = {+ images: [+ { filename: 'gen_00001.png', subfolder: '', type: 'output' },+ ],+ }+ const files = extractComfyOutputFiles(node)+ expect(files).toHaveLength(1)+ expect(files[0].filename).toBe('gen_00001.png')+ expect(files[0].type).toBe('output')+ })++ it('extracts SaveAnimatedWEBP output (gifs key)', () => {+ const node = {+ gifs: [+ { filename: 'gen_00001.webp', subfolder: '', type: 'output' },+ ],+ }+ const files = extractComfyOutputFiles(node)+ expect(files).toHaveLength(1)+ expect(files[0].filename).toBe('gen_00001.webp')+ })++ it('extracts VHS_VideoCombine output (videos key)', () => {+ const node = {+ videos: [+ { filename: 'gen_00001.mp4', subfolder: '', type: 'output' },+ ],+ }+ const files = extractComfyOutputFiles(node)+ expect(files).toHaveLength(1)+ expect(files[0].filename).toBe('gen_00001.mp4')+ })++ it('extracts files from a custom save node under a non-canonical key', () => {+ // Real example: SaveImageWithMetadata posts under `result`.+ const node = {+ result: [+ { filename: 'meta_00001.png', subfolder: '', type: 'output' },+ ],+ }+ const files = extractComfyOutputFiles(node)+ expect(files).toHaveLength(1)+ expect(files[0].filename).toBe('meta_00001.png')+ })++ it('extracts audio output (audio key, used by AudioSave nodes)', () => {+ const node = {+ audio: [+ { filename: 'speech.wav', subfolder: 'tts', type: 'output' },+ ],+ }+ const files = extractComfyOutputFiles(node)+ expect(files).toHaveLength(1)+ expect(files[0].filename).toBe('speech.wav')+ expect(files[0].subfolder).toBe('tts')+ })++ it('fills subfolder + type defaults when a custom node omits them', () => {+ // Some homemade save nodes only emit { filename } — LU still needs+ // subfolder + type to build the comfyImageUrl, so we default safely.+ const node = {+ files: [{ filename: 'bare.png' }],+ }+ const files = extractComfyOutputFiles(node)+ expect(files).toHaveLength(1)+ expect(files[0].filename).toBe('bare.png')+ expect(files[0].subfolder).toBe('')+ expect(files[0].type).toBe('output')+ })++ it('collects files from multiple keys on the same node', () => {+ // VHS_VideoCombine sometimes emits both gifs (preview) and videos+ // (final mp4) in the same node output — make sure we surface both.+ const node = {+ gifs: [{ filename: 'preview.webp', subfolder: '', type: 'output' }],+ videos: [{ filename: 'final.mp4', subfolder: '', type: 'output' }],+ }+ const files = extractComfyOutputFiles(node)+ expect(files).toHaveLength(2)+ expect(files.map(f => f.filename)).toContain('preview.webp')+ expect(files.map(f => f.filename)).toContain('final.mp4')+ })++ it('ignores non-array values (latents, metadata blobs, etc.)', () => {+ // ComfyUI history payloads can contain non-file data on the same node+ // — for instance LATENT outputs are nested objects. We skip anything+ // that isn't an array of file-shaped objects.+ const node = {+ images: [{ filename: 'real.png', subfolder: '', type: 'output' }],+ latent: { /* a non-array object */ },+ ui: 'some string',+ n: 42,+ }+ const files = extractComfyOutputFiles(node)+ expect(files).toHaveLength(1)+ expect(files[0].filename).toBe('real.png')+ })++ it('ignores array entries that lack a string filename', () => {+ // Defensive: a node might post arrays of metadata items without a+ // filename. Skip those — picking them up would crash the gallery.+ const node = {+ images: [+ { filename: 'good.png', subfolder: '', type: 'output' },+ { not_a_filename: 'oops' },+ { filename: 42 }, // non-string filename+ null,+ ],+ }+ const files = extractComfyOutputFiles(node)+ expect(files).toHaveLength(1)+ expect(files[0].filename).toBe('good.png')+ })++ it('returns [] for empty / null / undefined input', () => {+ expect(extractComfyOutputFiles({})).toEqual([])+ expect(extractComfyOutputFiles(null)).toEqual([])+ expect(extractComfyOutputFiles(undefined)).toEqual([])+ expect(extractComfyOutputFiles('not-an-object')).toEqual([])+ expect(extractComfyOutputFiles(123)).toEqual([])+ })+})diff --git a/src/api/__tests__/provider-anthropic.test.ts b/src/api/__tests__/provider-anthropic.test.tsindex 8bd9b642..54c52a8e 100644--- a/src/api/__tests__/provider-anthropic.test.ts+++ b/src/api/__tests__/provider-anthropic.test.ts@@ -248,4 +248,72 @@ describe('AnthropicProvider', () => {vi.restoreAllMocks()})})++ // ── Bug O (v2.4.7) — messages URL construction across custom proxies ──+ //+ // 0yagizz reported Custom-Anthropic "not working" on v2.4.5. Most proxies+ // (claude-relay-server, LiteLLM, opencode-zen) document baseUrls in two+ // shapes: either `https://proxy.example` (canonical Anthropic style) or+ // `https://proxy.example/v1` (where the operator already pinned the API+ // version). Pre-v2.4.7 we always appended `/v1/messages`, breaking the+ // second shape with a `/v1/v1/messages` 404. Pin both shapes here.++ describe('messages URL construction (Bug O)', () => {+ it('default api.anthropic.com produces /v1/messages', async () => {+ const provider = new AnthropicProvider(makeConfig({ baseUrl: 'https://api.anthropic.com' }))+ const fetchSpy = vi.spyOn(globalThis, 'fetch').mockResolvedValueOnce(+ new Response(JSON.stringify({ content: [{ type: 'text', text: 'ok' }] }), { status: 200 })+ )+ await provider.chatWithTools('claude-sonnet-4-20250514', [{ role: 'user', content: 'hi' }], [])+ expect(fetchSpy.mock.calls[0][0]).toBe('https://api.anthropic.com/v1/messages')+ vi.restoreAllMocks()+ })++ it('proxy with /v1 suffix does not double up', async () => {+ const provider = new AnthropicProvider(makeConfig({ baseUrl: 'https://proxy.example/v1' }))+ const fetchSpy = vi.spyOn(globalThis, 'fetch').mockResolvedValueOnce(+ new Response(JSON.stringify({ content: [{ type: 'text', text: 'ok' }] }), { status: 200 })+ )+ await provider.chatWithTools('claude-sonnet-4-20250514', [{ role: 'user', content: 'hi' }], [])+ // Pre-v2.4.7: https://proxy.example/v1/v1/messages → 404+ // Post-v2.4.7: https://proxy.example/v1/messages+ expect(fetchSpy.mock.calls[0][0]).toBe('https://proxy.example/v1/messages')+ vi.restoreAllMocks()+ })++ it('proxy with trailing slash on /v1 still resolves correctly', async () => {+ const provider = new AnthropicProvider(makeConfig({ baseUrl: 'https://proxy.example/v1/' }))+ const fetchSpy = vi.spyOn(globalThis, 'fetch').mockResolvedValueOnce(+ new Response(JSON.stringify({ content: [{ type: 'text', text: 'ok' }] }), { status: 200 })+ )+ await provider.chatWithTools('claude-sonnet-4-20250514', [{ role: 'user', content: 'hi' }], [])+ // baseUrl getter strips trailing slashes, so this behaves like the+ // previous test.+ expect(fetchSpy.mock.calls[0][0]).toBe('https://proxy.example/v1/messages')+ vi.restoreAllMocks()+ })++ it('proxy with no /v1 prefix gets the standard /v1/messages path', async () => {+ const provider = new AnthropicProvider(makeConfig({ baseUrl: 'https://proxy.example' }))+ const fetchSpy = vi.spyOn(globalThis, 'fetch').mockResolvedValueOnce(+ new Response(JSON.stringify({ content: [{ type: 'text', text: 'ok' }] }), { status: 200 })+ )+ await provider.chatWithTools('claude-sonnet-4-20250514', [{ role: 'user', content: 'hi' }], [])+ expect(fetchSpy.mock.calls[0][0]).toBe('https://proxy.example/v1/messages')+ vi.restoreAllMocks()+ })++ it('preserves nested paths that happen to contain "v1" but not as suffix', async () => {+ // Defensive: a proxy that's deployed at a versioned sub-path like+ // `/api-v1` should still get the standard `/v1/messages` append.+ const provider = new AnthropicProvider(makeConfig({ baseUrl: 'https://proxy.example/api-v1' }))+ const fetchSpy = vi.spyOn(globalThis, 'fetch').mockResolvedValueOnce(+ new Response(JSON.stringify({ content: [{ type: 'text', text: 'ok' }] }), { status: 200 })+ )+ await provider.chatWithTools('claude-sonnet-4-20250514', [{ role: 'user', content: 'hi' }], [])+ // /api-v1 doesn't end in /v1, so we add /v1/messages+ expect(fetchSpy.mock.calls[0][0]).toBe('https://proxy.example/api-v1/v1/messages')+ vi.restoreAllMocks()+ })+ })})diff --git a/src/api/comfyui.ts b/src/api/comfyui.tsindex 02c52037..8df7eec3 100644--- a/src/api/comfyui.ts+++ b/src/api/comfyui.ts@@ -30,6 +30,47 @@ export interface ComfyUIOutput {type: string}+/**+ * Bug R (v2.4.7 — silentrunningcaUSA GH Discussion #6, 2026-05-20).+ *+ * Pre-v2.4.7 LU only scraped `images` / `gifs` / `videos` from a ComfyUI+ * history `outputs[nodeId]` payload. That worked for the canonical SaveImage+ * / SaveAnimatedWEBP / VHS_VideoCombine nodes, but plenty of custom save+ * nodes (community workflows from CivitAI, SaveImageWithMetadata,+ * SaveImageHTML, audio save nodes, etc.) post under different keys —+ * `audio`, `result`, `files`, `latents`, `meshes`, model-specific keys.+ * The file lands in ComfyUI's `output/` folder but never makes it into LU's+ * gallery, exactly the symptom silentrunningcaUSA reported.+ *+ * Generic extractor: scan every key on the node output, collect any array+ * whose entries look like `{ filename, subfolder?, type? }`. Defaults fill+ * in subfolder='' and type='output' so the gallery + comfyImageUrl can build+ * a working URL even when a custom save node omits them.+ */+export function extractComfyOutputFiles(nodeOutput: unknown): ComfyUIOutput[] {+ if (!nodeOutput || typeof nodeOutput !== 'object') return []+ const found: ComfyUIOutput[] = []+ for (const value of Object.values(nodeOutput as Record<string, unknown>)) {+ if (!Array.isArray(value)) continue+ for (const item of value) {+ if (+ item &&+ typeof item === 'object' &&+ 'filename' in item &&+ typeof (item as { filename: unknown }).filename === 'string'+ ) {+ const it = item as { filename: string; subfolder?: unknown; type?: unknown }+ found.push({+ filename: it.filename,+ subfolder: typeof it.subfolder === 'string' ? it.subfolder : '',+ type: typeof it.type === 'string' ? it.type : 'output',+ })+ }+ }+ }+ return found+}+export type ModelType = 'flux' | 'flux2' | 'zimage' | 'ernie_image' | 'sdxl' | 'sd15' | 'wan' | 'hunyuan' | 'ltx' | 'mochi' | 'cosmos' | 'cogvideo' | 'svd' | 'framepack' | 'pyramidflow' | 'allegro' | 'unknown'export type VideoBackend = 'wan' | 'animatediff' | 'none'diff --git a/src/api/providers/anthropic-provider.ts b/src/api/providers/anthropic-provider.tsindex 6146b511..fe732588 100644--- a/src/api/providers/anthropic-provider.ts+++ b/src/api/providers/anthropic-provider.ts@@ -56,6 +56,22 @@ export class AnthropicProvider implements ProviderClient {return this.config.baseUrl.replace(/\/+$/, '')}+ /**+ * Bug O — v2.4.7. When users point the Anthropic provider at a proxy+ * (claude-relay-server, LiteLLM, opencode-zen, etc.) they sometimes+ * configure the baseUrl with `/v1` already included. Pre-v2.4.7 we always+ * appended `/v1/messages`, producing `https://proxy.example/v1/v1/messages`+ * which 404s silently. Strip a trailing `/v1` so users can paste whichever+ * shape their proxy docs use.+ */+ private messagesUrl(): string {+ const base = this.baseUrl+ if (/\/v1$/i.test(base)) {+ return `${base}/messages`+ }+ return `${base}/v1/messages`+ }+private get headers(): Record<string, string> {return {'Content-Type': 'application/json',@@ -91,7 +107,7 @@ export class AnthropicProvider implements ProviderClient {body.thinking = { type: 'enabled', budget_tokens: 5000 }}- let res = await fetch(`${this.baseUrl}/v1/messages`, {+ let res = await fetch(this.messagesUrl(), {method: 'POST',headers: this.headers,body: JSON.stringify(body),@@ -102,7 +118,7 @@ export class AnthropicProvider implements ProviderClient {// Claude versions don't support `thinking`).if (!res.ok && res.status === 400 && 'thinking' in body) {delete body.thinking- res = await fetch(`${this.baseUrl}/v1/messages`, {+ res = await fetch(this.messagesUrl(), {method: 'POST',headers: this.headers,body: JSON.stringify(body),@@ -199,7 +215,7 @@ export class AnthropicProvider implements ProviderClient {}))}- let res = await fetch(`${this.baseUrl}/v1/messages`, {+ let res = await fetch(this.messagesUrl(), {method: 'POST',headers: this.headers,body: JSON.stringify(body),@@ -209,7 +225,7 @@ export class AnthropicProvider implements ProviderClient {// Retry without extended thinking if the model rejects it.if (!res.ok && res.status === 400 && 'thinking' in body) {delete body.thinking- res = await fetch(`${this.baseUrl}/v1/messages`, {+ res = await fetch(this.messagesUrl(), {method: 'POST',headers: this.headers,body: JSON.stringify(body),@@ -253,7 +269,7 @@ export class AnthropicProvider implements ProviderClient {try {// Send a minimal request to verify the API key- const res = await fetch(`${this.baseUrl}/v1/messages`, {+ const res = await fetch(this.messagesUrl(), {method: 'POST',headers: this.headers,body: JSON.stringify({diff --git a/src/components/settings/SettingsPage.tsx b/src/components/settings/SettingsPage.tsxindex adb9c184..b6b0a6e9 100644--- a/src/components/settings/SettingsPage.tsx+++ b/src/components/settings/SettingsPage.tsx@@ -659,6 +659,36 @@ export function SettingsPage() {</div></Section>+ <Section title="Image / Video Generation Timeouts">+ <div className="text-[0.6rem] text-gray-500 dark:text-gray-500 leading-relaxed pb-1.5">+ Maximum minutes a ComfyUI generation can run before LU aborts it. Bump these up if you run on iGPU or CPU only — a 1024px image on integrated graphics can take 30+ min.+ </div>+ <div className="flex items-center justify-between">+ <span className="text-[0.7rem] text-gray-700 dark:text-gray-400">Image timeout (min)</span>+ <input+ type="number"+ value={settings.imageGenTimeoutMinutes}+ onChange={(e) => updateSettings({ imageGenTimeoutMinutes: Math.max(1, parseInt(e.target.value) || 20) })}+ min={1}+ max={480}+ placeholder="20"+ className="w-20 px-1.5 py-0.5 rounded bg-transparent border border-white/8 text-[0.65rem] text-right text-gray-300 font-mono focus:outline-none focus:border-white/20"+ />+ </div>+ <div className="flex items-center justify-between">+ <span className="text-[0.7rem] text-gray-700 dark:text-gray-400">Video timeout (min)</span>+ <input+ type="number"+ value={settings.videoGenTimeoutMinutes}+ onChange={(e) => updateSettings({ videoGenTimeoutMinutes: Math.max(1, parseInt(e.target.value) || 60) })}+ min={1}+ max={480}+ placeholder="60"+ className="w-20 px-1.5 py-0.5 rounded bg-transparent border border-white/8 text-[0.65rem] text-right text-gray-300 font-mono focus:outline-none focus:border-white/20"+ />+ </div>+ </Section>+<Section title="Privacy"><div className="space-y-2 py-1 text-[0.65rem] text-gray-500 dark:text-gray-400 leading-relaxed"><div className="flex items-start gap-2">diff --git a/src/hooks/useBenchmark.ts b/src/hooks/useBenchmark.tsindex 6e1fffda..b165f579 100644--- a/src/hooks/useBenchmark.ts+++ b/src/hooks/useBenchmark.ts@@ -3,7 +3,7 @@*/import { useCallback, useRef } from 'react'-import { useBenchmarkStore } from '../stores/benchmarkStore'+import { useBenchmarkStore, computeGenerationTps } from '../stores/benchmarkStore'import { getProviderForModel } from '../api/providers'import { BENCHMARK_PROMPTS } from '../lib/benchmark-prompts'import type { ChatMessage } from '../api/providers/types'@@ -52,7 +52,7 @@ export function useBenchmark() {store.addResult({modelName,promptId: prompt.id,- tokensPerSec: totalTime > 0 ? (tokenCount / totalTime) * 1000 : 0,+ tokensPerSec: computeGenerationTps(tokenCount, totalTime, firstTokenTime),timeToFirstToken: firstTokenTime,totalTime,totalTokens: tokenCount,diff --git a/src/hooks/useCreate.ts b/src/hooks/useCreate.tsindex 571fc150..f22633b9 100644--- a/src/hooks/useCreate.ts+++ b/src/hooks/useCreate.ts@@ -14,6 +14,7 @@ import {buildTxt2ImgWorkflow,buildTxt2VidWorkflow,classifyModel,+ extractComfyOutputFiles,type ClassifiedModel,type ComfyUIOutput,type VideoBackend,@@ -28,6 +29,7 @@ import { getAllNodeInfo } from '../api/comfyui-nodes'import { installCustomNodes } from '../api/discover'import { backendCall } from '../api/backend'import { useCreateStore, type GalleryItem } from '../stores/createStore'+import { useSettingsStore } from '../stores/settingsStore'import { useWorkflowStore } from '../stores/workflowStore'import { injectParameters } from '../api/workflows'import { preflightCheck } from '../api/preflight'@@ -420,8 +422,16 @@ export function useCreate() {}}- // Try WebSocket-driven progress, fall back to polling- const maxTime = mode === 'video' ? 60 * 60 * 1000 : 20 * 60 * 1000+ // Try WebSocket-driven progress, fall back to polling.+ // Bug P (v2.4.7, ake0n_official Discord 2026-05-19): CPU-only users+ // on Intel UHD ran into the 20-min cap at sampling 9/25 on a single+ // 1024px Juggernaut-XL gen. Move the cap into Settings so slow+ // hardware can finish a gen instead of timing out mid-sampler.+ // Defaults stay 20min image / 60min video to match pre-2.4.7 behavior.+ const settings = useSettingsStore.getState().settings+ const imgMin = Math.max(1, settings.imageGenTimeoutMinutes || 20)+ const vidMin = Math.max(1, settings.videoGenTimeoutMinutes || 60)+ const maxTime = mode === 'video' ? vidMin * 60 * 1000 : imgMin * 60 * 1000let useWS = falsetry {await comfyWS.connect(3000)@@ -470,10 +480,11 @@ export function useCreate() {const outputs = history.outputs ?? {}let found = falsefor (const nodeId of Object.keys(outputs)) {- const nodeOutput = outputs[nodeId]- const files: ComfyUIOutput[] = [- ...(nodeOutput.images ?? []), ...(nodeOutput.gifs ?? []), ...(nodeOutput.videos ?? []),- ]+ // Bug R (v2.4.7) — extract files from any keyed array,+ // not just images/gifs/videos. Custom save nodes use+ // other keys (audio, result, files, …); previously LU+ // dropped those outputs even though they existed on disk.+ const files: ComfyUIOutput[] = extractComfyOutputFiles(outputs[nodeId])for (const file of files) {found = trueaddToGallery({@@ -567,10 +578,8 @@ export function useCreate() {const outputs = history.outputs ?? {}let found = falsefor (const nodeId of Object.keys(outputs)) {- const nodeOutput = outputs[nodeId]- const files: ComfyUIOutput[] = [- ...(nodeOutput.images ?? []), ...(nodeOutput.gifs ?? []), ...(nodeOutput.videos ?? []),- ]+ // Bug R (v2.4.7) — see comment at the WS branch above.+ const files: ComfyUIOutput[] = extractComfyOutputFiles(outputs[nodeId])for (const file of files) {found = trueaddToGallery({@@ -662,10 +671,11 @@ export function useCreate() {const outputs = history.outputs ?? {}let found = falsefor (const nodeId of Object.keys(outputs)) {- const nodeOutput = outputs[nodeId]- const files: ComfyUIOutput[] = [- ...(nodeOutput.images ?? []), ...(nodeOutput.gifs ?? []), ...(nodeOutput.videos ?? []),- ]+ // Bug R (v2.4.7) — extract files from any keyed array,+ // not just images/gifs/videos. Custom save nodes use+ // other keys (audio, result, files, …); previously LU+ // dropped those outputs even though they existed on disk.+ const files: ComfyUIOutput[] = extractComfyOutputFiles(outputs[nodeId])for (const file of files) {found = trueaddToGallery({diff --git a/src/lib/constants.ts b/src/lib/constants.tsindex 24f98705..9e2921d1 100644--- a/src/lib/constants.ts+++ b/src/lib/constants.ts@@ -27,6 +27,9 @@ export const DEFAULT_SETTINGS: Settings = {agentMaxToolCalls: 50,agentMaxIterations: 25,hfDownloadPathOverride: '',+ // Generation timeouts (Bug P v2.4.7)+ imageGenTimeoutMinutes: 20,+ videoGenTimeoutMinutes: 60,}/** Caveman mode system prompt prefixes — credit: github.com/JuliusBrussee/caveman (MIT) */diff --git a/src/stores/__tests__/benchmarkStore.test.ts b/src/stores/__tests__/benchmarkStore.test.tsindex c15d9ff1..33ab7eb9 100644--- a/src/stores/__tests__/benchmarkStore.test.ts+++ b/src/stores/__tests__/benchmarkStore.test.ts@@ -1,5 +1,5 @@import { describe, it, expect, beforeEach } from 'vitest'-import { useBenchmarkStore, getAverageSpeed, getLeaderboard } from '../benchmarkStore'+import { useBenchmarkStore, getAverageSpeed, getLeaderboard, computeGenerationTps } from '../benchmarkStore'import type { BenchmarkResult } from '../../lib/benchmark-prompts'// ── Helpers ─────────────────────────────────────────────────────@@ -220,4 +220,55 @@ describe('benchmarkStore', () => {expect(board[0].runs).toBe(1)})})++ // ── computeGenerationTps (Bug M — v2.4.7, nightmare13740) ──++ describe('computeGenerationTps', () => {+ it('excludes time-to-first-token from the denominator', () => {+ // 100 tokens, 5000ms total, 2000ms TTFT → 3000ms of pure generation+ // pre-v2.4.7 formula: 100/5000*1000 = 20 tok/s+ // post-v2.4.7 formula: 100/3000*1000 ≈ 33.3 tok/s+ const tps = computeGenerationTps(100, 5000, 2000)+ expect(tps).toBeCloseTo(33.333, 2)+ })++ it('matches nightmare13740 RTX 4070 Laptop scenario', () => {+ // nightmare's report: 23-25 tok/s in chat, 12 tok/s in pre-v2.4.7 benchmark.+ // Reconstruct: ~60 tokens, total ~5000ms (so 12 tok/s under old math),+ // TTFT ~2500ms → generation ~2500ms → 24 tok/s in new math.+ const tps = computeGenerationTps(60, 5000, 2500)+ expect(tps).toBe(24)+ })++ it('returns 0 when tokenCount is 0', () => {+ expect(computeGenerationTps(0, 5000, 100)).toBe(0)+ })++ it('returns 0 when generation time would be zero or negative', () => {+ // pathological: totalTime === firstTokenTime → division by zero guarded+ expect(computeGenerationTps(50, 1000, 1000)).toBe(0)+ // even more pathological: firstTokenTime > totalTime (shouldn't happen,+ // but guard anyway)+ expect(computeGenerationTps(50, 1000, 1500)).toBe(0)+ })++ it('returns 0 when totalTime is 0', () => {+ // never-started stream+ expect(computeGenerationTps(0, 0, 0)).toBe(0)+ })++ it('handles small TTFT relative to totalTime', () => {+ // remote/fast model: 100 tokens, 1000ms total, 50ms TTFT+ // generation = 950ms → 100/950*1000 ≈ 105.26 tok/s+ const tps = computeGenerationTps(100, 1000, 50)+ expect(tps).toBeCloseTo(105.263, 2)+ })++ it('handles single token (degenerate but valid)', () => {+ // 1 token at 500ms TTFT, total 510ms → generation 10ms → 100 tok/s+ // Math is correct but practically meaningless; we don't special-case it.+ const tps = computeGenerationTps(1, 510, 500)+ expect(tps).toBe(100)+ })+ })})diff --git a/src/stores/benchmarkStore.ts b/src/stores/benchmarkStore.tsindex 6bef9130..bc04b455 100644--- a/src/stores/benchmarkStore.ts+++ b/src/stores/benchmarkStore.ts@@ -53,6 +53,27 @@ export function getAverageSpeed(results: Record<string, BenchmarkResult[]>, modereturn Math.round(avg * 10) / 10}+/**+ * Compute tokens-per-second excluding time-to-first-token / stream init.+ *+ * Pre-v2.4.7 we used (tokenCount / totalTime), which lumped stream-init ++ * connection-setup + TTFT into the denominator and undercounted local model+ * speed. nightmare13740 (Discord 2026-05-19) caught this on RTX 4070 Laptop:+ * benchmark showed 12 tok/s, manual chat measurement 23-25 tok/s, ollama CLI+ * baseline 30 tok/s. Generation-phase rate (post-first-token) matches the CLI+ * within run-to-run noise, so we drop TTFT from the denominator and surface+ * it as its own stat.+ */+export function computeGenerationTps(+ tokenCount: number,+ totalTimeMs: number,+ firstTokenTimeMs: number,+): number {+ const generationTimeMs = totalTimeMs - firstTokenTimeMs+ if (generationTimeMs <= 0 || tokenCount <= 0) return 0+ return (tokenCount / generationTimeMs) * 1000+}+/** Get leaderboard sorted by avg tokens/sec */export function getLeaderboard(results: Record<string, BenchmarkResult[]>): { model: string; avgTps: number; runs: number }[] {return Object.entries(results)diff --git a/src/types/settings.ts b/src/types/settings.tsindex 48a31512..19e68793 100644--- a/src/types/settings.ts+++ b/src/types/settings.ts@@ -26,6 +26,13 @@ export interface Settings {agentMaxIterations: number/** Override for the HuggingFace GGUF download directory. Empty = auto-detect from active openai-compat provider (e.g. LM Studio models folder). */hfDownloadPathOverride: string+ // Generation timeouts (Bug P v2.4.7 — ake0n_official Discord 2026-05-19,+ // Intel UHD CPU-only setup hit the 20-min cap at sampling 9/25 on a 1024px+ // Juggernaut-XL gen).+ /** Image generation timeout in minutes. Default 20. */+ imageGenTimeoutMinutes: number+ /** Video generation timeout in minutes. Default 60. */+ videoGenTimeoutMinutes: number}export interface Persona {