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
56.9k stars 6.03k forks source link

Instruction execution order #4443

Open dchatel opened 3 months ago

dchatel commented 3 months ago

Feature Idea

With PR 2666 being merged, we now have control flow, which is nice, but I feel like we miss something important: a proper instruction order. We don't have control flow links, so the execution model has no idea what node should be executed first.

This can be problematic in some long workflows where you set up previews in the middle of the workflow, so you can decide to stop early before processing the costly parts (like hires fix on an animation, for example).

In unreal engine (and other typical visual scripting engines) you have an additional link on "instruction nodes" that allows to define the flow of execution. image

Notice that not all nodes need that, some nodes are pure functions and don't need it. But nodes that are not pure functions (i.e. nodes that have side effects outside of the function) need that "instruction order link" so we can set the order of execution without resorting to the index of the node.

Existing Solutions

No response

Other

No response

ltdrdata commented 3 months ago

This is a nice idea.