mirror of
https://github.com/Comfy-Org/ComfyUI_frontend.git
synced 2026-04-27 17:52:16 +00:00
Add Comfy-Desktop.ComfyServer.ExtraLaunchArgs (#1609)
This commit is contained in:
@@ -5,6 +5,14 @@ import { electronAPI as getElectronAPI, isElectron } from '@/utils/envUtil'
|
|||||||
|
|
||||||
const electronAPI = getElectronAPI()
|
const electronAPI = getElectronAPI()
|
||||||
const desktopAppVersion = await electronAPI.getElectronVersion()
|
const desktopAppVersion = await electronAPI.getElectronVersion()
|
||||||
|
|
||||||
|
const onChangeRestartApp = (newValue: string, oldValue: string) => {
|
||||||
|
// Add a delay to allow changes to take effect before restarting.
|
||||||
|
if (oldValue !== undefined && newValue !== oldValue) {
|
||||||
|
electronAPI.restartApp('Restart ComfyUI to apply changes.', 1500)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
app.registerExtension({
|
app.registerExtension({
|
||||||
name: 'Comfy.ElectronAdapter',
|
name: 'Comfy.ElectronAdapter',
|
||||||
settings: [
|
settings: [
|
||||||
@@ -14,14 +22,7 @@ import { electronAPI as getElectronAPI, isElectron } from '@/utils/envUtil'
|
|||||||
name: 'Automatically check for updates',
|
name: 'Automatically check for updates',
|
||||||
type: 'boolean',
|
type: 'boolean',
|
||||||
defaultValue: true,
|
defaultValue: true,
|
||||||
onChange(newValue, oldValue) {
|
onChange: onChangeRestartApp
|
||||||
if (oldValue !== undefined && newValue !== oldValue) {
|
|
||||||
electronAPI.restartApp(
|
|
||||||
'Restart ComfyUI to apply changes.',
|
|
||||||
1500 // add delay to allow changes to take effect before restarting.
|
|
||||||
)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
id: 'Comfy-Desktop.SendStatistics',
|
id: 'Comfy-Desktop.SendStatistics',
|
||||||
@@ -29,14 +30,15 @@ import { electronAPI as getElectronAPI, isElectron } from '@/utils/envUtil'
|
|||||||
name: 'Send anonymous usage statistics',
|
name: 'Send anonymous usage statistics',
|
||||||
type: 'boolean',
|
type: 'boolean',
|
||||||
defaultValue: true,
|
defaultValue: true,
|
||||||
onChange(newValue, oldValue) {
|
onChange: onChangeRestartApp
|
||||||
if (oldValue !== undefined && newValue !== oldValue) {
|
},
|
||||||
electronAPI.restartApp(
|
{
|
||||||
'Restart ComfyUI to apply changes.',
|
id: 'Comfy-Desktop.ComfyServer.ExtraLaunchArgs',
|
||||||
1500 // add delay to allow changes to take effect before restarting.
|
category: ['Comfy-Desktop', 'ComfyUI Server'],
|
||||||
)
|
name: 'Extra launch arguments passed to the ComfyUI main.py script',
|
||||||
}
|
type: 'text',
|
||||||
}
|
defaultValue: '',
|
||||||
|
onChange: onChangeRestartApp
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user