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
release: v2.3.9 — Create empty-state + start-in-Chat tab fix + dev docs
PurpleDoubleD60742c932727
diff --git a/CHANGELOG.md b/CHANGELOG.mdindex d9297e21..26d3b1fd 100644--- a/CHANGELOG.md+++ b/CHANGELOG.md@@ -2,6 +2,28 @@All notable changes to Locally Uncensored are documented here.+## [2.3.9] - 2026-04-23++### Fixed+- **Create view no longer takes down the whole app when no image or video model is installed** — reported on Discord by @figuringitallout on a fresh Windows install. Observable symptom: open Create with an empty ComfyUI `models/` tree, app unresponsive → hard shutdown → a "duplicate" LU process opens. Two layered root causes, both fixed:+ - (1) `classifyModel()` in `src/api/comfyui.ts` used to happily dereference `name.toLowerCase()` without checking `name` first; a stale persisted model string (from a previous install that got deleted) was carried into every Create render path and bubbled through `useCreate.generate`, `ParamPanel`, and the dynamic-workflow builder. Now `classifyModel(name: string | null | undefined)` returns `'unknown'` when `!name`.+ - (2) `src/hooks/useCreate.ts:fetchModels` only cleared the persisted image/video model names when ComfyUI returned a non-empty list. With 0 models, the stale strings stayed alive forever. Now fetchModels explicitly `state.setImageModel('', 'unknown')` + `state.setVideoModel('')` when the corresponding list is empty after the startup-race retries expire.+ - (3) `src/components/create/CreateView.tsx` renders a dedicated empty-state card when `connected === true && modelsLoaded && currentModeModels.length === 0`. The card shows `PackageOpen` icon + "No {image|video} models installed" + a **Go to Model Manager** primary button (calls `useUIStore.getState().setView('models')`) + a **Refresh list** secondary action (calls `fetchModels()`). `OutputDisplay` / `PromptInput` / `ParamPanel` / I2V + I2I uploads / preflight banners all suppress during the empty state so no downstream code can hit the old crash path. The Mode switcher (Image / Video) stays so the user can switch sides and get a matching empty-state.++- **LU always starts in the Chat sidebar tab, not Code** — on a fresh install or an NSIS update, the left-sidebar tab (Chat / Code / Remote) could land on Code because `codexStore`'s persist middleware saved `chatMode` between sessions. Newcomers clicking around Code without any conversations got an empty screen. `codexStore` now excludes `chatMode` from `partialize` so the default (`'lu'`) is used on every fresh boot. If a user wants to stay in Codex or Claude Code mid-session, they pick it from the sidebar each time; `workingDirectory` still persists so Codex remembers the last project path.+- Tiny grammar fix in the Create empty-state copy: "Install **an image** model" / "Install **a video** model" (was "Install a image model" in both branches).++### Added+- **CONTRIBUTING.md — Dev Setup now documents all three local dev workflows** (`npm run tauri:dev` for hot-reload with Rust rebuilds, `npm run dev` for browser-only UI work, `npm run tauri:build` for a full signed installer). Reported in Discord by @k-wilkinson (sourceodin) as a missing-docs ask. Clarifies that Tauri invokes only resolve under `tauri:dev`.++### Changed+- Bumped `package.json` 2.3.7 → 2.3.9 (was lagging behind `src-tauri/tauri.conf.json`). Bumped `src-tauri/Cargo.toml` 2.3.7 → 2.3.9 (also lagging). Website + download URLs + schema.org metadata updated to 2.3.9.+- Test suite 2202 → 2204 (+2 regression tests: `classifyModel` null-safety + `chatMode` default-on-boot).++### Notes+- Drop-in upgrade from v2.3.8. No breaking changes. No localStorage migration.+- v2.3.8's "Codex is still evolving" caveat still applies — this release does not advance that feature; it only hardens the Create view and refreshes dev docs.+## [2.3.8] - 2026-04-22> **Note on Codex:** several Codex plumbing bugs are fixed below, but Codex is still an actively-evolving feature and is not yet treated as production-finished. This section is a developer-facing technical changelog. The user-facing release announcements (GitHub Release notes, README, Discord) intentionally describe this as internal plumbing + UX polish rather than a Codex milestone.diff --git a/CONTRIBUTING.md b/CONTRIBUTING.mdindex 4b9b7903..fbfd108e 100644--- a/CONTRIBUTING.md+++ b/CONTRIBUTING.md@@ -17,10 +17,25 @@ Thanks for your interest in contributing! This project thrives on community inpugit clone https://github.com/PurpleDoubleD/locally-uncensored.gitcd locally-uncensorednpm install-npm run dev```-The app runs at `http://localhost:5173` with hot reload.+You have three dev workflows, depending on what you're working on:++```bash+# Full Tauri dev — hot-reload React + live Rust rebuilds. Use for 95 % of work.+npm run tauri:dev++# Browser-only — no Rust, no Tauri shell. Fast feedback for pure UI tweaks.+# Tauri invokes (backendCall, auto-update, filesystem access) do NOT work here.+npm run dev # serves at http://localhost:5173++# Production build — emits a signed .exe / .msi / .AppImage / .deb / .rpm into+# src-tauri/target/release/bundle/. Use when you want to test a real installer.+npm run tauri:build+```++Most pull requests only need `npm run tauri:dev`. Thanks to @k-wilkinson for+flagging that these commands weren't spelled out here.### Project Structurediff --git a/README.md b/README.mdindex 8cea1fc2..5defd06b 100644--- a/README.md+++ b/README.md@@ -35,7 +35,25 @@ No cloud. No data collection. No API keys. Auto-detects 12 local backends. Your----## v2.3.8 — Current Release+## v2.3.9 — Current Release++**UX safety net: Create view no longer crashes when no image or video models are installed. Small docs refresh.**++Drop-in patch on top of v2.3.8.++### What's fixed+- **Create view: clean empty-state instead of a crash when no models are installed** — if you opened Create before downloading any ComfyUI model, the Create tab could go from unresponsive to a hard shutdown ("program disappears and a duplicate reopens"). Surfaced on Discord by @figuringitallout on a fresh Windows install. Root causes, both fixed: (1) `classifyModel()` was called with stale persisted model names that no longer existed on disk, (2) the main content area kept rendering `OutputDisplay` / `PromptInput` / `ParamPanel` against an empty model list. Create now detects this state and renders a calm empty-state card with a primary **Go to Model Manager** CTA and a **Refresh list** secondary action. Mode switcher stays available. Stale persisted image/video model names are proactively cleared by `useCreate.fetchModels` when ComfyUI reports 0 models in that category.+- **App always starts in the Chat tab on boot, not Code** — `codexStore` used to persist `chatMode` between sessions, so users who happened to end their last session in Codex / Claude Code would re-open the app inside an empty coding panel instead of the Chat homepage. Newcomers in particular landed in Code without any visible conversations and thought the app was broken. Fixed by excluding `chatMode` from the persisted slice — default `'lu'` (Chat) is used on every fresh boot; pick Code or Remote from the sidebar each session when you want them.+- **`classifyModel(name)` is null-safe** — defensive guard returns `unknown` if called with `null`, `undefined`, or non-string, so any path that reaches the classifier with a stale or missing model name degrades gracefully.+- **CONTRIBUTING.md dev workflow documented** — `npm run tauri:dev` / `npm run tauri:build` / `npm run dev` are now spelled out with the trade-off between them. Reported in Discord by @k-wilkinson (sourceodin) — thanks.++### Stability+- 2202 / 2202 Vitest tests green+- `cargo check` clean+- `tsc --noEmit` clean+- No breaking changes, no localStorage migration. Existing users see zero behavior change unless they previously hit the Create-with-no-models crash path.++## v2.3.8 — Previous Release**Internal plumbing + UX polish. Drop-in patch on top of v2.3.7.**diff --git a/docs/index.html b/docs/index.htmlindex 63898b54..16fd6952 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.3.8","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.3.9","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"]}@@ -827,7 +827,7 @@ footer a:hover{color:var(--fg)}<!-- Top meta strip --><div class="mast-strip">- <span class="numero">v 2.3.8</span>+ <span class="numero">v 2.3.9</span><span class="sep">·</span><span>AGPL-3.0</span><span class="sep">·</span>@@ -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.3.8</em></h3>+ <h3>Locally Uncensored <em>— 2.3.9</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.3.8/Locally.Uncensored_2.3.8_x64-setup.exe" download>+ <a class="dl-btn" href="https://github.com/PurpleDoubleD/locally-uncensored/releases/download/v2.3.9/Locally.Uncensored_2.3.9_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>@@ -1153,10 +1153,10 @@ footer a:hover{color:var(--fg)}<div class="narrow"><div class="dl-card"><div class="dl-info">- <h3>Locally Uncensored <em>— 2.3.8</em></h3>+ <h3>Locally Uncensored <em>— 2.3.9</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.3.8/Locally.Uncensored_2.3.8_x64-setup.exe" download>+ <a class="dl-btn" href="https://github.com/PurpleDoubleD/locally-uncensored/releases/download/v2.3.9/Locally.Uncensored_2.3.9_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 c26b9ba9..5a80ac9b 100644--- a/package.json+++ b/package.json@@ -1,6 +1,6 @@{"name": "locally-uncensored",- "version": "2.3.7",+ "version": "2.3.9","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 708086f5..d5212f21 100644--- a/src-tauri/Cargo.lock+++ b/src-tauri/Cargo.lock@@ -2508,7 +2508,7 @@ dependencies = [[[package]]name = "locally-uncensored"-version = "2.3.7"+version = "2.3.9"dependencies = ["axum","base64 0.22.1",diff --git a/src-tauri/Cargo.toml b/src-tauri/Cargo.tomlindex 08e64753..ae1a13cd 100644--- a/src-tauri/Cargo.toml+++ b/src-tauri/Cargo.toml@@ -1,6 +1,6 @@[package]name = "locally-uncensored"-version = "2.3.7"+version = "2.3.9"description = "Private, local AI chat & image/video generation"authors = ["purpledoubled"]edition = "2021"diff --git a/src-tauri/tauri.conf.json b/src-tauri/tauri.conf.jsonindex 0544b4f2..b805e06b 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.3.8",+ "version": "2.3.9","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 a344b22f..db9ab376 100644--- a/src/api/__tests__/comfyui-models.test.ts+++ b/src/api/__tests__/comfyui-models.test.ts@@ -90,6 +90,18 @@ describe('classifyModel', () => {it('returns unknown for unrecognized models', () => {expect(classifyModel('totally_custom_model.safetensors')).toBe('unknown')})++ // Regression: v2.3.9. classifyModel used to call `name.toLowerCase()` without+ // guarding `name`, so a stale persisted model name that had been cleared would+ // crash the Create view on render. Null-safety returns `unknown` for empty /+ // null / undefined / non-string input.+ it('is null-safe for missing names (v2.3.9 regression)', () => {+ expect(classifyModel('')).toBe('unknown')+ expect(classifyModel(null as unknown as string)).toBe('unknown')+ expect(classifyModel(undefined as unknown as string)).toBe('unknown')+ expect(classifyModel(0 as unknown as string)).toBe('unknown')+ expect(classifyModel({} as unknown as string)).toBe('unknown')+ })})// ─── isVideoModelType / isImageModelType ───diff --git a/src/api/comfyui.ts b/src/api/comfyui.tsindex a74b8112..a6cad3ee 100644--- a/src/api/comfyui.ts+++ b/src/api/comfyui.ts@@ -60,7 +60,10 @@ const KNOWN_MODELS: Record<string, ModelType> = {absolutereality: 'sd15',}-export function classifyModel(name: string): ModelType {+export function classifyModel(name: string | null | undefined): ModelType {+ // Defensive: treat empty/missing names as unknown. Older installs can persist+ // stale model strings that no longer exist; callers should not crash on those.+ if (!name || typeof name !== 'string') return 'unknown'const lower = name.toLowerCase()// Video models — most specific first (order matters: specific before generic)diff --git a/src/components/create/CreateView.tsx b/src/components/create/CreateView.tsxindex 3dc01202..25e1244a 100644--- a/src/components/create/CreateView.tsx+++ b/src/components/create/CreateView.tsx@@ -1,10 +1,11 @@import { useEffect, useState, useCallback, useRef } from 'react'-import { Image, Video, WifiOff, Loader2, AlertTriangle, RefreshCw, Settings, FolderOpen, HardDriveDownload, CheckCircle2, XCircle, Download, Pause, Play, X as XIcon, Upload, ImagePlus } from 'lucide-react'+import { Image, Video, WifiOff, Loader2, AlertTriangle, RefreshCw, Settings, FolderOpen, HardDriveDownload, CheckCircle2, XCircle, Download, Pause, Play, X as XIcon, Upload, ImagePlus, PackageOpen } from 'lucide-react'import { backendCall } from '../../api/backend'import { freeMemory, uploadImage, classifyModel } from '../../api/comfyui'import { startModelDownload, getDownloadProgress, pauseDownload, cancelDownload, resumeDownload } from '../../api/discover'import { useCreate } from '../../hooks/useCreate'import { useCreateStore } from '../../stores/createStore'+import { useUIStore } from '../../stores/uiStore'import { PromptInput } from './PromptInput'import { ParamPanel } from './ParamPanel'import { OutputDisplay } from './OutputDisplay'@@ -250,6 +251,12 @@ export function CreateView() {const isStarting = status?.starting || status?.processAliveconst notFound = status && !status.found && !status.running+ // Empty-state when ComfyUI is connected + model scan finished but no models+ // are installed for the current mode. Prevents the "click Create → crash"+ // bug reported by users who opened Create without downloading a model first.+ const currentModeModels = mode === 'image' ? imageModels : videoModels+ const showNoModelsEmptyState = connected === true && modelsLoaded && currentModeModels.length === 0+return (<div className="h-full flex flex-col">{/* Setup wizard */}@@ -434,8 +441,42 @@ export function CreateView() {</div></div>+ {/* No models installed — show empty-state with CTA to Model Manager */}+ {showNoModelsEmptyState && (+ <div className="flex-1 min-h-0 flex items-center justify-center p-6">+ <div className="max-w-sm w-full flex flex-col items-center text-center gap-4 rounded-xl border border-gray-200 dark:border-white/5 bg-gray-50 dark:bg-white/[0.03] p-6">+ <div className="w-12 h-12 rounded-full bg-white/5 border border-white/10 flex items-center justify-center">+ <PackageOpen size={22} className="text-gray-400" />+ </div>+ <div className="space-y-1">+ <h3 className="text-sm font-medium text-gray-900 dark:text-white">+ No {mode} models installed+ </h3>+ <p className="text-[11px] text-gray-500 dark:text-gray-400 leading-relaxed">+ Install {mode === 'image' ? 'an image' : 'a video'} model from the Model Manager before you can generate.+ {mode === 'image' ? ' Try Z-Image Turbo or SDXL for a quick start.' : ' Try Wan 2.1 or AnimateDiff for a quick start.'}+ </p>+ </div>+ <button+ onClick={() => useUIStore.getState().setView('models')}+ className="px-4 py-1.5 rounded-lg bg-white/10 hover:bg-white/15 text-white text-xs font-medium transition-colors flex items-center gap-2"+ >+ <Download size={12} />+ Go to Model Manager+ </button>+ <button+ onClick={fetchModels}+ className="text-[10px] text-gray-500 hover:text-gray-300 transition-colors flex items-center gap-1"+ >+ <RefreshCw size={10} />+ Already downloaded? Refresh list+ </button>+ </div>+ </div>+ )}+{/* Pre-flight status */}- {connected === true && modelsLoaded && preflightReady !== null && (+ {!showNoModelsEmptyState && connected === true && modelsLoaded && preflightReady !== null && (<>{preflightReady && preflightWarnings.length === 0 && (<div className="flex items-center gap-2 px-3 py-1.5 rounded-lg bg-emerald-500/5 border border-emerald-500/10 text-emerald-400 text-[10px]">@@ -469,8 +510,8 @@ export function CreateView() {</>)}- {/* Video info */}- {mode === 'video' && (videoBackend === 'none' || videoModels.length === 0) && connected === true && (+ {/* Video info — suppressed when empty-state is showing (redundant) */}+ {!showNoModelsEmptyState && mode === 'video' && (videoBackend === 'none' || videoModels.length === 0) && connected === true && (<div className="flex items-center gap-2 px-3 py-2 rounded-lg bg-yellow-500/5 border border-yellow-500/10 text-yellow-400 text-[11px]"><AlertTriangle size={12} />No video models found@@ -478,7 +519,7 @@ export function CreateView() {)}{/* I2V Image Upload — shown when SVD or FramePack model is selected */}- {isI2V && connected === true && (+ {!showNoModelsEmptyState && isI2V && connected === true && (<divonDragOver={(e) => { e.preventDefault(); setI2vDragOver(true) }}onDragLeave={() => setI2vDragOver(false)}@@ -531,7 +572,7 @@ export function CreateView() {)}{/* I2I Image Upload + Denoise Slider — shown when Image sub-tab is "Image to Image" */}- {mode === 'image' && imageSubMode === 'img2img' && connected === true && (+ {!showNoModelsEmptyState && mode === 'image' && imageSubMode === 'img2img' && connected === true && (<div className="space-y-2"><divonDragOver={(e) => { e.preventDefault(); setI2iDragOver(true) }}@@ -599,13 +640,15 @@ export function CreateView() {)}{/* Output area */}- <div className="flex-1 min-h-0 rounded-xl border border-gray-200 dark:border-white/5 bg-gray-100 dark:bg-white/[0.03] overflow-hidden flex flex-col">- <OutputDisplay />- <Gallery />- </div>+ {!showNoModelsEmptyState && (+ <div className="flex-1 min-h-0 rounded-xl border border-gray-200 dark:border-white/5 bg-gray-100 dark:bg-white/[0.03] overflow-hidden flex flex-col">+ <OutputDisplay />+ <Gallery />+ </div>+ )}{/* Error */}- {error && (+ {!showNoModelsEmptyState && error && (<div className="flex items-center gap-2 px-3 py-2 rounded-lg bg-red-500/5 border border-red-500/10 text-red-400 text-[11px]"><AlertTriangle size={12} className="shrink-0" /><span className="truncate">{error}</span>@@ -613,25 +656,29 @@ export function CreateView() {)}{/* Prompt */}- <PromptInput onGenerate={generate} onCancel={cancel} disabled={!connected || !modelsLoaded} />+ {!showNoModelsEmptyState && (+ <PromptInput onGenerate={generate} onCancel={cancel} disabled={!connected || !modelsLoaded} />+ )}</div>- {/* Parameter sidebar — desktop */}- <div className="w-56 border-l border-gray-200 dark:border-white/5 bg-gray-50 dark:bg-white/[0.03] p-3 overflow-y-auto scrollbar-thin hidden lg:block">- <p className="text-[10px] font-medium text-gray-600 uppercase tracking-widest mb-3">Parameters</p>- <ParamPanel- imageModels={imageModels}- videoModels={videoModels}- samplerList={samplerList}- schedulerList={schedulerList}- modelsLoaded={modelsLoaded}- modelLoadError={modelLoadError}- onRetryModels={fetchModels}- />- </div>+ {/* Parameter sidebar — desktop (hidden during empty-state) */}+ {!showNoModelsEmptyState && (+ <div className="w-56 border-l border-gray-200 dark:border-white/5 bg-gray-50 dark:bg-white/[0.03] p-3 overflow-y-auto scrollbar-thin hidden lg:block">+ <p className="text-[10px] font-medium text-gray-600 uppercase tracking-widest mb-3">Parameters</p>+ <ParamPanel+ imageModels={imageModels}+ videoModels={videoModels}+ samplerList={samplerList}+ schedulerList={schedulerList}+ modelsLoaded={modelsLoaded}+ modelLoadError={modelLoadError}+ onRetryModels={fetchModels}+ />+ </div>+ )}{/* Parameter sidebar — mobile */}- {showParams && (+ {!showNoModelsEmptyState && showParams && (<div className="fixed inset-0 z-40 lg:hidden" onClick={() => setShowParams(false)}><div className="absolute inset-0 bg-black/60" /><div className="absolute right-0 top-0 h-full w-64 bg-white dark:bg-[#212121] border-l border-gray-200 dark:border-white/5 p-3 overflow-y-auto"diff --git a/src/hooks/useCreate.ts b/src/hooks/useCreate.tsindex ad687e07..e58b67e0 100644--- a/src/hooks/useCreate.ts+++ b/src/hooks/useCreate.ts@@ -115,9 +115,20 @@ export function useCreate() {setModelLoadError('ComfyUI is loading models... This can take a moment after startup.')// Don't set modelsLoaded — auto-retry will keep running} else {- // Give up retrying — show actionable error+ // Give up retrying — flip to loaded so the empty-state UI can render.+ // Clear any stale persisted model names so callers don't try to+ // generate against a model that no longer exists.+ const state = useCreateStore.getState()+ if (state.imageModel) {+ console.warn(`[useCreate] Clearing stale persisted imageModel "${state.imageModel}" (0 models installed).`)+ state.setImageModel('', 'unknown')+ }+ if (state.videoModel) {+ console.warn(`[useCreate] Clearing stale persisted videoModel "${state.videoModel}" (0 models installed).`)+ state.setVideoModel('')+ }setModelsLoaded(true)- setModelLoadError('ComfyUI is running but found 0 models. Make sure models are in ComfyUI/models/ subfolders (checkpoints/, diffusion_models/). Try Refresh or restart ComfyUI in Settings.')+ setModelLoadError(null) // empty-state UI handles this — don't double-up}return}@@ -127,15 +138,25 @@ export function useCreate() {setModelsLoaded(true)const state = useCreateStore.getState()- // Auto-select first models if none set- if (imgModels.length > 0 && !state.imageModel) {- state.setImageModel(imgModels[0].name, imgModels[0].type)+ // Auto-select first models if none set (or stale name no longer exists)+ if (imgModels.length > 0) {+ if (!state.imageModel) {+ state.setImageModel(imgModels[0].name, imgModels[0].type)+ }+ } else if (state.imageModel) {+ // Image models absent but videos found — clear stale image model+ console.warn(`[useCreate] No image models installed, clearing stale imageModel "${state.imageModel}".`)+ state.setImageModel('', 'unknown')}if (vidModels.length > 0) {if (!state.videoModel || !vidModels.find(m => m.name === state.videoModel)) {if (state.videoModel) console.warn(`[useCreate] Persisted videoModel "${state.videoModel}" not found, resetting to ${vidModels[0].name}`)state.setVideoModel(vidModels[0].name)}+ } else if (state.videoModel) {+ // Video models absent but images found — clear stale video model+ console.warn(`[useCreate] No video models installed, clearing stale videoModel "${state.videoModel}".`)+ state.setVideoModel('')}// Always re-sync model type for currently selected model (fixes stale type after restart)if (state.imageModel && imgModels.length > 0) {diff --git a/src/stores/__tests__/sessionStores.test.ts b/src/stores/__tests__/sessionStores.test.tsindex 4dcb91ed..e79a2552 100644--- a/src/stores/__tests__/sessionStores.test.ts+++ b/src/stores/__tests__/sessionStores.test.ts@@ -113,6 +113,23 @@ describe('codexStore', () => {expect(useCodexStore.getState().chatMode).toBe('codex')})})++ describe('chatMode default on boot (v2.3.9 regression)', () => {+ // Newcomers should always land in Chat ('lu') on startup, not in whatever+ // tab they left off in. codexStore intentionally excludes chatMode from+ // partialize so the default is used on every fresh boot.+ it('initial chatMode is "lu" regardless of prior setChatMode calls in a previous simulated session', () => {+ // Simulate a "previous session" setting chatMode to codex.+ useCodexStore.setState({ chatMode: 'codex' })+ expect(useCodexStore.getState().chatMode).toBe('codex')+ // Simulate the setup that beforeEach would run on next boot — reset to+ // the store's initial values. If chatMode were persisted, a real app+ // boot would re-hydrate it from localStorage; by excluding it from+ // partialize we guarantee the default ('lu') shows up instead.+ useCodexStore.setState({ chatMode: 'lu' })+ expect(useCodexStore.getState().chatMode).toBe('lu')+ })+ })})// ── claudeCodeStore ──────────────────────────────────────────diff --git a/src/stores/codexStore.ts b/src/stores/codexStore.tsindex 0c486728..eed0271d 100644--- a/src/stores/codexStore.ts+++ b/src/stores/codexStore.ts@@ -94,10 +94,22 @@ export const useCodexStore = create<CodexState>()(}),{name: 'locally-uncensored-codex',+ // chatMode is intentionally NOT persisted: newcomers should always land in+ // the Chat tab on startup, not whatever tab they left off in. If a user+ // wants to stay in Codex or Claude Code, they pick it from the sidebar+ // each session. workingDirectory still persists so Codex remembers the+ // last project path.partialize: (state) => ({- chatMode: state.chatMode,workingDirectory: state.workingDirectory,}),+ // Existing installs have a persisted `chatMode: 'codex'` (or similar) in+ // localStorage from v2.3.8 and earlier. partialize only affects writes,+ // so rehydration would still restore the old value until the user next+ // switches tabs. Force it back to the default on every rehydrate so the+ // fix takes effect on existing users too, not just fresh installs.+ onRehydrateStorage: () => (state) => {+ if (state) state.chatMode = 'lu'+ },}))