Comfy-Org / ComfyUI_frontend

Official front-end implementation of ComfyUI
https://www.comfy.org/
GNU General Public License v3.0
655 stars 122 forks source link

[Feature Request]: Allow node bypass state to be controlled via another node #1509

Open rhdunn opened 2 weeks ago

rhdunn commented 2 weeks ago

Is there an existing issue for this?

What would your feature do ?

When developing combined workflows it is often the case that sections of the workflow are unused in different configurations. Examples are:

  1. having optional pre/post refinement SD XL steps;
  2. selecting between image-to-image or text-to-image operation modes;
  3. preventing errors e.g. if you have unclip/style support but the checkpoint doesn't have a clip vision model.

In these cases it can be useful to:

  1. prevent loading unneeded models -- e.g. only loading the refiner model if pre/post refinement is enabled;
  2. prevent errors if the user doesn't have a specific model -- e.g. if they don't have a canny ControlNet model;
  3. avoid performing unneeded steps -- e.g. don't run a refinement pass or upscaling if they are not enabled;
  4. providing user feedback which parts of the workflow are active -- e.g. if upscaling is disabled showing those nodes as bypassed.

Proposed workflow

  1. Add a node -- e.g. Load LoRA
  2. Add a node with a boolean value -- e.g. from ComfyUI_essentials
  3. Add bypass as an input (e.g. from the node context menu)
  4. Hook up the boolean output to the bypass input
  5. Toggle the boolean value to use/bypass the node

Additional information

No response

JorgeR81 commented 2 weeks ago

The Fast Bypasser (rgthree) ( https://github.com/rgthree/rgthree-comfy ), already allows to do this.

You just need to connect any output from the node you want to bypass. And you can control as many nodes as you want.

lora


And it has extra features. You can set it up so that allways one of the connected nodes is enabled ( not bypassed ).

This is very useful for selecting ControlNet Preprocessors. This way you can change the Preprocessor with just 1 click.

lora1

pp

JorgeR81 commented 2 weeks ago

By the way, you will not need to use Fast Bypasser (rgthree) for Lora loaders.

For that you can use the Power Lora Loader (rgthree) You can add as many loras as you want, and toggle them individually or globally !

loras

rhdunn commented 2 weeks ago
  1. That won't work for terminal nodes (e.g. Preview Image and Save Image).
  2. That effectively means I need to pair each node with the fast bypasser node.
  3. I won't be able to see those bypasser nodes as bypassed when e.g. disabling upscaling -- ideally here I would like all upscaling nodes (including the preview/output nodes) to be marked as disabled/bypassed.
JorgeR81 commented 2 weeks ago

Ah yes, the rgthree nodes won't work for terminal nodes. 

I would be nice to have native solution for this.


As for extensions, maybe this one could help: https://github.com/chrisgoringe/cg-controller

It allows you to duplicate any node in floating windows, which you can place wherever you want in the graph canvas.

By clicking on the node header you can collapse it. And you also have a button ( on the left ), to mute / bypass.

It's very flexible, you can use it to create a "remote control" to bypass all the image nodes in the workflow.

rc

c1

LukeG89 commented 2 weeks ago

@rhdunn In rgthree there are also Fast Groups Bypasser and Fast Groups Muter if you need to bypass or mute entire groups. And there is even an option to enable buttons on groups for bypassing and muting.

rgthree

https://github.com/user-attachments/assets/005fe300-9585-47af-8f9c-947ab1378d19


I was about to suggest cg-controller as well!

https://github.com/user-attachments/assets/aa3a911f-59a5-44c1-9309-72c66806b57f

You can also create a "category" if you use the same group name for different nodes

https://github.com/user-attachments/assets/4cd1859e-34f2-47e7-8280-9058c4fc2f9b