diff --git a/src/handlers/pathHandlers.ts b/src/handlers/pathHandlers.ts index 8a7ab03b..b86bbb76 100644 --- a/src/handlers/pathHandlers.ts +++ b/src/handlers/pathHandlers.ts @@ -7,7 +7,6 @@ import fs from 'fs'; import si from 'systeminformation'; import { ComfyConfigManager } from '../config/comfyConfigManager'; import path from 'path'; -import { validateHardware } from '../utils'; export class PathHandlers { static readonly REQUIRED_SPACE = 10 * 1024 * 1024 * 1024; // 10GB in bytes @@ -43,10 +42,6 @@ export class PathHandlers { ipcMain.handle( IPC_CHANNELS.VALIDATE_INSTALL_PATH, async (event, inputPath: string): Promise<{ isValid: boolean; error?: string }> => { - const validation = await validateHardware(); - if (!validation.isValid) { - return validation; - } try { // Check if path exists if (!fs.existsSync(inputPath)) { diff --git a/src/main-process/comfyDesktopApp.ts b/src/main-process/comfyDesktopApp.ts index e2865ed1..5d7e578d 100644 --- a/src/main-process/comfyDesktopApp.ts +++ b/src/main-process/comfyDesktopApp.ts @@ -11,7 +11,7 @@ import { ComfyServerConfig } from '../config/comfyServerConfig'; import fs from 'fs'; import { InstallOptions } from '../preload'; import path from 'path'; -import { getModelsDirectory } from '../utils'; +import { getModelsDirectory, validateHardware } from '../utils'; import { DownloadManager } from '../models/DownloadManager'; import { VirtualEnvironment } from '../virtualEnvironment'; import { InstallWizard } from '../install/installWizard'; @@ -133,6 +133,12 @@ export class ComfyDesktopApp { * Install ComfyUI and return the base path. */ static async install(appWindow: AppWindow): Promise { + const validation = await validateHardware(); + if (!validation.isValid) { + await appWindow.loadRenderer('not-supported'); + throw new Error(validation.error); + } + await appWindow.loadRenderer('welcome'); return new Promise((resolve) => { ipcMain.on(IPC_CHANNELS.INSTALL_COMFYUI, async (event, installOptions: InstallOptions) => {