Skip to content

Commit

Permalink
Reconciled conflicts
Browse files Browse the repository at this point in the history
  • Loading branch information
KenCorma committed Sep 3, 2024
2 parents e841091 + bac144b commit b07d42d
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 8 deletions.
7 changes: 7 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ typings/

# TypeScript cache
*.tsbuildinfo
dist

# Optional npm cache directory
.npm
Expand All @@ -57,6 +58,9 @@ typings/
# Yarn Integrity file
.yarn-integrity

# Yarn cache files
.yarn

# dotenv environment variables file
.env
.env.test
Expand Down Expand Up @@ -95,6 +99,9 @@ out/
comfyui-prebuilt
comfyui

# vscode
*.code-workspace
.history
.vscode/*

assets/ComfyUI
Expand Down
19 changes: 14 additions & 5 deletions forge.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ const config: ForgeConfig = {
debug:true,
hookFunction: (filePath) => {
if (!filePath.endsWith("ComfyUI.exe")) return; // For now just ignore any file that isnt the main exe will need to change when building with installers/auto updates / a compiled python servesr
require("child_process").execSync(`signtool.exe sign /sha1 ${process.env.DIGICERT_FINGERPRINT} /tr http://timestamp.digicert.com /td SHA256 /fd SHA256 ${filePath}`)
import("child_process").then(cp => cp.execSync(`signtool.exe sign /sha1 ${process.env.DIGICERT_FINGERPRINT} /tr http://timestamp.digicert.com /td SHA256 /fd SHA256 ${filePath}`));
},
}},
osxSign: {
Expand All @@ -25,12 +25,12 @@ const config: ForgeConfig = {
return { entitlements: './assets/entitlements.mac.plist' };
}
},
extraResource: ['./assets/UI', './assets/ComfyUI', './assets/python'],
extraResource: ['./assets/UI', './assets/ComfyUI', process.platform === 'darwin' ? './assets/python' : './assets/python.tgz'],
osxNotarize: {
appleId: process.env.APPLE_ID,
appleIdPassword: process.env.APPLE_PASSWORD,
teamId: process.env.APPLE_TEAM_ID
}
},
},
rebuildConfig: {},
hooks: {
Expand All @@ -44,8 +44,17 @@ const config: ForgeConfig = {
},
makers: [
new MakerZIP({}, ['darwin', 'win32']),
new MakerRpm({}),
new MakerDeb({}),
// the forge build produces a "ComfyUI" bin, but the rpm/deb makers expect a "comfyui-electron" bin (matching the "name" in package.json). We override this below
new MakerRpm({
options: {
bin: "ComfyUI"
}
}),
new MakerDeb({
options: {
bin: "ComfyUI"
}
}),
],
plugins: [
new VitePlugin({
Expand Down
14 changes: 11 additions & 3 deletions src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,13 @@ import net from 'net';
import { spawn, ChildProcess } from 'child_process';

// Handle creating/removing shortcuts on Windows when installing/uninstalling.
if (require('electron-squirrel-startup')) {
app.quit();
}
import('electron-squirrel-startup').then(ess => {
const {default: check} = ess;
if (check) {
app.quit();
}
});

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
Expand Down Expand Up @@ -82,6 +86,10 @@ const launchPythonServer = async () => {
executablePath = path.join(process.resourcesPath, 'UI', packagedComfyUIExecutable);
pythonProcess = spawn(executablePath, { shell: true });
}
} else {
executablePath = path.join(process.resourcesPath, 'UI', packagedComfyUIExecutable);
pythonProcess = spawn(executablePath, { shell: true });
}
} else {
// Development: use the fake Python server
if (process.platform == 'darwin') {
Expand Down

0 comments on commit b07d42d

Please sign in to comment.