Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Multiple connections to/from ports #447

Open
ERnsTL opened this issue Feb 6, 2024 · 2 comments
Open

Multiple connections to/from ports #447

ERnsTL opened this issue Feb 6, 2024 · 2 comments

Comments

@ERnsTL
Copy link

ERnsTL commented Feb 6, 2024

From what I have gathered, litegraph.js currently does not support connecting multiple connections to or from a single port (array ports / index ports). A situation like that (generic example graphic):

grafik

Is this a known issue, or any plans regarding priority / roadmap?

If I oversaw this in the Demo, please forgive me.

How would one go about adding these features? Pointers on where to start appreciated.

@CHollman82
Copy link

CHollman82 commented Feb 14, 2024

Multiple outputs work fine... the problem with multiple inputs is the graph is parsed in reverse, from the final node back... and when it reaches a split it has to make a decision. I guess one way to handle it would be to instantiate a new "job" every time it encounters a branch (again, headed in reverse, so a branch would be a multiple-input) but that could very quickly become unreasonable, to attempt to instantiate each possible combination. Some of the graphs I've used could have thousands, easily.

Look at your example... imagine parsing it in reverse... do you see the ambiguity there?

Edit: Just wanted to note that I make use of Litegraph as it is implemented in ComfyUI (listed on the main page) and it definitely does allow for multiple output connections. I'm not sure if that is something they added themselves or not though, I've never used litegraph by itself/"pure"

@atlasan
Copy link
Contributor

atlasan commented May 10, 2024

Multi output works just fine.
Multi input should be allowed by the node itself. A multi input event type would work fine if correctly coded, a multi input "object" reference could execute multiple times for each element, a multi input that would accept a single value or an array could consider the single inputs as part of the array.
Anyway there are many places in the library to be recoded, that's a big challange.
A solution is using helpers nodes in the middle: for events using a sequencer event node, for other types a node that allows dynamic inputs and merge em into an array and that use that as input (alternatively one could directly code the dyn multi input in the final node itself)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants