The gate makes the directories ComfyUI dies without

ComfyUI lists its base directory's custom_nodes before anything else and
exits when there is none.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This commit is contained in:
Ilker ManapandClaude Opus 5.5 committed 2026-10-10 00:55:23 +02:00
1 parent fde1501e8a
commit 354461d3bf
2 files changed
+10

No files matched your search

+7
View File
@@ -81,6 +81,13 @@ func RunGate(ctx context.Context, cfg GateConfig) error {
if err != nil {
return err
}
// What ComfyUI expects to find in its base directory, and dies
// without: custom_nodes is listed before anything else is done.
for _, d := range []string{"custom_nodes", "input", "output", "temp", "user"} {
if err := os.MkdirAll(filepath.Join(state, d), 0o755); err != nil {
return err
}
}
models := filepath.Join(state, "models")
if err := LinkWeights(cfg.Weights, models); err != nil {
return err
+3
View File
@@ -174,6 +174,9 @@ func TestTheGateRunsComfyUIAndEndsWithIt(t *testing.T) {
if _, err := os.Lstat(filepath.Join(state, "models", "flux.safetensors")); err != nil {
t.Error("the weights were not shown to ComfyUI:", err)
}
if _, err := os.Stat(filepath.Join(state, "custom_nodes")); err != nil {
t.Error("ComfyUI lists custom_nodes in its base directory first thing, and it is not there:", err)
}
if get("/quit") != http.StatusNotFound {
t.Error("a path the router never asks for was let through")
}