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
54.75k stars 5.78k forks source link

Add 'sub-graphs' to ComfyUI #5353

Open Creare-d-arte opened 2 days ago

Creare-d-arte commented 2 days ago

Feature Idea

Node-based programs (like Geogen, WorldMachine, etc.) feature what are called "sub-graphs" or "Macros".

Double-clicking a subgraph/Macro node will open a blank node graph.

In this new graph/space, one can place a series of nodes; and connect then to special Input & Output nodes.

The Subgraph/Macro nodes in the main graph/space, update their inputs & outputs according to the number of connected Input & Output nodes within the sub-graph.

....................................................................................................

The common purpose of this feature; is to clean up the main graph/space.

e.g. I aim to use such, to hide a bunch of nodes that the user(myself) doesn't need to see.

There are other purposes for subgraphs;

  1. In WorldMachine, Macros are treated like Custom Nodes; and are distributed on the forums like such.

  2. Saving and loading sub-graphs into workflows is a better alterative to that of ComfyUI's 'Templates'.

Existing Solutions

No response

Other

No response

LukeG89 commented 1 day ago

Someone already proposed this feature request in the frontend repo: https://github.com/Comfy-Org/ComfyUI_frontend/issues/1077

I think the current way to have subgraphs is using this custom node: ComfyUI-Sub-Nodes

~And maybe components have a similar purpose: ComfyUI-Workflow-Component~

Creare-d-arte commented 1 day ago

Someone...

The frontend request seems very similar to mine; though I would prefer this issue remain open, for exposure.

As for the suggestions; unfortunately both are janky and out-of-date, and such are not viable for me/ComfyUI users.

ltdrdata commented 1 day ago

Someone already proposed this feature request in the frontend repo: Comfy-Org/ComfyUI_frontend#1077

I think the current way to have subgraphs is using this custom node: ComfyUI-Sub-Nodes

And maybe components have a similar purpose: ComfyUI-Workflow-Component

ComfyUI-Workflow-Component was an experimentally implemented feature, and since it hasn't been maintained for a while and cannot be used properly, I recommend not using it. I plan to maintain it when time permits in the future.