From db111701d31ad89f63e924ef4254e4bc32308ae6 Mon Sep 17 00:00:00 2001 From: Robin Huang Date: Tue, 8 Oct 2024 16:53:35 -0700 Subject: [PATCH 1/2] Add copyright info. --- forge.config.ts | 2 ++ package.json | 1 + 2 files changed, 3 insertions(+) diff --git a/forge.config.ts b/forge.config.ts index 53606e2b..ee3aaf45 100644 --- a/forge.config.ts +++ b/forge.config.ts @@ -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: { diff --git a/package.json b/package.json index 04378beb..2328f4a3 100644 --- a/package.json +++ b/package.json @@ -2,6 +2,7 @@ "name": "comfyui-electron", "productName": "ComfyUI", "repository": "github:comfy-org/electron", + "copyright": "Copyright © 2024 Comfy Org", "version": "0.1.21", "description": "The best modular GUI to run AI diffusion models.", "main": ".vite/build/main.js", From 3a9a396c4d2bc8681d4e2498a7e2ef005be1fd09 Mon Sep 17 00:00:00 2001 From: Robin Huang Date: Tue, 8 Oct 2024 16:54:30 -0700 Subject: [PATCH 2/2] Install missing uv (#67) --- package.json | 2 +- src/main.ts | 19 +++++++++++++++++-- 2 files changed, 18 insertions(+), 3 deletions(-) diff --git a/package.json b/package.json index 2328f4a3..f124b859 100644 --- a/package.json +++ b/package.json @@ -3,7 +3,7 @@ "productName": "ComfyUI", "repository": "github:comfy-org/electron", "copyright": "Copyright © 2024 Comfy Org", - "version": "0.1.21", + "version": "0.1.22", "description": "The best modular GUI to run AI diffusion models.", "main": ".vite/build/main.js", "packageManager": "yarn@4.5.0", diff --git a/src/main.ts b/src/main.ts index d0f322b7..d86dabc0 100644 --- a/src/main.ts +++ b/src/main.ts @@ -203,7 +203,7 @@ const isComfyServerReady = async (host: string, port: number): Promise }; // Launch Python Server Variables -const maxFailWait: number = 60 * 1000; // 60seconds +const maxFailWait: number = 120 * 1000; // 120seconds let currentWaitTime = 0; let spawnServerTimeout: NodeJS.Timeout = null; @@ -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, () => { @@ -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) {