Skip to content

Commit

Permalink
Load not supported page when hardware is not supported (#383)
Browse files Browse the repository at this point in the history
* Load not supported page when hardware is not supported

* Update frontend to v1.5.0
  • Loading branch information
huchenlei authored Nov 28, 2024
1 parent 953cc68 commit d85c7d2
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 7 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"main": ".vite/build/main.js",
"packageManager": "[email protected]",
"config": {
"frontendVersion": "1.4.13",
"frontendVersion": "1.5.0",
"comfyVersion": "0.3.2",
"managerCommit": "ada683c6bafcb983c8366e4310b7f95f66bd6362",
"uvVersion": "0.5.4"
Expand Down
5 changes: 0 additions & 5 deletions src/handlers/pathHandlers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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)) {
Expand Down
8 changes: 7 additions & 1 deletion src/main-process/comfyDesktopApp.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down Expand Up @@ -133,6 +133,12 @@ export class ComfyDesktopApp {
* Install ComfyUI and return the base path.
*/
static async install(appWindow: AppWindow): Promise<string> {
const validation = await validateHardware();
if (!validation.isValid) {
await appWindow.loadRenderer('not-supported');
throw new Error(validation.error);
}

await appWindow.loadRenderer('welcome');
return new Promise<string>((resolve) => {
ipcMain.on(IPC_CHANNELS.INSTALL_COMFYUI, async (event, installOptions: InstallOptions) => {
Expand Down

0 comments on commit d85c7d2

Please sign in to comment.