[Feature Request] Conditional Branching Nodes
Issue: Inclusion of Conditional Branching Nodes in Default Node Set
Problem Description
While ComfyUI provides the ability to create custom nodes, it currently lacks a default node that allows for conditional branching based on certain conditions. This limitation restricts the complexity and responsiveness of the image generation and processing flows that can be created without delving into custom node creation.
Proposed Feature
I propose the addition of Conditional Branching Nodes to the default set of nodes provided by ComfyUI. These nodes would allow for dynamic decision-making based on user input, system state, or any other condition that can be evaluated at runtime.
Use Case
Consider a batch image processing task. If an image has a resolution above a certain threshold, we could direct it to a high-quality processing node. If the resolution is below the threshold, we could direct it to a standard processing node. This decision could be made dynamically using a Conditional Branching Node.
Expected Outcome
The addition of Conditional Branching Nodes to the default set would increase the out-of-the-box flexibility and power of ComfyUI, enabling developers to create more complex and responsive image generation and processing flows without the need to create custom nodes.
This requirement has been around for a long time, and it's currently challenging to implement in the current structure. Once this PR is merged, it will pave the way for the implementation of these features in the future. https://github.com/comfyanonymous/ComfyUI/pull/931
I second on this feature! Super excited for it!
I'm interested in a static version of this. I.e. supporting workflow parameters to enable combining workflows such as text-to-image or image-to-image.
I can do this with custom nodes (e.g. a "swich" to select from either input 'a' or input 'b'). The problem I'm running into is having to create a node for each data type as the parameter type information is statically determined. Using any input breaks connected nodes like reroute and primitive.
It would be interesting to allow nodes to be turned on/off as that would make it more efficient to have a workflow that supports loading a combined model, loading the bits individually, or overriding parts of a combined model (e.g. loading a separate VAE model and using that instead of the checkpoint version).
This functionality is already implemented in several custom nodes since #2666 (elaborated PR of #931) is merged.
https://github.com/ltdrdata/ComfyUI-extension-tutorials/blob/Main/ComfyUI-Impact-Pack/tutorial/switch.md