comfyanonymous / ComfyUI

The most powerful and modular diffusion model GUI, api and backend with a graph/nodes interface.
https://www.comfy.org/
GNU General Public License v3.0
55.87k stars 5.89k forks source link

[Feature Request] Chip based groups / general group update #497

Open TinyTerra opened 1 year ago

TinyTerra commented 1 year ago

I think it would be useful to have a new ChipNode Group with a custom amount of IO 'reroute' nodes, and a customizable display based on the contents of the group. Being able to build new 'chips' within the UI would be quite powerful, and would help clean up routing, as well as simplifying re-useable groups in a way that Node Templates doesn't quite reach in its current form.

As an example a txt2img chip could look something like this. concept

Being able to expand and collapse to edit the contents would also be helpful, although the group hierarchy issue (#477 ) would probably need to be fixed as well.

Having a way to lock the contents of the group, so that if it expands over other nodes it doesn't automatically include them into the group, which is a slight issue with the current implementation would also be good. Auto selecting the groups contents when you select a group too.

For another reference in regards to ChipNodes - similar functionality to the following logic gate app is essentially what I mean. https://github.com/SebLague/Digital-Logic-Sim

ltdrdata commented 1 year ago

nice idea!

morphles commented 1 year ago

Yes, wanted to open similar request myself, not sure of why reroute is even needed, it could just figure what is ingoing and outgoing into group. And just create minimized node. Just inputs/outputs need ability to have names/be renamed (I guess maybe thats why you added them?). In any case ability to save such groups as "user made nodes" and potentially ability to easily share them would be gold. I also think blender has such feature of converting groups to nodes, which you can then "step into" and edit if needed.

TinyTerra commented 1 year ago

... not sure of why reroute is even needed, it could just figure what is ingoing and outgoing into group. And just create minimized node. Just inputs/outputs need ability to have names/be renamed (I guess maybe thats why you added them?)....

In this case the reroutes are just a way of keeping things neat - and having pass-through flow. (So if i was to use latent upscaling after the txt2img - i can pull all the required elements from the end of the txt2img group without having tonnes of wires coming from the initial nodes. Which also allows for more modular plug'n'play node groups.

But yes, ideally if this was to be implemented the inputs and outputs of the node group would be set inside the group element rather than using reroutes.

I agree with the renaming too - currently even the reroutes only show the type of data rather than the set title.

Gorislav commented 1 year ago

The litegraph used in ComfyUI already has this functionality and it's not bad. Perhaps should just implement it?

omar92 commented 1 year ago

what really , didnt think this supported in litegraph , will try look into it

0xdevalias commented 11 months ago

You might want to read through/follow these other related issues, as a bunch of stuff seems to have already been tried/explored/etc in this space:


Also wanted to include this idea/note I posted on the other issue here; RE: litegraph bugs/limitations and a potentially better alternative:

I think it will require several changes in litegraph to fix bugs.

These changes are in my fork of litegraph which isn't API compatible with upstream litegraph however as the pace of development is too significant

This is probably a little off topic for this issue, and I suspect that it would be a rather major / potentially breaking change to do so.. but I'm curious if there's a reason that litegraph is used instead of something like xyflow / reactflow / etc? I haven't deeply evaluated both projects yet, but at least in my initial cursory exploration, xyflow seems like it's capable of everything liteflow does, but in a more standard are modern developed/maintained way.

  • https://github.com/xyflow/xyflow
    • React Flow | Svelte Flow - Powerful open source libraries for building node-based UIs with React (https://reactflow.dev) or Svelte (https://svelteflow.dev). Ready out-of-the-box and infinitely customizable.

    • https://www.xyflow.com/
      • Powerful open source libraries for building node-based UIs with React or Svelte. Ready out-of-the-box and infinitely customizable

    • https://reactflow.dev
      • Wire Your Ideas with React Flow A customizable React component for building node-based editors and interactive diagrams

    • https://svelteflow.dev
      • Wire Your Ideas with Svelte Flow A customizable Svelte component for building node-based editors and interactive diagrams by the creators of React Flow

Originally posted by @0xdevalias in https://github.com/comfyanonymous/ComfyUI/issues/669#issuecomment-1833179664