Nodes/AUN ComfyUI Nodes/Collapse Connections
ComfyUI Node

Collapse Connections

ComfyUI's wire spaghetti finally has a kill switch — and it's labelled experimental

By loz2754·Created 7 months ago·Updated about 8 hours ago· 5
Collapse Connections
      slot_count3
      label_1
      targets_10
      switch_1false
      label_2
      targets_20
      switch_2false
      label_3
      targets_30
      switch_3false
      label_4
      targets_40
      switch_4false
      label_5
      targets_50
      switch_5false
      label_6
      targets_60
      switch_6false
      label_7
      targets_70
      switch_7false
      label_8
      targets_80
      switch_8false
      label_9
      targets_90
      switch_9false
      label_10
      targets_100
      switch_10false
      label_11
      targets_110
      switch_11false
      label_12
      targets_120
      switch_12false
      label_13
      targets_130
      switch_13false
      label_14
      targets_140
      switch_14false
      label_15
      targets_150
      switch_15false
      label_16
      targets_160
      switch_16false
      label_17
      targets_170
      switch_17false
      label_18
      targets_180
      switch_18false
      label_19
      targets_190
      switch_19false
      label_20
      targets_200
      switch_20false
      AllSwitchfalse

      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.

      CategoryAUN Nodes/Node Control

      Inputs (62)

      NameTypeDefaultDescription
      slot_countINT31–20How many control slots to show (1-20).
      label_1STRINGName for slot 1 (other slots follow the same layout).
      targets_1STRING0The node IDs slot 1 controls, separated by commas (e.g. '5, 12').
      switch_1BOOLEANfalseTurn slot 1 on to hide the target nodes' input/output slots, or off to show them again.
      label_2STRING
      targets_2STRING0
      switch_2BOOLEANfalse
      label_3STRING
      targets_3STRING0
      switch_3BOOLEANfalse
      label_4STRING
      targets_4STRING0
      switch_4BOOLEANfalse
      label_5STRING
      targets_5STRING0
      switch_5BOOLEANfalse
      label_6STRING
      targets_6STRING0
      switch_6BOOLEANfalse
      label_7STRING
      targets_7STRING0
      switch_7BOOLEANfalse
      label_8STRING
      targets_8STRING0
      switch_8BOOLEANfalse
      label_9STRING
      targets_9STRING0
      switch_9BOOLEANfalse
      label_10STRING
      targets_10STRING0
      switch_10BOOLEANfalse
      label_11STRING
      targets_11STRING0
      switch_11BOOLEANfalse
      label_12STRING
      targets_12STRING0
      switch_12BOOLEANfalse
      label_13STRING
      targets_13STRING0
      switch_13BOOLEANfalse
      label_14STRING
      targets_14STRING0
      switch_14BOOLEANfalse
      label_15STRING
      targets_15STRING0
      switch_15BOOLEANfalse
      label_16STRING
      targets_16STRING0
      switch_16BOOLEANfalse
      label_17STRING
      targets_17STRING0
      switch_17BOOLEANfalse
      label_18STRING
      targets_18STRING0
      switch_18BOOLEANfalse
      label_19STRING
      targets_19STRING0
      switch_19BOOLEANfalse
      label_20STRING
      targets_20STRING0
      switch_20BOOLEANfalse
      AllSwitchBOOLEANfalse'All slots' hides the slots for all targeted nodes at once. 'Individual slots' (default) controls each slot separately.

      Outputs (0)

      No outputs