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 8 months ago·Updated 5 days ago· 6
Collapse Connections
      slot_count3
      AllSwitchfalse
      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

      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).
      AllSwitchBOOLEANfalse'All slots' hides the slots for all targeted nodes at once. 'Individual slots' (default) controls each slot separately.
      label_1optSTRINGName for slot 1 (other slots follow the same layout).
      targets_1optSTRING0The node IDs slot 1 controls, separated by commas (e.g. '5, 12').
      switch_1optBOOLEANfalseTurn slot 1 on to hide the target nodes' input/output slots, or off to show them again.
      label_2optSTRING
      targets_2optSTRING0
      switch_2optBOOLEANfalse
      label_3optSTRING
      targets_3optSTRING0
      switch_3optBOOLEANfalse
      label_4optSTRING
      targets_4optSTRING0
      switch_4optBOOLEANfalse
      label_5optSTRING
      targets_5optSTRING0
      switch_5optBOOLEANfalse
      label_6optSTRING
      targets_6optSTRING0
      switch_6optBOOLEANfalse
      label_7optSTRING
      targets_7optSTRING0
      switch_7optBOOLEANfalse
      label_8optSTRING
      targets_8optSTRING0
      switch_8optBOOLEANfalse
      label_9optSTRING
      targets_9optSTRING0
      switch_9optBOOLEANfalse
      label_10optSTRING
      targets_10optSTRING0
      switch_10optBOOLEANfalse
      label_11optSTRING
      targets_11optSTRING0
      switch_11optBOOLEANfalse
      label_12optSTRING
      targets_12optSTRING0
      switch_12optBOOLEANfalse
      label_13optSTRING
      targets_13optSTRING0
      switch_13optBOOLEANfalse
      label_14optSTRING
      targets_14optSTRING0
      switch_14optBOOLEANfalse
      label_15optSTRING
      targets_15optSTRING0
      switch_15optBOOLEANfalse
      label_16optSTRING
      targets_16optSTRING0
      switch_16optBOOLEANfalse
      label_17optSTRING
      targets_17optSTRING0
      switch_17optBOOLEANfalse
      label_18optSTRING
      targets_18optSTRING0
      switch_18optBOOLEANfalse
      label_19optSTRING
      targets_19optSTRING0
      switch_19optBOOLEANfalse
      label_20optSTRING
      targets_20optSTRING0
      switch_20optBOOLEANfalse

      Outputs (0)

      No outputs