Commit Graph

9 Commits

Author SHA1 Message Date
Jacob Segal
d8fdbb5168 Don't display an error if there's no components directory 2023-07-18 20:51:17 -07:00
Jacob Segal
b234baee2c Add lazy evaluation and dynamic node expansion
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
without hooking or replacing any core functionality. Within this PR,
I've included all of these proof-of-concepts within a custom node pack.
In reality, I would expect some number of them to be merged into the
core node set (with the rest left to be implemented by custom nodes).

I made very few changes to the front-end, so there are probably some
easy UX wins for someone who is more willing to wade into .js land. The
user experience is a lot better than I expected though -- progress shows
correctly in the UI over the nodes that are being expanded.
2023-07-18 20:08:12 -07:00
comfyanonymous
60ac983238 Merge branch 'master' of https://github.com/city96/ComfyUI 2023-04-08 15:50:26 -04:00
comfyanonymous
940893f92c Update the example_node.py.example with RETURN_NAMES. 2023-04-02 10:27:01 -04:00
City
9ac95e6ac7 Add human-readable name support for custom nodes 2023-03-31 07:05:17 +02:00
comfyanonymous
1688f5024d Fix a few issues with the custom_nodes PR.
There only needs to be one example in the folder.
2023-02-17 11:19:49 -05:00
Hacker 17082006
7da0147d8a Done custom_node import error fixing 2023-02-15 21:48:10 +07:00
Hacker 17082006
493671574e Adding some suggests from the author 2023-02-14 22:20:30 +07:00
Hacker 17082006
5ce4b9eca3 Add custom node feature 2023-02-13 18:17:40 +07:00