Skip to content

About

nodes require comfy? why not just webapp

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

7 Commits

Folders and files

Repository files navigation

comfystatic

The native ComfyUI editor, packaged for a static host. No Python, GPU, model downloads, accounts, or Comfy server are needed to view and edit workflows.

Build dist/ from your ComfyUI installation

Requires Bun.

bun install --frozen-lockfile
bun run build --comfy-dir "/path/to/ComfyUI"

That imports the installed browser frontend, remembers the directory, and builds dist/ in this project. ComfyUI does not need to be running. No Python, GPU, server capture or Vitality is involved. Windows portable roots and built ComfyUI frontend clones work too. The local source is remembered in ignored comfystatic.local.json; subsequent bun run build copies from that same installation and rebuilds. A missing source fails the build instead of silently switching to upstream. Existing dist/ is retained on import/compile failure.

For an exact browser-assets folder, use --frontend-dir "/path/to/static" instead. A frontend source clone must have its upstream browser build already present; a backend-only checkout without installed assets uses its requirements pin to download the official frontend wheel.

Wrap that build with Vitality (/comfy/, y/y)

Run from the Comfystatic project directory:

bun run build
vitality give --dir ./dist --base /comfy/ --inline y --no-public y
cd dist/mywrap
bun install
bun run build

Deploy dist/mywrap/dist/ at /comfy/. Wrap the generated dist directory, not the source repository. y/y means inline assets plus no-public. After rebuilding Comfystatic, generate a fresh wrapper; do not keep serving an older wrapper. If you want to keep wrappers across Comfystatic rebuilds, pass Vitality an absolute --output path outside dist/.

Run the same build directly

bun run dev builds from the remembered source and serves http://127.0.0.1:8190/; bun start serves the current dist/ without rebuilding. To select and serve a different installation in one command, use bun run dev --comfy-dir "/path/to/ComfyUI". Without a remembered source or cache, build/dev downloads the official frontend version currently pinned by upstream ComfyUI. Ctrl+C stops the server. No separate development editor or renderer is used.

Optionally, to capture actual Python/custom-node definitions from a running installation:

bun run dev --comfy-dir "/path/to/ComfyUI" --comfy-url http://127.0.0.1:8188

Only --comfy-url needs a running ComfyUI. It is optional and is not remembered as a build prerequisite. Workflow JSON import works without it; see the custom-node limitations below.

Command What it does
bun run build --comfy-dir PATH Import/remember this local install → build dist/; no server
bun run dev [source options] Same build → serve
bun run dev --cached Build the existing cache → serve; no downloads
bun start / bun run serve Serve an already-built dist/; no sync or build
bun run sync [options] Update/copy sources only
bun run build Rebuild from the remembered source (or existing upstream cache)
bun run build --cached Build only the cached assets; no source refresh
bun run build --upstream Forget the local source and use upstream's official frontend
bun run info Print exact source/version/checksum and node-catalog status
bun run dev --help List source options without starting anything

HOST, PORT, and BASE_PATH configure the static server (defaults: 127.0.0.1, 8190, /). COMFY_DIR and COMFY_URL can supply defaults; explicit CLI source flags override the remembered source. Build uses the committed vendored link library; bun run sync explicitly refreshes it (or pass --skip-lnkr). No update polling happens in the web page or while the static server runs.

Deploy the complete contents of dist/ on an ordinary HTTPS static host, including comfystatic/link-import.html and links.html. Subdirectory hosting is supported. Use HTTP(S), not a file:// URL. Vitality is optional packaging, not Comfystatic's build or runtime.

Use

  • Drop a workflow JSON or a Comfy-generated PNG onto the canvas. The native importer also supports workflow metadata in other media formats supported by that frontend version.
  • Focus the canvas and press Ctrl+V to paste workflow JSON or a clipboard file with embedded workflow metadata. Native node copy/paste remains intact. Paste JSON is an optional convenience, not a required import step.
  • Open workflow uses the same native metadata importer as drag-and-drop. Copying a rendered picture through some apps strips metadata; use the original PNG file in that case.
  • Drag, connect, resize, group, copy, undo/redo, and double-click to add nodes using native Comfy controls. Workflows open in native tabs.
  • Download JSON, Ctrl+S, native Save/Save As, and Save workflow JSON in the canvas context menu download ordinary workflow JSON. A local copy is also kept in the native workflow sidebar.
  • Settings, workflows, and drafts live in this browser's local storage/IndexedDB. Export JSON for portable backups; clearing site data removes the local library.

Generation is deliberately unavailable. The run controls and backend-only sidebar pages are removed; queue requests cannot execute. The native editor's external fetch/XHR/WebSocket/beacon traffic is blocked, with a same-origin Content Security Policy as a backstop. Explicit workflow-link imports use a separate sandboxed static document for public file reads, not a proxy or application backend. The static host still serves the application files; this is not a service-worker offline installation.

Workflow links

Open link accepts public workflow JSON/media URLs, shortened ln.kr links, and bare fragments such as #s:… or #ss:…. Pasting a link onto the focused canvas or dropping a URL works too. GitHub file links and Hugging Face model/dataset/Space file links use ln.kr's raw/resolve handling.

Imports (including dropped/uploaded files and pasted JSON) update the address bar with a self-contained workflow. Copy link shares the current graph, including edits. Embedded links use Make's existing #share: file envelope with level-9 DEFLATE; Hoist to Make opens that exact same hashtag under https://app.shel.sh/make/. Native graph UUIDs stay internal instead of replacing the share URL.

Link compressor opens links.html, a lightweight link-only page. Enter a JSON URL or hashtag code to create a short source pointer, choose Embedded JSON for a self-contained snapshot, or upload JSON. Source pointers fetch on open; embedded links need no original file host. A one-line pointer file produces the matching #ss: superlink; nested bare hashtags, Markdown links and anchors use the unchanged ln.kr parser. ln.kr v1–v4 text payloads and Make file shares containing workflows are also supported. JSON is treated as data; linked JavaScript/HTML is never executed. PNG and other supported metadata files go through Comfy's native importer.

Reads omit credentials and referrers. Sources must allow CORS; HTTPS pages cannot read insecure HTTP sources. Failed/circular pointers report an error without navigating away. Imports have a 30-second, 12-hop and 32-MiB total limit. Ordinary editor traffic remains blocked and no telemetry is added.

Native version and updates

What “native ComfyUI” means here

The default sync reads Comfy-Org/ComfyUI's current master/requirements.txt, extracts comfyui-frontend-package==…, then downloads that release's official PyPI wheel and verifies its published SHA-256 before replacing the cache. The version is not hardcoded. This follows the backend's chosen frontend release, not bleeding-edge frontend main. There is no background git checkout, remote polling service, or recreated canvas renderer.

Only the wheel's comfyui_frontend_package/static/ browser files are needed; the portable Python/CUDA distribution is not downloaded. The native JS/CSS files are copied unchanged. Comfystatic modifies the HTML entry to install its separate local API/storage adapter, adds its own toolbar/styles, and blocks generation/network backend calls. “Native frontend” does not mean that Python execution or your complete custom-node library is included.

bun run info prints the selected source and node-catalog status. The toolbar identifies ComfyUI's version and starter vs captured nodes. The deployed comfystatic/upstream.json records the source release and verified wheel checksum, or a local-source label and its index checksum. Full local paths stay in the local info report, not published provenance. A local copy is trusted as supplied; it is not falsely labelled as a verified official download.

# Follow upstream ComfyUI's current pin and open the result.
bun run dev --upstream

# Or use a particular native frontend release.
bun run dev --version 1.57.1

source/ contains the ignored native cache and optional node snapshot. dist/ is the generated static site. A remembered local installation supplies each build; --cached skips source refresh. The resulting dist/comfystatic/upstream.json records the exact version and checksum. sync also refreshes the unchanged ln.kr library from its current remote main; src/vendor/lnkr/upstream.json pins the commit and individual file hashes. No ln.kr checkout is modified or needed to build.

Use a local installation or frontend clone

--comfy-dir checks a portable Python installation, Windows/Linux .venv or venv, a built frontend clone's dist/ or comfyui_frontend_package/static/, and a legacy web/ directory. It logs the exact directory selected. It never executes Python or modifies/builds your checkout. If a backend checkout has no installed frontend assets, its local requirements.txt selects the official wheel to download instead of using upstream master's pin.

bun run dev --comfy-dir "/path/to/ComfyUI"
bun run dev --comfy-dir "/path/to/ComfyUI_frontend"

A frontend source clone must already have been built using its own upstream build instructions. Its development index.html is not a browser distribution and is rejected. For an unusual layout, point directly to the built assets:

bun run sync --frontend-dir "D:/ComfyUI_windows_portable/python_embeded/Lib/site-packages/comfyui_frontend_package/static" --version 1.53.6
bun run build

--version is optional for local assets: sync reads installed package/frontend metadata where available and otherwise reports local. It cannot infer custom Python node schemas from files; use the running server capture below for those.

Custom nodes

The default catalog has only a small core starter set, not all ComfyUI nodes. Updating the frontend does not populate /object_info. Workflow JSON does not necessarily contain complete widget names, enum choices, defaults or custom frontend code. Without real definitions, unknown nodes use editable fallback widgets, preserving their ports, saved values, links and extra metadata. Saved widget names are retained when their positional mapping is unambiguous, and multiline strings use native textareas. Native subgraph types are not replaced by generic nodes. These hints are not invented Python definitions and cannot supply absent enum choices or custom behavior.

Missing promoted controls or values appearing under the wrong labels are a node-definition/widget-mapping issue, not necessarily missing CSS. The workflow-derived fallback helps, but capture your actual node library for faithful custom controls.

For your actual node library, start your own ComfyUI once and capture it:

bun run dev --comfy-dir "/path/to/ComfyUI" --comfy-url http://127.0.0.1:8188

This records /object_info and the custom frontend modules listed by /extensions, following their literal relative imports and assets. The source snapshot is retained across normal frontend refreshes. After installing/updating custom nodes in ComfyUI, capture again and rebuild. No running ComfyUI is needed by visitors to the resulting static site.

For extensions which construct asset paths dynamically, include their complete WEB_DIRECTORY too. The name must match the directory served under /extensions/ by your ComfyUI:

bun run sync --comfy-url http://127.0.0.1:8188 --custom-web "my_nodes=D:/ComfyUI/custom_nodes/my_nodes/web"
bun run build

Alternatively, Node definitions imports a previously saved /object_info JSON into the current browser. That restores native widgets without installing code; capture and rebuild when you want definitions included for every visitor.

Only capture frontend code you trust. Python execution, server-driven widgets, remote services, manager installs, and missing model/media previews cannot be reproduced on a static host. Such calls are blocked rather than redirected. Installing a node's Python package alone does not magically embed it in the static site. API-format prompts lack saved layout and load through Comfy's native API importer; workflow-format JSON is the lossless editing format.

Development

bun test
bun run build

The adapter consists of a browser-local API/storage layer, a native Comfy extension, and a small stylesheet. No production framework or Playwright dependency is added. A major future native frontend release may change API contracts; verify paste, PNG import, tabs and JSON saving after refreshing versions.

ComfyUI frontend is GPL-3.0-only; this project's adapter is distributed under the same license. The unchanged ln.kr library is AGPL-3.0; its license, pako notice and source provenance are included in the build. Native source: Comfy-Org/ComfyUI_frontend, link library: CommanderTurtle/ln.kr. Upstream notices remain in the native assets.

About

nodes require comfy? why not just webapp

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages