Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Feature Request] Conditional Branching Nodes #2256

Closed
jipehFR opened this issue Dec 11, 2023 · 4 comments
Closed

[Feature Request] Conditional Branching Nodes #2256

jipehFR opened this issue Dec 11, 2023 · 4 comments
Labels
User Support A user needs help with something, probably not a bug.

Comments

@jipehFR
Copy link

jipehFR commented Dec 11, 2023

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
Copy link
Collaborator

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.
#931

@DefinitlyEvil
Copy link

I second on this feature! Super excited for it!

@mcmonkey4eva mcmonkey4eva added the User Support A user needs help with something, probably not a bug. label Sep 12, 2024
@rhdunn
Copy link

rhdunn commented Nov 7, 2024

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).

@ltdrdata
Copy link
Collaborator

ltdrdata commented Nov 8, 2024

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

@ltdrdata ltdrdata closed this as completed Nov 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
User Support A user needs help with something, probably not a bug.
Projects
None yet
Development

No branches or pull requests

5 participants