Skip to content

armgit / fuobe

Public Imported from GitHub
0

The open creative studio on ComfyUI: images, video, 3D and audio on open weights, on your own GPU or the cloud. Camera motions, effects, apps, Cinema, Layers, Image to 3D and an AI agent.

Worker guard: refuse kandinsky6-sr's model downloader routes

Adarsh5ec9434b260f
diff --git a/bin/lib/worker/comfy_guard.py b/bin/lib/worker/comfy_guard.py
index 37f316a0..99a71fad 100644
--- a/bin/lib/worker/comfy_guard.py
+++ b/bin/lib/worker/comfy_guard.py
@@ -43,10 +43,20 @@ CHALLENGE = re.compile(r"^[0-9a-f]{16,128}$")
# recordings and can send UDP) is left out of the pack the worker installs; this refuses it again if a full copy loads.
# The same for ComfyUI-H3-FaceRefine's face picker (/h3_facerefine/*: it reads and serves a video from any path) and
# ComfyUI-Impact-Pack's routes (/sam/*: SAM on an image read by a path the request gives; /impact/*: wildcards,
-# preview-bridge images by path, earlier jobs' crops; /view/validate: whether a file exists), kandinsky6's model
-# downloader (/kandinsky6/*: it fetches and writes model files) and h3-relay's staged runs and previews (/h3_relay/*).
+# preview-bridge images by path, earlier jobs' crops; /view/validate: whether a file exists), kandinsky6's and
+# kandinsky6-sr's model downloaders (/kandinsky6/*, /kandinsky6-sr/*: they fetch and write model files) and
+# h3-relay's staged runs and previews (/h3_relay/*).
# ComfyUI's own /view stays open.
-BLOCKED_ROUTES = ("/instanthmr", "/h3_facerefine", "/sam", "/impact", "/view/validate", "/kandinsky6", "/h3_relay")
+BLOCKED_ROUTES = (
+ "/instanthmr",
+ "/h3_facerefine",
+ "/sam",
+ "/impact",
+ "/view/validate",
+ "/kandinsky6",
+ "/kandinsky6-sr",
+ "/h3_relay",
+)
def blocked(path: str) -> bool:
diff --git a/tests/worker-guard.test.ts b/tests/worker-guard.test.ts
index 394c323f..06612676 100644
--- a/tests/worker-guard.test.ts
+++ b/tests/worker-guard.test.ts
@@ -104,7 +104,7 @@ if __name__ == "__main__":
app.router.add_get(base + "/instanthmr/ws", ws)
app.router.add_get(base + "/instanthmr", files)
app.router.add_get(base + "/instanthmr_other", files)
- for route in ("/h3_facerefine/preview", "/sam/prepare", "/impact/wildcards/list", "/view/validate", "/kandinsky6/download-models", "/h3_relay/staged"):
+ for route in ("/h3_facerefine/preview", "/sam/prepare", "/impact/wildcards/list", "/view/validate", "/kandinsky6/download-models", "/kandinsky6-sr/download-models", "/h3_relay/staged"):
app.router.add_get(base + route, files)
app.router.add_get(base + "/view", files)
app.add_subapp("/internal", internal)
@@ -205,8 +205,8 @@ describe.skipIf(!python)("the guard in front of a stand-in ComfyUI (Python)", ()
expect(await wsOpens(`ws://${host}/api/instanthmr/ws`, key)).toBe(false);
// Only that route and what is under it: a route that merely starts with the same letters, and the rest, answer.
expect((await c.fetch(`${c.base}/instanthmr_other`)).status).toBe(200);
- // H3-FaceRefine's face picker, Impact Pack's, kandinsky6's and h3-relay's routes are refused too; ComfyUI's own /view still answers.
- for (const p of ["/h3_facerefine/preview?path=C:/x.mp4", "/api/h3_facerefine/preview", "/H3_FaceRefine/preview", "/sam/prepare", "/api/sam/prepare", "/impact/wildcards/list", "/api/Impact/wildcards/list", "/view/validate", "/api/view/validate", "/kandinsky6/download-models", "/api/kandinsky6/download-models", "/h3_relay/staged", "/api/H3_Relay/staged"]) {
+ // H3-FaceRefine's face picker, Impact Pack's, kandinsky6's, kandinsky6-sr's and h3-relay's routes are refused too; ComfyUI's own /view still answers.
+ for (const p of ["/h3_facerefine/preview?path=C:/x.mp4", "/api/h3_facerefine/preview", "/H3_FaceRefine/preview", "/sam/prepare", "/api/sam/prepare", "/impact/wildcards/list", "/api/Impact/wildcards/list", "/view/validate", "/api/view/validate", "/kandinsky6/download-models", "/api/kandinsky6/download-models", "/kandinsky6-sr/download-models", "/api/Kandinsky6-SR/models", "/h3_relay/staged", "/api/H3_Relay/staged"]) {
expect((await raw(port, p, { Host: host, ...key })).status, p).toBe(403);
}
expect((await c.fetch(`${c.base}/view`)).status).toBe(200);