Skip to content

Commit

Permalink
Install missing uv (#67)
Browse files Browse the repository at this point in the history
  • Loading branch information
robinjhuang authored Oct 8, 2024
1 parent db11170 commit 3a9a396
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 3 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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": "[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 3a9a396

Please sign in to comment.