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

Add node disconnect shortcuts #31

Merged
merged 3 commits into from
Jul 29, 2024

Conversation

webfiltered
Copy link
Collaborator

Adds disconnect feature and very minor bug fixes (in separate commits):

Disconnect links feature

  • Ctrl + Alt + Click: Disconnect all links from an input or output
  • Ctrl + Alt + Click & Drag: Disconnect all links & link to a new node with a single click
  • Added LiteGraph setting, on by default

6036: skip_action = true

Not sure why skip_action was set to true, here. It prevents disconnect and drag to a new output on the same click, so I've included it in the main commit. Ideally, this should be controlled by a consumer hook, e.g. create "onDisconnectInput".

Adds disconnect feature and very minor bug fixes (in separate commits):
- Ctrl + Alt + Click: Disconnect an input or output
- Ctrl + Alt + Click & Drag: Rewire any input/output to another node with a single click
- Added LiteGraph setting, on by default.

6036: skip_action = true

Not sure why skip_action was set to true, here.  It prevents disconnect and drag to a new output on the same click, so I've included it in the main commit.  Ideally, this should be controlled by a consumer hook, e.g. onDisconnectInput.
@huchenlei huchenlei merged commit 053caa4 into Comfy-Org:master Jul 29, 2024
2 checks passed
huchenlei added a commit that referenced this pull request Jul 30, 2024
huchenlei added a commit that referenced this pull request Jul 30, 2024
huchenlei pushed a commit that referenced this pull request Jul 30, 2024
* Fix loop break missing

* Fix logic - cannot reconnect AND disconnect

* Add ctrl + alt + click to disconnect nodes

Adds disconnect feature and very minor bug fixes (in separate commits):
- Ctrl + Alt + Click: Disconnect an input or output
- Ctrl + Alt + Click & Drag: Rewire any input/output to another node with a single click
- Added LiteGraph setting, on by default.

6036: skip_action = true

Not sure why skip_action was set to true, here.  It prevents disconnect and drag to a new output on the same click, so I've included it in the main commit.  Ideally, this should be controlled by a consumer hook, e.g. onDisconnectInput.
huchenlei added a commit that referenced this pull request Jul 30, 2024
* Add node disconnect shortcuts (#31)

* Fix loop break missing

* Fix logic - cannot reconnect AND disconnect

* Add ctrl + alt + click to disconnect nodes

Adds disconnect feature and very minor bug fixes (in separate commits):
- Ctrl + Alt + Click: Disconnect an input or output
- Ctrl + Alt + Click & Drag: Rewire any input/output to another node with a single click
- Added LiteGraph setting, on by default.

6036: skip_action = true

Not sure why skip_action was set to true, here.  It prevents disconnect and drag to a new output on the same click, so I've included it in the main commit.  Ideally, this should be controlled by a consumer hook, e.g. onDisconnectInput.

* Add output multi-link move using shift-click (#32)

When an output connects to multiple inputs, and you'd like to move all of those links to another node, you are currently required to drag each new link one by one.

This commit adds the ability to move everything at once, using Shift + Click (and drag).

It -does not- currently work with the drop to blank space + search for new node.  It will j ust rewire the first.  This can probably be fixed easily enough.

It -does- function with reroute nodes, however it requires that they are dropped onto the new output directly, not just anywhere on the node.  This is expected, really.

* Update empty-release event protocol

---------

Co-authored-by: filtered <[email protected]>
@webfiltered webfiltered deleted the add-node-disconnect-shortcuts branch July 31, 2024 14:07
@christian-byrne
Copy link

Ctrl + Alt + Click & Drag: Disconnect all links & link to a new node with a single click

Was this removed in #39? Seems it might have been replaced by Shift+Click+Drag?

@webfiltered
Copy link
Collaborator Author

Hey, so they sort of work in the opposite directions. Shift + drag is designed to pick up and move all existing links. So you pick up e.g. 3 links from an output and move them to another output.

Ctrl + alt + click immediately disconnects all links from the slot you click. So same example - you'd disconnect all 3 links on click. But optionally, you can also start dragging a new link to an input - as you would with a normal click & drag.

@christian-byrne
Copy link

Hey, so they sort of work in the opposite directions. Shift + drag is designed to pick up and move all existing links. So you pick up e.g. 3 links from an output and move them to another output.

Ctrl + alt + click immediately disconnects all links from the slot you click. So same example - you'd disconnect all 3 links on click. But optionally, you can also start dragging a new link to an input - as you would with a normal click & drag.

I understand the nuance now, thank you for the explanation.

This is a great feature. I just wrote a test for it at Comfy-Org/ComfyUI_frontend#323.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants