Comfy-Org / Comfy-Org/ComfyUI_frontend

Rewrite node slot configure process

Open
#4,701 0 comments 0 reactions 0 assignees View on GitHub
area:links area:litegraph area:nodes
Dominant language
TypeScript
Stars
2k
Forks
699
Avg merge
1d 7h
Merged PRs (30d)
490

Description

When frontend is loaded, nodes are configured like so:
- Reads info object
- Clones inputs & outputs
- Creates new class objects, discarding the originals
- Replaces the array ref with a new array
- Rinse/repeat entire process

To make matters worse, the deserialised object is actually pre-mutated by frontend to monkey patch i18n in, resulting in every class being transient and discarded multiple times per load.

The result is that everything must always be recalculated, and classes cannot be stateful. When attempting to retain inputs / outputs without completely wiping the node (inputs, outputs, links - everything) every time it is called, workflow validation falls over and various basic things (e.g. links) will not function correctly.

This needs to be rewritten at some point, but until then, we will have to wear the tech debt.

Note: this is a result of months of small feature additions that are simply tacked on to the existing situation, instead of addressing the underlying issue. It is now very difficult to fix properly, without breaking the things that rely on it.

┆Issue is synchronized with this [Notion page](https://www.notion.so/Issue-4701-Rewrite-node-slot-configure-process-2476d73d365081f7b7b8e0ea59d8d014) 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.