Nodes/ComfyUI-LineSignalRouter/Line Signal Router
ComfyUI Node

Line Signal Router

Turn lines on, off, and re-route without rewiring

By xelavi9966-cell·Created 5 months ago·Updated 5 months ago· 0
Line Signal Router
  • in_01
  • in_02
  • in_03
  • in_04
  • in_05
  • in_06
  • in_07
  • in_08
  • in_09
  • in_10
  • in_11
  • in_12
  • in_13
  • in_14
  • in_15
  • in_16
  • in_17
  • in_18
  • in_19
  • in_20
  • in_21
  • in_22
  • in_23
  • in_24
  • in_25
  • in_26
  • in_27
  • in_28
  • in_29
  • in_30
  • in_31
  • in_32
  • out_01
  • out_02
  • out_03
  • out_04
  • out_05
  • out_06
  • out_07
  • out_08
  • out_09
  • out_10
  • out_11
  • out_12
  • out_13
  • out_14
  • out_15
  • out_16
  • out_17
  • out_18
  • out_19
  • out_20
  • out_21
  • out_22
  • out_23
  • out_24
  • out_25
  • out_26
  • out_27
  • out_28
  • out_29
  • out_30
  • out_31
  • out_32
line_count4
multi_modetrue
state_json{"titles": ["Line 1", "Line 2", "Line 3", "Line 4", "Line 5", "Line 6", "Line 7", "Line 8", "Line 9", "Line 10", "Line 11", "Line 12", "Line 13", "Line 14", "Line 15", "Line 16", "Line 17", "Line 18", "Line 19", "Line 20", "Line 21", "Line 22", "Line 23", "Line 24", "Line 25", "Line 26", "Line 27", "Line 28", "Line 29", "Line 30", "Line 31", "Line 32"], "enabled": [false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false]}

The Line Signal Router is a switchboard you drop into the middle of your graph: up to 32 input lines, each with its own on/off toggle, custom name, and matching output. Flip a line off and its whole downstream branch stops running. Flip it on and its signal flows through. That's the entire job, and it does it without caring what kind of data you route - latents, images, conditioning, text, numbers all pass through because every socket is ComfyUI's wildcard * type.

It sits in the same family as rgthree's muters and Any Switch, but with a different shape. Where Fast Groups Bypasser mutes whole sections and Context Switch picks one branch, this node gives you a visible, editable roster of lines inside the node body itself. If you've got a workflow with a handful of interchangeable paths - say, three samplers or five LoRA chains you A/B test - and you're tired of ctrl-B toggling and re-plugging wires, this is the node for the job.

How it actually works

The backend is a single ~150-line Python file with zero dependencies - no requirements.txt, no model downloads, nothing to clash with your other custom nodes. In a pack from an unknown author that's a nice trust property: you can read every line of it in two minutes.

When the node runs, it reads three things:

  • line_count (INT, default 4, range 1–32) - how many lines are in play. Lines beyond this number are force-disabled.
  • multi_mode (BOOLEAN, default on) - the routing behavior.
  • state_json (STRING) - the hidden JSON blob that remembers each line's name and enabled state. It's stored in the workflow file, so your toggles survive saving and reloading.

In multi mode, each enabled line routes in_XX straight to out_XX. Turn multi mode off and the node becomes a one-shot selector: only the first enabled line is passed through, to out_01, and everything else is blocked.

Here's the part beginners trip on: a disabled line doesn't pass None. It returns an ExecutionBlocker, which tells ComfyUI to skip the entire downstream branch for that run. Muted lines genuinely don't compute - that's a feature (you can keep a heavy branch wired up but dormant), but it also means an enabled line with nothing plugged into it will silently block whatever hangs off its output. If a branch stops doing anything, check that every line you've switched ON actually has an input wired to it.

One more mechanism note: the node reports itself as "always changed" (IS_CHANGED returns NaN), so it re-executes every run and your UI toggles take effect without a stale-cache fight.

The inputs and outputs that matter

The only things you ever touch directly are line_count and multi_mode - and really, you mostly adjust those inside the node's own UI, not on the widget bar. state_json is managed for you; leave it alone.

  • in_01in_32 - optional, accept any type. Wire your candidate signals in.
  • out_01out_32 - always all present. In multi mode out_XX mirrors in_XX for enabled lines; in single mode only out_01 carries anything.

The UI is where this node earns its keep: each line row has an ON/OFF button, an editable name field, and a delete button that disconnects the line's wires and shrinks line_count for you. Socket labels update live (in_01 · Face closeup) so you can see what's on each line without squinting at wire colors.

Installing it

ComfyUI Manager is the easy path - search "Line Signal Router" or "ComfyUI-LineSignalRouter" and install. Or clone it by hand:

cd ComfyUI/custom_nodes
git clone https://github.com/xelavi9966-cell/ComfyUI-LineSignalRouter.git

Then restart ComfyUI. No extra pip installs, no model files to fetch. Updating is a git pull in that folder.

Gotchas worth knowing

  • A fresh node does nothing. Default state has every line disabled, so until you click a toggle, all outputs are blocked. That's not a bug - it's the node waiting for you.
  • The whole UI lives in its JS file. If the line-list interface doesn't render and you see a raw state_json text widget instead, the frontend isn't loading its script (usual cause: a stale browser cache or a frontend that doesn't run custom JS). Hard-refresh first.
  • line_count and state_json can disagree if you edit the count by hand. The backend normalizes on every run, so the extra lines just get disabled rather than crashing.

Honest verdict: for small workflows it's overkill - ComfyUI's built-in mute and a Reroute handle that. But once you're juggling a handful of named alternatives and want to switch between them visually, this is a clean, dependency-free way to do it.

Categoryutils/routing

Inputs (35)

NameTypeDefaultDescription
line_countINT41–32
multi_modeBOOLEANtrue
state_jsonSTRING{"titles": ["Line 1", "Line 2", "Line 3", "Line 4", "Line 5", "Line 6", "Line 7", "Line 8", "Line 9", "Line 10", "Line 11", "Line 12", "Line 13", "Line 14", "Line 15", "Line 16", "Line 17", "Line 18", "Line 19", "Line 20", "Line 21", "Line 22", "Line 23", "Line 24", "Line 25", "Line 26", "Line 27", "Line 28", "Line 29", "Line 30", "Line 31", "Line 32"], "enabled": [false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false]}
in_01opt*
in_02opt*
in_03opt*
in_04opt*
in_05opt*
in_06opt*
in_07opt*
in_08opt*
in_09opt*
in_10opt*
in_11opt*
in_12opt*
in_13opt*
in_14opt*
in_15opt*
in_16opt*
in_17opt*
in_18opt*
in_19opt*
in_20opt*
in_21opt*
in_22opt*
in_23opt*
in_24opt*
in_25opt*
in_26opt*
in_27opt*
in_28opt*
in_29opt*
in_30opt*
in_31opt*
in_32opt*

Outputs (32)

NameTypeDescription
out_01*
out_02*
out_03*
out_04*
out_05*
out_06*
out_07*
out_08*
out_09*
out_10*
out_11*
out_12*
out_13*
out_14*
out_15*
out_16*
out_17*
out_18*
out_19*
out_20*
out_21*
out_22*
out_23*
out_24*
out_25*
out_26*
out_27*
out_28*
out_29*
out_30*
out_31*
out_32*