From 25f0f4e9c8fdbad43311b8e5161b3e6efa9d58d9 Mon Sep 17 00:00:00 2001 From: Jairo Correa Date: Sat, 14 Oct 2023 11:54:33 -0300 Subject: [PATCH] Shortcut Alt + C to collapse/uncollapse selected nodes --- README.md | 1 + web/scripts/app.js | 10 ++++++++++ 2 files changed, 11 insertions(+) diff --git a/README.md b/README.md index 6bef25ce..d622c907 100644 --- a/README.md +++ b/README.md @@ -46,6 +46,7 @@ Workflow examples can be found on the [Examples page](https://comfyanonymous.git | Ctrl + S | Save workflow | | Ctrl + O | Load workflow | | Ctrl + A | Select all nodes | +| Alt + C | Collapse/uncollapse selected nodes | | Ctrl + M | Mute/unmute selected nodes | | Ctrl + B | Bypass selected nodes (acts like the node was removed from the graph and the wires reconnected through) | | Delete/Backspace | Delete selected nodes | diff --git a/web/scripts/app.js b/web/scripts/app.js index 3cf3585d..1a07d69b 100644 --- a/web/scripts/app.js +++ b/web/scripts/app.js @@ -928,6 +928,16 @@ export class ComfyApp { block_default = true; } + // Alt + C collapse/uncollapse + if (e.key === 'c' && e.altKey) { + if (this.selected_nodes) { + for (var i in this.selected_nodes) { + this.selected_nodes[i].collapse() + } + } + block_default = true; + } + // Ctrl+C Copy if ((e.key === 'c') && (e.metaKey || e.ctrlKey)) { // Trigger onCopy