This PR inverts the execution model -- from recursively calling nodes to
using a topological sort of the nodes. This change allows for
modification of the node graph during execution. This allows for two
major advantages:
1. The implementation of lazy evaluation in nodes. For example, if a
"Mix Images" node has a mix factor of exactly 0.0, the second image
input doesn't even need to be evaluated (and visa-versa if the mix
factor is 1.0).
2. Dynamic expansion of nodes. This allows for the creation of dynamic
"node groups". Specifically, custom nodes can return subgraphs that
replace the original node in the graph. This is an incredibly
powerful concept. Using this functionality, it was easy to
implement:
a. Components (a.k.a. node groups)
b. Flow control (i.e. while loops) via tail recursion
c. All-in-one nodes that replicate the WebUI functionality
d. and more
All of those were able to be implemented entirely via custom nodes,
so those features are *not* a part of this PR. (There are some
front-end changes that should occur before that functionality is
made widely available, particularly around variant sockets.)
The custom nodes associated with this PR can be found at:
https://github.com/BadCafeCode/execution-inversion-demo-comfyui
Note that some of them require that variant socket types ("*") be
enabled.
* wip per user data
* Rename, hide menu
* better error
rework default user
* store pretty
* Add userdata endpoints
Change nodetemplates to userdata
* add multi user message
* make normal arg
* Fix tests
* Ignore user dir
* user tests
* Changed to default to browser storage and add server-storage arg
* fix crash on empty templates
* fix settings added before load
* ignore parse errors
* Prevent cleaning graph state on undo/redo
* Remove pause rendering due to LG bug
* Fix crash on disconnected internal reroutes
* Fix widget inputs being incorrect order and value
* Fix initial primitive values on connect
* basic support for basic rerouted converted inputs
* Populate primitive to reroute input
* dont crash on bad primitive links
* Fix convert to group changing control value
* reduce restrictions
* fix random crash in tests
* setup ui unit tests
* Refactoring, adding connections
* Few tweaks
* Fix type
* Add general test
* Refactored and extended test
* move to describe
* for groups
* wip group nodes
* Relink nodes
Fixed widget values
Convert to nodes
* Reconnect on convert back
* add via node menu + canvas
refactor
* Add ws event handling
* fix using wrong node on widget serialize
* allow reroute pipe
fix control_after_generate configure
* allow multiple images
* Add test for converted widgets on missing nodes + fix crash
* tidy
* mores tests + refactor
* throw earlier to get less confusing error
* support outputs
* more test
* add ci action
* use lts node
* Fix?
* Prevent connecting non matching combos
* update
* accidently removed npm i
* Disable logging extension
* fix naming
allow control_after_generate custom name
allow convert from reroutes
* group node tests
* Add executing info, custom node icon
Tidy
* internal reroute just works
* Fix crash on virtual nodes e.g. note
* Save group nodes to templates
* Fix template nodes not being stored
* Fix aborting convert
* tidy
* Fix reconnecting output links on convert to group
* Fix links on convert to nodes
* Handle missing internal nodes
* Trigger callback on text change
* Apply value on connect
* Fix converted widgets not reconnecting
* Group node updates
- persist internal ids in current session
- copy widget values when converting to nodes
- fix issue serializing converted inputs
* Resolve issue with sanitized node name
* Fix internal id
* allow outputs to be used internally and externally
* order widgets on group node
various fixes
* fix imageupload widget requiring a specific name
* groupnode imageupload test
give widget unique name
* Fix issue with external node links
* Add VAE model
* Fix internal node id check
* fix potential crash
* wip widget input support
* more wip group widget inputs
* Group node refactor
Support for primitives/converted widgets
* Fix convert to nodes with internal reroutes
* fix applying primitive
* Fix control widget values
* fix test
* setup ui unit tests
* Refactoring, adding connections
* Few tweaks
* Fix type
* Add general test
* Refactored and extended test
* move to describe
* for groups
* Add test for converted widgets on missing nodes + fix crash
* tidy
* mores tests + refactor
* throw earlier to get less confusing error
* support outputs
* more test
* add ci action
* use lts node
* Fix?
* Prevent connecting non matching combos
* update
* accidently removed npm i
* Disable logging extension
* added step to generate object_info
* fix python
* install python
* install deps
* fix cwd?
* logging
* Fix double resolve
* create dir
* update pkg