Skip to content

Commit

Permalink
Fix .env CPU flag ignored (#449)
Browse files Browse the repository at this point in the history
  • Loading branch information
webfiltered authored Dec 7, 2024
1 parent c0ead0f commit 529bb1f
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/main-process/comfyServer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ export class ComfyServer {
Object.entries(args)
.map(([key, value]) => [`--${key}`, value])
.flat()
// Empty string values are ignored. e.g. { '--cpu': '' } => '--cpu'
// Empty string values are ignored. e.g. { cpu: '' } => '--cpu'
.filter((value: string) => value !== '')
);
}
Expand Down
2 changes: 1 addition & 1 deletion src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ async function startApp() {
const host = process.env.COMFY_HOST || DEFAULT_SERVER_ARGS.host;
const targetPort = process.env.COMFY_PORT ? parseInt(process.env.COMFY_PORT) : DEFAULT_SERVER_ARGS.port;
const port = useExternalServer ? targetPort : await findAvailablePort(host, targetPort, targetPort + 1000);
const cpuOnly: Record<string, string> = process.env.COMFYUI_CPU_ONLY === 'true' ? { '--cpu': '' } : {};
const cpuOnly: Record<string, string> = process.env.COMFYUI_CPU_ONLY === 'true' ? { cpu: '' } : {};
const extraServerArgs: Record<string, string> = {
...comfyDesktopApp.comfySettings.get('Comfy.Server.LaunchArgs'),
...cpuOnly,
Expand Down

0 comments on commit 529bb1f

Please sign in to comment.