[Electron] ComfyUI server config (Launch args config) (#1644)

* Remove electron adapter server args

* Add server args typing

* Add server config constant file

* Tooltip to name; name to id

* Capitalize category

* Server config store

* Prevent default value

* Add serverconfig test

* Guard server config panel with electron flag

* Filter nullish values from server args

* Use slider for preview size
This commit is contained in:
Chenlei Hu
2024-11-22 13:50:24 -08:00
committed by GitHub
parent 3920210c5c
commit 4007cc13c2
9 changed files with 846 additions and 9 deletions

View File

@@ -526,7 +526,9 @@ const zSettings = z.record(z.any()).and(
'Comfy.Settings.ExtensionPanel': z.boolean(),
'Comfy.LinkRenderMode': z.number(),
'Comfy.Node.AutoSnapLinkToSlot': z.boolean(),
'Comfy.Node.SnapHighlightsNode': z.boolean()
'Comfy.Node.SnapHighlightsNode': z.boolean(),
'Comfy.Server.ServerConfigValues': z.record(z.string(), z.any()),
'Comfy.Server.LaunchArgs': z.record(z.string(), z.string())
})
.optional()
)

65
src/types/serverArgs.ts Normal file
View File

@@ -0,0 +1,65 @@
export enum LatentPreviewMethod {
NoPreviews = 'none',
Auto = 'auto',
Latent2RGB = 'latent2rgb',
TAESD = 'taesd'
}
export enum LogLevel {
DEBUG = 'DEBUG',
INFO = 'INFO',
WARNING = 'WARNING',
ERROR = 'ERROR',
CRITICAL = 'CRITICAL'
}
export enum HashFunction {
MD5 = 'md5',
SHA1 = 'sha1',
SHA256 = 'sha256',
SHA512 = 'sha512'
}
export enum AutoLaunch {
// Let server decide whether to auto launch based on the current environment
Auto = 'auto',
// Disable auto launch
Disable = 'disable',
// Enable auto launch
Enable = 'enable'
}
export enum CudaMalloc {
// Let server decide whether to use CUDA malloc based on the current environment
Auto = 'auto',
// Disable CUDA malloc
Disable = 'disable',
// Enable CUDA malloc
Enable = 'enable'
}
export enum FloatingPointPrecision {
AUTO = 'auto',
FP32 = 'fp32',
FP16 = 'fp16',
BF16 = 'bf16',
FP8E4M3FN = 'fp8_e4m3fn',
FP8E5M2 = 'fp8_e5m2'
}
export enum CrossAttentionMethod {
Auto = 'auto',
Split = 'split',
Quad = 'quad',
Pytorch = 'pytorch'
}
export enum VramManagement {
Auto = 'auto',
GPUOnly = 'gpu-only',
HighVram = 'highvram',
NormalVram = 'normalvram',
LowVram = 'lowvram',
NoVram = 'novram',
CPU = 'cpu'
}