Collapse Connections
ComfyUI's wire spaghetti finally has a kill switch — and it's labelled experimental
Every big ComfyUI workflow ends the same way: a dozen nodes, each with a dozen sockets, connected by a thousand lines that look like a plate of cold spaghetti. The AUN pack's answer is "collapse connections" - hide a node's input/output slots so all its link lines converge into a single point, leaving a clean little pill where a monster used to be. You can already do that one node at a time via right-click. The AUNCollapseConnectionsController is what you use when you want to drive that from one place: up to 20 slots, each targeting a batch of node IDs, each with its own on/off switch.
It's a pure control node - no outputs, nothing to wire downstream. That's the point. Each of the up to 20 slots gets a label_i, a targets_i (the node IDs you want it to control, comma-separated like 5, 12), and a switch_i that turns the collapse on or off. Flip the switch and the targeted nodes' sockets vanish on the canvas instantly - no need to queue the prompt. The AllSwitch toggles every targeted slot at once, and there's an All Graph button up in ComfyUI's top action bar that collapses every node in the graph with two or more connection slots in one go. Collapse state is saved with the workflow (it lives in each node's properties.collapse_connections), so your tidy graph comes back tidy.
Here's the catch, and it's the first thing that'll trip you up: the controller does nothing until you enable the experimental "Global collapse connections" setting under Settings → AUN. Until then the node sits there with a warning banner on its body. The setting is experimental for a reason - it hooks into the rendering of all non-AUN nodes, and the README is blunt that it "may cause visual or behavioural issues" with core ComfyUI nodes or other packs. If the canvas starts doing something weird after you enable it, turn it back off. That's the deal you're making for tidy graphs.
The few inputs that matter: slot_count (how many slots show, 1–20, default 3), targets_i (the node IDs), switch_i, and AllSwitch. That's it. To find node IDs, enable ComfyUI's "Show Node IDs" setting - targeting by ID beats guessing.
Install: via ComfyUI Manager (search "AUN"), or cd ComfyUI/custom_nodes && git clone https://github.com/loz2754/AUN-ComfyUI-Nodes, then restart ComfyUI. The pack's real dependencies are light (piexif, opencv-python-headless, imageio-ffmpeg, requests) - if you install manually and hit ModuleNotFoundError: cv2, run pip install -r custom_nodes/AUN-ComfyUI-Nodes/requirements.txt.
Troubleshooting:
- Nothing happens when you flip a switch → the experimental setting is off, or your target has 0–1 slots (collapsing those is invisible, so the controller skips them).
- A node targeted by two slots → the slot whose switch is ON wins.
- The controller also drives AUN nodes that ship their own collapse renderer (the AUN Inputs, KSampler and Show Any nodes read the same property), so you can control those from here too.
Worth it? If you live in 50-node workflows, absolutely - but treat the experimental setting as exactly what it says.
Inputs (62)
| Name | Type | Default | Description |
|---|---|---|---|
| slot_count | INT | 31–20 | How many control slots to show (1-20). |
| label_1 | STRING | Name for slot 1 (other slots follow the same layout). | |
| targets_1 | STRING | 0 | The node IDs slot 1 controls, separated by commas (e.g. '5, 12'). |
| switch_1 | BOOLEAN | false | Turn slot 1 on to hide the target nodes' input/output slots, or off to show them again. |
| label_2 | STRING | — | |
| targets_2 | STRING | 0 | — |
| switch_2 | BOOLEAN | false | — |
| label_3 | STRING | — | |
| targets_3 | STRING | 0 | — |
| switch_3 | BOOLEAN | false | — |
| label_4 | STRING | — | |
| targets_4 | STRING | 0 | — |
| switch_4 | BOOLEAN | false | — |
| label_5 | STRING | — | |
| targets_5 | STRING | 0 | — |
| switch_5 | BOOLEAN | false | — |
| label_6 | STRING | — | |
| targets_6 | STRING | 0 | — |
| switch_6 | BOOLEAN | false | — |
| label_7 | STRING | — | |
| targets_7 | STRING | 0 | — |
| switch_7 | BOOLEAN | false | — |
| label_8 | STRING | — | |
| targets_8 | STRING | 0 | — |
| switch_8 | BOOLEAN | false | — |
| label_9 | STRING | — | |
| targets_9 | STRING | 0 | — |
| switch_9 | BOOLEAN | false | — |
| label_10 | STRING | — | |
| targets_10 | STRING | 0 | — |
| switch_10 | BOOLEAN | false | — |
| label_11 | STRING | — | |
| targets_11 | STRING | 0 | — |
| switch_11 | BOOLEAN | false | — |
| label_12 | STRING | — | |
| targets_12 | STRING | 0 | — |
| switch_12 | BOOLEAN | false | — |
| label_13 | STRING | — | |
| targets_13 | STRING | 0 | — |
| switch_13 | BOOLEAN | false | — |
| label_14 | STRING | — | |
| targets_14 | STRING | 0 | — |
| switch_14 | BOOLEAN | false | — |
| label_15 | STRING | — | |
| targets_15 | STRING | 0 | — |
| switch_15 | BOOLEAN | false | — |
| label_16 | STRING | — | |
| targets_16 | STRING | 0 | — |
| switch_16 | BOOLEAN | false | — |
| label_17 | STRING | — | |
| targets_17 | STRING | 0 | — |
| switch_17 | BOOLEAN | false | — |
| label_18 | STRING | — | |
| targets_18 | STRING | 0 | — |
| switch_18 | BOOLEAN | false | — |
| label_19 | STRING | — | |
| targets_19 | STRING | 0 | — |
| switch_19 | BOOLEAN | false | — |
| label_20 | STRING | — | |
| targets_20 | STRING | 0 | — |
| switch_20 | BOOLEAN | false | — |
| AllSwitch | BOOLEAN | false | 'All slots' hides the slots for all targeted nodes at once. 'Individual slots' (default) controls each slot separately. |
Outputs (0)
No outputs