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
48.07k stars 5.06k forks source link

[Feature Request] Conditional Branching Nodes #2256

Open jipehFR opened 8 months ago

jipehFR commented 8 months ago

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.

ltdrdata commented 8 months ago

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

DefinitlyEvil commented 6 months ago

I second on this feature! Super excited for it!