"""FunPack Hub — a small landing page at /funpack/ linking to the two FunPack UIs (Movie Editor "Cutting Room" and "Easy Gen"), plus an About block (version/ branch/commit) and an Update/Restart action. Talks to the Movie Editor's existing /funpack/movie/api/{health,git/status,git/update,restart} endpoints — no new backend API, same git_update.py logic the Editor's own "Updates & ComfyUI" settings section uses. Kept as a single self-contained inline page (no shared JS files) since its surface is a handful of fetch calls, much smaller than pulling in api.js/dom.js/git_actions.js/restart_ui.js would need. """ from __future__ import annotations try: from aiohttp import web from server import PromptServer except Exception: # pragma: no cover - only available inside ComfyUI web = None PromptServer = None from .movie_editor.backend import config as movie_config HUB_PREFIX = "/funpack" _PAGE = """ FunPack
◉FunPack

Pick a UI.

Loading…
Easy Gen
One prompt, one Generate button, one big preview. Advanced settings tucked away.
Cutting Room
The full multi-scene NLE — timeline, composer, overlays, audio.
""" if web is not None and PromptServer is not None: routes = PromptServer.instance.routes @routes.get(HUB_PREFIX) async def _hub_redirect(_req): raise web.HTTPFound(HUB_PREFIX + "/") @routes.get(HUB_PREFIX + "/") async def _hub_index(_req): return web.Response(body=_PAGE, content_type="text/html", headers={"Cache-Control": "no-store, max-age=0"}) print(f"[FunPack] Hub available at {movie_config.comfy_display_url()}{HUB_PREFIX}/")