Comfy-Org / Comfy-Org/ComfyUI

Instruction execution order

Open
#4,443 1 comment 3 reactions 0 assignees View on GitHub
Feature
Dominant language
Python
Stars
133k
Forks
15.7k
Avg merge
1d 6h
Merged PRs (30d)
155

Description

### 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](https://github.com/user-attachments/assets/cf2e1081-4c45-4b98-95bb-2bca1fd4064c)

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_

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.