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

Allow Groups to have clearly defined inputs and outputs #4094

Open
allo- opened this issue Jul 24, 2024 · 5 comments
Open

Allow Groups to have clearly defined inputs and outputs #4094

allo- opened this issue Jul 24, 2024 · 5 comments
Labels
Feature A new feature to add to ComfyUI.

Comments

@allo-
Copy link

allo- commented Jul 24, 2024

Feature Idea

Currently grouping nodes seems to be mostly a visual thing. It would be really cool if a group would act like a node itself.

Such a group node could for example have just an input "image", do some complex upscaling inside and just have an output out_image and the rest of the workflow does not need to know the details what's happening in the group.

One would then, for example, connect the inputs of the first nodes to the left side of the group by dragging the connection there, which creates inputs for the group box, and the same for the outputs at the right side.

Existing Solutions

One can create group nodes instead of groups, but they do not easily show how they are connected inside and are hard(er) to edit.

Other

No response

@allo- allo- added the Feature A new feature to add to ComfyUI. label Jul 24, 2024
@allo- allo- changed the title Allow Groups to have inputs and outputs Allow Groups to have clearly defined inputs and outputs Jul 24, 2024
@asagi4
Copy link
Contributor

asagi4 commented Jul 28, 2024

I think this should just be a feature of graphs instead of groups (notably including the top level graph). Then, all you need to do is improve the subgraph implementation that is already there (they're just really annoying to edit at the moment) and get much more flexibility.

@allo-
Copy link
Author

allo- commented Jul 28, 2024

I'm not sure what you mean by graphs, maybe we mean the same thing.

I think visually of a box where I can place inputs and outputs on the edges. Then I put nodes and their connections inside, technically a (sub)graph, cut all connections to the outside and connect them to the inputs and outputs on the edge of the box. Now I have a reusable meta-node that can be used in normal workflows (similar to group nodes) but makes transparent what is happening inside.

@allo-
Copy link
Author

allo- commented Jul 28, 2024

I imagine it to look like this
mockup

Technically, the inputs and outputs at the boundary would be similar to reroute nodes and in the UI they could be rendered similar to the inputs and outputs at nodes.

@asagi4
Copy link
Contributor

asagi4 commented Jul 28, 2024

Graphs are just what ComfyUI workflows are, and what group nodes are. Basically I don't think it makes sense to add inputs to groups when you already have the node abstraction for that; all you need to do is make subgraphs into nodes (already implemented) and make using them convenient (which is missing).

In short, I agree with having explicit inputs and outputs, they should just be a part of graphs, not a feature of groups.

@allo-
Copy link
Author

allo- commented Jul 28, 2024

I think you are just saying it in a different way. The subgraphs in nodes is exactly what I want, but its UI is inconvenient for further editing. One would need a new UI, not now nodes.

What I should have added in the graphic above is that of course each input can be connected to multiple nodes within the group. If I have a subgraph that uses, let's say, Checkpoint and VAE three times for upscaling, I have six connections. If I need that subgraph a second time, I have twelve connections and it gets hard to organise things.

With a group UI like the one sketched, I would have six connections inside each group, but only two on the outside, keeping the complexity inside the group. Such a group could also be collapsed (into a subgraph node) to hide the complexity completely, so the user doesn't even need to know that the two inputs are branched to connect to three different nodes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Feature A new feature to add to ComfyUI.
Projects
None yet
Development

No branches or pull requests

2 participants