Skip to content

Commit

Permalink
Override user directory.
Browse files Browse the repository at this point in the history
  • Loading branch information
robinjhuang committed Sep 11, 2024
1 parent c55a192 commit d32105c
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,6 @@ import tar from 'tar';
let pythonProcess: ChildProcess | null = null;
const host = '127.0.0.1'; // Replace with the desired IP address
const port = 8188; // Replace with the port number your server is running on
const scriptPath = path.join(process.resourcesPath, 'ComfyUI', 'main.py');

const packagedComfyUIExecutable = process.platform == 'win32' ? 'run_cpu.bat' : process.platform == 'darwin' ? 'ComfyUI' : 'ComfyUI';

const createWindow = () => {
// Create the browser window.
Expand Down Expand Up @@ -127,7 +124,10 @@ const launchPythonServer = async (args: {userResourcesPath: string, appResources
const pythonInterpreterPath = process.platform==='win32' ? path.join(pythonRootPath, 'python.exe') : path.join(pythonRootPath, 'bin', 'python');
const pythonRecordPath = path.join(pythonRootPath, "INSTALLER");
const scriptPath = path.join(appResourcesPath, 'ComfyUI', 'main.py');
const comfyMainCmd = [scriptPath, ...(process.env.COMFYUI_CPU_ONLY === "true" ? ["--cpu"] : [])];
const userDirectoryPath = path.join(app.getPath('userData'), 'user');
const comfyMainCmd = [scriptPath,
'--user-directory', userDirectoryPath,
...(process.env.COMFYUI_CPU_ONLY === "true" ? ["--cpu"] : [])];

const spawnPython = async () => {
pythonProcess = spawn(pythonInterpreterPath, comfyMainCmd, {
Expand Down

0 comments on commit d32105c

Please sign in to comment.