Skip to content

Commit

Permalink
Merge branch 'main' of github.com:Comfy-Org/electron
Browse files Browse the repository at this point in the history
  • Loading branch information
robinjhuang committed Oct 9, 2024
2 parents 83e64dd + 3a9a396 commit c64af2a
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 3 deletions.
2 changes: 2 additions & 0 deletions forge.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,13 @@ import { MakerRpm } from '@electron-forge/maker-rpm';
import { VitePlugin } from '@electron-forge/plugin-vite';
import { FusesPlugin } from '@electron-forge/plugin-fuses';
import { FuseV1Options, FuseVersion } from '@electron/fuses';

import path from 'path';
import fs from 'fs';

const config: ForgeConfig = {
packagerConfig: {
appCopyright: 'Copyright © 2024 Comfy Org',
asar: true,
...(process.env.PUBLISH == 'true' && {
windowsSign: {
Expand Down
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@
"name": "comfyui-electron",
"productName": "ComfyUI",
"repository": "github:comfy-org/electron",
"version": "0.1.21",
"copyright": "Copyright © 2024 Comfy Org",
"version": "0.1.22",
"description": "The best modular GUI to run AI diffusion models.",
"main": ".vite/build/main.js",
"packageManager": "[email protected]",
Expand Down
19 changes: 17 additions & 2 deletions src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,7 @@ const isComfyServerReady = async (host: string, port: number): Promise<boolean>
};

// Launch Python Server Variables
const maxFailWait: number = 60 * 1000; // 60seconds
const maxFailWait: number = 120 * 1000; // 120seconds
let currentWaitTime = 0;
let spawnServerTimeout: NodeJS.Timeout = null;

Expand Down Expand Up @@ -329,7 +329,7 @@ app.on('ready', async () => {
await launchPythonServer(pythonInterpreterPath, appResourcesPath, userResourcesPath);
} catch (error) {
log.error(error);
sendProgressUpdate(0, error.message);
sendProgressUpdate(0, "Was not able to start ComfyUI. Please check the logs for more details. You can open it from the tray icon.");
}

ipcMain.on(IPC_CHANNELS.RESTART_APP, () => {
Expand Down Expand Up @@ -624,6 +624,21 @@ async function setupPythonEnvironment(
'--verbose',
];
}

//TODO(robinhuang): remove this once uv is included in the python bundle.
const { exitCode: uvExitCode } = await spawnPythonAsync(pythonInterpreterPath, [
'-m',
'pip',
'install',
'--upgrade',
'uv',
], pythonRootPath, { stdx: true });

if (uvExitCode !== 0) {
log.error('Failed to install uv');
throw new Error('Failed to install uv');
}

const { exitCode } = await spawnPythonAsync(pythonInterpreterPath, rehydrateCmd, pythonRootPath, { stdx: true });

if (exitCode === 0) {
Expand Down

0 comments on commit c64af2a

Please sign in to comment.