COMFY_DIR alone manages ComfyUI: derive the launch command from the standard venv layout
This commit is contained in:
@@ -222,3 +222,28 @@ func TestGameDetectionSettings(t *testing.T) {
|
||||
t.Fatal("GPUIgnoreProcs default must not be empty")
|
||||
}
|
||||
}
|
||||
|
||||
func TestComfyDirOnlyEnablesManaged(t *testing.T) {
|
||||
// COMFY_DIR without COMFY_CMD and without COMFY_URL is a mistake.
|
||||
_, err := Load(func(k string) string {
|
||||
if k == "COMFY_DIR" {
|
||||
return `C:\ComfyUI`
|
||||
}
|
||||
return ""
|
||||
})
|
||||
if err == nil || !strings.Contains(err.Error(), "COMFY_DIR") {
|
||||
t.Fatalf("err = %v, want COMFY_DIR/COMFY_URL validation error", err)
|
||||
}
|
||||
// With COMFY_URL it loads — the launch command is derived from the dir.
|
||||
if _, err := Load(func(k string) string {
|
||||
switch k {
|
||||
case "COMFY_DIR":
|
||||
return `C:\ComfyUI`
|
||||
case "COMFY_URL":
|
||||
return "http://127.0.0.1:8189"
|
||||
}
|
||||
return ""
|
||||
}); err != nil {
|
||||
t.Fatalf("COMFY_DIR with COMFY_URL must load: %v", err)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user