Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions src/config/comfySettings.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import path from 'node:path';
export const DEFAULT_SETTINGS: ComfySettingsData = {
'Comfy-Desktop.AutoUpdate': true,
'Comfy-Desktop.SendStatistics': true,
'Comfy-Desktop.LaunchOptions': '',
'Comfy.ColorPalette': 'dark',
'Comfy.UseNewMenu': 'Top',
'Comfy.Workflow.WorkflowTabsPosition': 'Topbar',
Expand All @@ -23,6 +24,7 @@ export interface ComfySettingsData {
'Comfy.Workflow.WorkflowTabsPosition': 'Topbar' | 'Sidebar';
'Comfy.Workflow.ShowMissingModelsWarning': boolean;
'Comfy.Server.LaunchArgs': Record<string, string>;
'Comfy-Desktop.LaunchOptions': string;
'Comfy-Desktop.UV.PythonInstallMirror': string;
'Comfy-Desktop.UV.PypiInstallMirror': string;
'Comfy-Desktop.UV.TorchInstallMirror': string;
Expand Down
8 changes: 6 additions & 2 deletions src/main-process/comfyServer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import waitOn from 'wait-on';
import { removeAnsiCodesTransform } from '@/infrastructure/structuredLogging';

import { ComfyServerConfig } from '../config/comfyServerConfig';
import { ComfySettings } from '../config/comfySettings';
import { ComfySettings, useComfySettings } from '../config/comfySettings';
import { IPC_CHANNELS, LogFile, ServerArgs } from '../constants';
import { getAppResourcesPath } from '../install/resourcePaths';
import { HasTelemetry, ITelemetry, trackEvent } from '../services/telemetry';
Expand Down Expand Up @@ -109,7 +109,11 @@ export class ComfyServer implements HasTelemetry {
...this.coreLaunchArgs,
...this.serverArgs,
});
return [this.mainScriptPath, ...args];
const settings = useComfySettings();
const customArgsString = settings.get('Comfy-Desktop.LaunchOptions');
// This regex splits the string by spaces, but keeps quoted sections together.
const customArgs = customArgsString ? customArgsString.split(' ').filter(Boolean) : [];
return [this.mainScriptPath, ...args, ...customArgs];
}

@trackEvent('comfyui:server_start')
Expand Down
Loading