Nodes/AUN ComfyUI Nodes/Node State Controller
ComfyUI Node

Node State Controller

Set a node's state once, from ID, group, or title

By loz2754·Created 8 months ago·Updated a day ago· 5
Node State Controller
      target_mode
      node_ids
      group_title
      group_exclude_titles
      node_titles
      combinedfalse
      use_mutefalse
      collapsefalse
      activetrue

      Sometimes you don't want a 20-slot control panel. You want to say "collapse this refiner and mute it," once, and move on. Node State Controller is the AUN pack's single-target version of that: one node, no outputs, that sets bypass/mute and collapse state for nodes addressed by ID, by group title, or by a list of titles. Think of it as the manual override the big controllers don't give you - it's a light switch, not a smart-home app.

      How it works

      You pick a target_mode (Node IDs, Group Title, or Node Titles), fill in the matching field, and the node pushes the state to ComfyUI's frontend via PromptServer events when it executes - no data flows through it, which is why it has zero outputs and you wire it into nothing. It's a state setter, not a data node; you drop it anywhere in the graph and it does its job on run.

      The useful part is the interaction between combined, use_mute, collapse, and active:

      • combined ON - collapse and disable in one action, so active is ignored. The "I'm done with this branch" button.
      • combined OFF - collapse and active are independent. collapse hides/shows the body; active enables the nodes or bypasses/mutes them (depending on use_mute).

      When use_mute is ON it mutes; otherwise it bypasses. The node even cleans up after itself by resetting the other state - if you mute a node it also clears any stale bypass so the two don't fight.

      Targeting options

      • Node IDs - comma-separated, e.g. 5,12,23. Fastest for a handful of specific nodes, but fragile if the graph is edited (IDs shift).
      • Group Title - the whole group, with optional group_exclude_titles to exempt specific node titles inside it. Partial matching supported.
      • Node Titles - newline/comma/semicolon separated titles; !/- prefixes exclude. This is the friendliest option because titles survive most edits.

      When to reach for it

      • One-off cleanup - mute + collapse a branch you're testing without deleting it.
      • As a "condition" gate - wire a boolean into active from a controller or switch node, and the state becomes conditional: a node set that's only disabled when some other node says so.
      • Inside a shared workflow - a single explicit state setter is easier for someone else to read than six hidden bypasses.

      It's strictly less flexible than AUN Node Controller (no labels, no boolean outputs, no per-slot logic) - but that's the point. When you need "this one thing, off," the 20-slot panel is overkill and this is faster to set up.

      Install

      Standard AUN install: ComfyUI Manager, search "AUN ComfyUI Nodes", or

      cd ComfyUI/custom_nodes
      git clone https://github.com/loz2754/AUN-ComfyUI-Nodes
      

      then restart. Pack dependencies (piexif, opencv-python-headless, imageio-ffmpeg, requests) install via Manager or pip install -r custom_nodes/AUN-ComfyUI-Nodes/requirements.txt. No model files.

      The caveat

      Since it's a setter that fires on execution, it doesn't persist through a graph reload the way a widget state does - if you expect "I set it once, it stays," you'll want the state baked into the workflow by the controller nodes' widgets instead. And like every graph-state node, it targets what's in the current graph, so a mismatched title or stale ID just does nothing silently. Check your spelling, run once, and confirm in the UI before trusting it.

      CategoryAUN Nodes/Node Control

      Inputs (9)

      NameTypeDefaultDescription
      target_modeCOMBOChoose how to target nodes.
      node_idsSTRINGComma-separated node IDs (e.g. 5,12,23) when mode is 'Node IDs'.
      group_titleSTRINGGroup title to target (supports partial match and '!' or '-' for exclusion).
      group_exclude_titlesSTRING(Group mode only) Node titles to EXCLUDE (newline, comma, or semicolon separated). Supports partial match.
      node_titlesSTRINGNode titles to target (newline, comma, or semicolon separated). Use '!' or '-' prefix for exclusion (e.g. 'image, !load').
      combinedBOOLEANfalseWhen ON: collapse + disable in one action (Active ignored).
      use_muteBOOLEANfalseIf ON uses mute (IDs, Group Title, or Node Titles). Otherwise bypass.
      collapseBOOLEANfalseCollapsed (▶) hides body; Expanded (▼) shows it (ignored if Combined On).
      activeBOOLEANtrueEnable (active) or disable (bypass/mute) nodes when Combined Off.

      Outputs (0)

      No outputs