Floating monitor: magnet docking and admin memory actions

The magnet docks the monitor bottom-right: beside the minimap in the graph,
in the corner of the App view; dragging undocks it. Admins get Unload models
and Free models & cache. /free now needs admin.
This commit is contained in:
Edouard Durand
2026-09-27 01:39:34 +00:00
parent 02dfd79523
commit 6154ce1a03
8 changed files with 126 additions and 11 deletions
+1
View File
@@ -122,6 +122,7 @@ def comfy_routes(user_root, queue=None):
table.route("*", prefix + "/prompt")(prompt)
table.post(prefix + "/queue")(queue_route)
table.post(prefix + "/interrupt")(ok)
table.post(prefix + "/free")(ok)
table.route("*", prefix + "/manager/{tail:.*}")(ok)
table.route("*", prefix + "/customnode/{tail:.*}")(ok)
return table
+11
View File
@@ -592,3 +592,14 @@ def test_manager_tab_option(run):
assert (await sock.until("server"))["server"]["manager_tab"] is True
await sock.close()
run(scenario())
def test_freeing_memory_is_admin_only(run):
async def scenario():
async with rig_server() as rig:
admin = await rig.setup_admin()
queuer = await rig.add_user("queuer", queue=True, manager=True)
body = {"unload_models": True, "free_memory": True}
assert (await rig.http.post(rig.url("/api/free"), json=body, headers=queuer)).status == 403, "affects everyone's runs"
assert (await rig.http.post(rig.url("/api/free"), json=body, headers=admin)).status == 200
run(scenario())