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.

fix(windows): no console-window flash on the nvidia-smi / where-lms probes

purpleb66dc9808f1a
diff --git a/src-tauri/src/commands/install.rs b/src-tauri/src/commands/install.rs
index e911b7f8..15b9366e 100644
--- a/src-tauri/src/commands/install.rs
+++ b/src-tauri/src/commands/install.rs
@@ -1382,8 +1382,13 @@ fn lmstudio_lms_path() -> Option<PathBuf> {
}
// Last resort: PATH lookup. Catches non-standard installs (Chocolatey,
- // user-relocated install dir, etc.).
- if let Ok(out) = Command::new("where").arg("lms").output() {
+ // user-relocated install dir, etc.). CREATE_NO_WINDOW so this `where` probe
+ // never flashes a console window at the end user.
+ let mut where_cmd = Command::new("where");
+ where_cmd.arg("lms");
+ #[cfg(target_os = "windows")]
+ where_cmd.creation_flags(CREATE_NO_WINDOW);
+ if let Ok(out) = where_cmd.output() {
if out.status.success() {
let s = String::from_utf8_lossy(&out.stdout);
if let Some(line) = s.lines().next() {
diff --git a/src-tauri/src/commands/process.rs b/src-tauri/src/commands/process.rs
index 14020a23..bdd4d251 100644
--- a/src-tauri/src/commands/process.rs
+++ b/src-tauri/src/commands/process.rs
@@ -95,8 +95,13 @@ pub fn needs_cpu_fallback() -> bool {
/// Is an NVIDIA driver present (nvidia-smi exits 0)?
fn nvidia_present() -> bool {
- Command::new("nvidia-smi")
- .output()
+ // CREATE_NO_WINDOW: this probe runs on every ComfyUI start — without it an
+ // NVIDIA Windows box flashes a console window each time. End users must
+ // never see a terminal pop up.
+ let mut cmd = Command::new("nvidia-smi");
+ #[cfg(target_os = "windows")]
+ cmd.creation_flags(CREATE_NO_WINDOW);
+ cmd.output()
.map(|o| o.status.success())
.unwrap_or(false)
}