rgthree / rgthree-comfy

Making ComfyUI more comfortable!
MIT License
1.13k stars 81 forks source link

[Feature Request] Regex based Fast Bypasser/Muter #180

Open DrJKL opened 7 months ago

DrJKL commented 7 months ago

I tend to use a lot of Use Everywhere nodes instead of a context chain. This means I don't have the intermediate context nodes to wire into a Fast Muter/Bypasser.

I'd love to be able to add a Fast Bypasser that targets individual nodes within groups instead of whole groups (even though I can add overlapping groups to kind of accomplish what I want).

Example Story

I have a workflow with both mask and frame generation and a final video output.
I have preview nodes for debugging attached to some of the intermediate generations.
I'd like to keep them muted, but enable them all when tweaking parameters (and maybe mute the final output via exclusive toggle to remove that final KSampler pull).
I'd add a Fast Muter (rgthree) and open the properties, targeting the nodes by Color/Title/Group using a regex.
The exclusivity across muters might be a separate feature on the Fast Actions Button

Let me know if this is already possible and I've missed something 😄

JorgeR81 commented 6 months ago

This could also solve my issue, in a better way ! No wires to hide ...

https://github.com/rgthree/rgthree-comfy/issues/183

DrJKL commented 6 months ago

Seeing if I can get this working.

Teaser Image

image

DrJKL commented 6 months ago

I think there's some more work to be done here, but here's the branch if you want to check it out: https://github.com/DrJKL/rgthree-comfy/tree/drjkl/wireless-bypass-mute

Doesn't have group name filtering yet, but that should be pretty straightforward to add next. Oh, also only a muter. Considering whether there should be 2 nodes or if that should also be a property. @rgthree what do you think?

JorgeR81 commented 6 months ago

Sure, I can test this. But how do I switch to a forked branch?
I tried, this, but it does not work:

C:\Cui\cu_121_2\ComfyUI_windows_portable\ComfyUI\custom_nodes\rgthree-comfy>git switch drjkl/wireless-bypass-mute
fatal: invalid reference: drjkl/wireless-bypass-mute

C:\Cui\cu_121_2\ComfyUI_windows_portable\ComfyUI\custom_nodes\rgthree-comfy>git switch wireless-bypass-mute
fatal: invalid reference: wireless-bypass-mute

EDIT:

I thought I was able to fetch the @DrJKL remote.

C:\Cui\cu_121_2\ComfyUI_windows_portable\ComfyUI\custom_nodes\rgthree-comfy>git fetch DrJKL/rgthree-comfy drjkl/wireless-bypass-mute
fatal: 'DrJKL/rgthree-comfy' does not appear to be a git repository
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.

But it only seems to work via URL.

C:\Cui\cu_121_2\ComfyUI_windows_portable\ComfyUI\custom_nodes\rgthree-comfy>git fetch https://github.com/DrJKL/rgthree-comfy.git drjkl/wireless-bypass-mute
remote: Enumerating objects: 53, done.
remote: Counting objects: 100% (37/37), done.
remote: Total 53 (delta 37), reused 37 (delta 37), pack-reused 16
Unpacking objects: 100% (53/53), 17.04 KiB | 65.00 KiB/s, done.
From https://github.com/DrJKL/rgthree-comfy
 * branch            drjkl/wireless-bypass-mute -> FETCH_HEAD

  So I still can't switch to this branch. Only the branches from the "origin" seem to be available. 

( It's OK, I can try it once it's merged )

C:\Cui\cu_121_2\ComfyUI_windows_portable\ComfyUI\custom_nodes\rgthree-comfy>git branch -v -a
* main                  db06296 Refactor a bunch around server nodes to allow extensions to call nodeCreated since rgthree-comfy purposefully avoids the ComfyNode. Also cleans up logging. Addresses #194
  remotes/origin/HEAD   -> origin/main
  remotes/origin/assets 7d9542c reroutes aniamted gif
  remotes/origin/dev    5f940dd [Dynamic Context] More fixes for input disconnecting.
  remotes/origin/main   db06296 Refactor a bunch around server nodes to allow extensions to call nodeCreated since rgthree-comfy purposefully avoids the ComfyNode. Also cleans up logging. Addresses #194

C:\Cui\cu_121_2\ComfyUI_windows_portable\ComfyUI\custom_nodes\rgthree-comfy>git switch drjkl/wireless-bypass-mute
fatal: invalid reference: drjkl/wireless-bypass-mute
DrJKL commented 6 months ago

I think you'd do

git remote add drjkl https://github.com/DrJKL/rgthree-comfy
git fetch --all

Then you'd be able to switch to the branch

JorgeR81 commented 6 months ago

OK thanks. I was able to switch.

About the node, it seems to work fine.

If you add the node, for the first time, on a large workflow, the node it will be very big ! But it will work with no problems.

I'm able to add multiple nodes and use the matchTitle and sort properties, with no issues. I will keep testing.

node

JorgeR81 commented 6 months ago

I've found an issue.

The matchColors property does not seem to work. Changing it does not affect the node. I think this may be because it expects group colors ( like Fast Groups Muter ), not node colors.

And once matchColors is changed, the matchTitle property will also stop working. Changing matchTitle will not affect that node anymore.

So, I need to delete that "Fast Node Muter" node and add or clone a new one, to use matchTitle.

If you want to implement filtering nodes by color, maybe it would be easier to just have an option to match the "Fast Node Muter" color, instead of asking for a list for colors.

But I wouldn't mind if color filtering is not added. Personally, I only use colors for aesthetic purposes ( except for the positive and negative prompt nodes ).

JorgeR81 commented 6 months ago

One minor issue. When there are no repeated node names, it's not necessary to add a "0", in front of the name.

names

DrJKL commented 6 months ago

Okay, color matching should be fixed, had to handle undefined colors for nodes. What do you think of Node n/m for nodes with the same titles? image

JorgeR81 commented 6 months ago

Color matching is working. n/m naming was not added yet, right ? ( I don't have it ).

I also think node n/m naming is the best solution. But I'd like for this to be disabled if group filtering is used.

I can have multiple nodes named "Load Image 1" in different groups ( eg. for image batches in IPAdapter and InstantID groups ). I don't need to mute the [ Load Image ] nodes, but I may want to bypass some [ ImageBatch ] or [ Prepare Image for Clip Vision ] nodes. 

123

DrJKL commented 6 months ago

The uniquifying naming applies after the filtering, just on the widgets, so you shouldn't ever have number gaps like that. Turned it into a draft PR https://github.com/rgthree/rgthree-comfy/pull/205