Fix duplicate HEAD route on project result endpoint.

aiohttp registers HEAD automatically for GET routes; the explicit head
handler caused ComfyUI startup to fail with a route conflict.
This commit is contained in:
digital-garbage
2026-06-11 14:54:47 +03:00
parent 63fca2d883
commit 9e64a255e6
+11 -14
View File
@@ -947,6 +947,17 @@ if web is not None and PromptServer is not None:
@routes.get(UI_PREFIX + "/api/projects/{pid}/result")
async def _result(req):
import os
if req.method == "HEAD":
_project_or_404(req.match_info["pid"])
path = _resolve_comfy_media_path(
req.query.get("filename", ""),
req.query.get("subfolder", ""),
req.query.get("type", "output"),
)
if not path or not os.path.isfile(path):
raise web.HTTPNotFound()
return web.Response()
try:
data, ctype = await bridge.fetch_view(
req.query.get("filename", ""),
@@ -957,20 +968,6 @@ if web is not None and PromptServer is not None:
raise web.HTTPBadGateway(reason=f"could not fetch result: {e}")
return web.Response(body=data, content_type=ctype.split(";")[0])
@routes.head(UI_PREFIX + "/api/projects/{pid}/result")
async def _result_head(req):
"""Existence check for scene renders — used by the editor on project load."""
import os
_project_or_404(req.match_info["pid"])
path = _resolve_comfy_media_path(
req.query.get("filename", ""),
req.query.get("subfolder", ""),
req.query.get("type", "output"),
)
if not path or not os.path.isfile(path):
raise web.HTTPNotFound()
return web.Response()
# --- API: final render (hard-cut concat of kept clips, with per-clip in/out) ---
@routes.post(UI_PREFIX + "/api/projects/{pid}/render")
async def _render_final(req):