rgthree / rgthree-comfy

Making ComfyUI more comfortable!
MIT License
1.02k stars 77 forks source link

Crazy idea (probably still impossible): Fast Groups Muter/Bypasser to create conditional workflows without branches #333

Open alessandroperilli opened 1 week ago

alessandroperilli commented 1 week ago

I don't know if this will make sense, but I'll try anyway:

Today, Fast Groups Muter/Bypasser (FGMB) nodes can be configured to match specific groups. Then, as soon as you use their toggles, the corresponding group/s get muted/unmuted & bypassed/unbypassed instantaneously.

But what if (1) I could configure a FGMB with my ideal group configuration for scenario A (let's say "generation+upscaling") and the toggles won't do anything until the queue is executed?

What if, on top of this, (2) that special FGMB would be executed only if it receives the boolean value true?

And, to finish, what if, (3) that special FGMB would immediately return the group to its previous state after performing the desired muting/unmuting & bypassing/unbypassing?

These 3 things would mean that, at the queue execution, we could test a condition and, depending on the outcome, portions of the workflow would light up as previously planned, only to go dark again at the end of the queued run. That would work even with instant queues that depend on external inputs.

I don't know if the new ComfyUI reverse execution order would help in doing this. Today I had an epiphany and realised that these particular nodes are the fastest way to reconfigure a complex workflow dynamically and I wanted to share the idea.

drmbt commented 5 days ago

I would love it if some of these frontend only nodes could now also work as meta switches at an API level. It would probably be a complete refactor, or an entirely different node, but it would be really nice to have Groups muter acting almost like a lazy bypass for all nodes, and in a way that works when exporting for API and doesn't just rely on front end JS. Would be a huge RFE, you'd be a legend to provide (already are)