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.

v2.5.0 fix: ComfyUI phantom "starting" forever on crash + phantom "Name" GPU on Windows

purple106c3e322dd7
diff --git a/src-tauri/src/commands/gpu.rs b/src-tauri/src/commands/gpu.rs
index f74f0ec3..dc907686 100644
--- a/src-tauri/src/commands/gpu.rs
+++ b/src-tauri/src/commands/gpu.rs
@@ -202,13 +202,18 @@ fn detect_other_via_wmic() -> Vec<DetectedGpu> {
};
let mut gpus = Vec::new();
let mut idx: u32 = 0;
- for line in raw.lines().skip(1) {
+ // wmic `/format:csv` emits a LEADING blank line before the header row
+ // ("Node,AdapterRAM,Name"). A bare `.skip(1)` would skip that blank line and
+ // then parse the header itself as a device → a phantom GPU literally named
+ // "Name". Filter empty lines FIRST (same as detect_amd), THEN skip the
+ // header, and defensively drop the header label if the format ever shifts.
+ for line in raw.lines().filter(|l| !l.trim().is_empty()).skip(1) {
let parts: Vec<&str> = line.split(',').map(|s| s.trim()).collect();
// Format: Node, AdapterRAM, Name
if parts.len() < 3 { continue }
let ram_bytes: Option<u64> = parts[1].parse().ok();
let name = parts[2].to_string();
- if name.is_empty() { continue }
+ if name.is_empty() || name.eq_ignore_ascii_case("name") { continue }
let lname = name.to_lowercase();
let vendor = if lname.contains("intel") { "intel" }
else if lname.contains("amd") || lname.contains("radeon") { "amd" }
diff --git a/src-tauri/src/commands/process.rs b/src-tauri/src/commands/process.rs
index f8b441fa..983b5566 100644
--- a/src-tauri/src/commands/process.rs
+++ b/src-tauri/src/commands/process.rs
@@ -892,9 +892,30 @@ pub async fn comfyui_status(state: State<'_, AppState>) -> Result<serde_json::Va
None => false,
};
+ // Reap the spawned child so a crash-on-startup doesn't read as "alive".
+ // We store the Child from start_comfyui in state.comfy_process. If that
+ // process exits early (the classic case: ComfyUI's main.py aborts on a bad
+ // dependency / missing torch / SQLAlchemy<2.0 / "no NVIDIA driver" before it
+ // binds the port), the handle would otherwise linger as Some(_) forever —
+ // making process_alive=true and therefore `starting` (process_alive &&
+ // !running) STICK TRUE INDEFINITELY. The user then stares at an endless
+ // "ComfyUI starting…" with no error. try_wait() detects the early exit so we
+ // clear the handle and report "stopped", letting the UI re-offer "click to
+ // start" + the troubleshoot panel instead of a phantom loading state.
let process_alive = {
- let proc = state.comfy_process.lock().unwrap();
- proc.is_some()
+ let mut proc = state.comfy_process.lock().unwrap();
+ match proc.as_mut() {
+ Some(child) => match child.try_wait() {
+ Ok(Some(status)) => {
+ error!(exit = ?status, "comfyui process exited early (crash on startup?) — clearing handle");
+ *proc = None;
+ false
+ }
+ Ok(None) => true, // still running; just hasn't bound the port yet
+ Err(_) => true, // can't determine — assume alive, don't thrash
+ },
+ None => false,
+ }
};
let path = {