Comfy-Org / Comfy-Org/ComfyUI_frontend

Long-Term Architectural Direction for ComfyUI_frontend

Open
#4,661 6 comments 14 reactions 0 assignees View on GitHub
Announcement
Dominant language
TypeScript
Stars
2k
Forks
699
Avg merge
1d 7h
Merged PRs (30d)
490

Description

Consider this an RFC and living document outlining the long-term architectural goal of the frontend of ComfyUI.

Currently, our project is split between https://github.com/Comfy-Org/ComfyUI_frontend and https://github.com/Comfy-Org/litegraph.js. This split creates a distributed monolith, as both packages handle rendering, user interactions, and data models without clear separation of responsibilities. The only separation is self-imposed and significantly slows developer velocity. The constant overhead of making these two packages work together not only reduces iteration speed but also forces tight coupling across the frontend's data model, views, and business logic. This has made large-scale projects nearly impossible, yet we still have many ambitious projects we will accomplish. Our immediate goal is naturally then to remove this obstacle through refactoring and restructuring.

Step 1 will be merging litegraph and ComfyUI_frontend into a single repository (not using workspace packages, but truly merging them). After that, we'll restructure the application along logical boundaries—primarily: model, view, and controllers. State mutations and observation will go through a single access point mediated by a CRDT system wrapped in reactivity for better DX and Vue integration. The CRDT and immutable state will enable multiplayer functionality, cloud features, improved undo/redo, better performance, and more.

After the merging and refactoring is complete, the structure will resemble the below:

Image

This organization will then allow us as a community to realistically achieve all the different iterations of our UI:

**[short term] Vue based graph**

Image

**[short term] Linear Mode** (share, present, ship workflowS)

Image

**[medium term] Cloud Multiplayer**

Image

**[long term] Custom rendering engine and graph operations in Rust + WASM**

Image

┆Issue is synchronized with this [Notion page](https://www.notion.so/Issue-4661-Long-Term-Architectural-Direction-for-ComfyUI_frontend-2446d73d365081c4984fed70b7e379b0) by [Unito](https://www.unito.io)

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.