ComfyUI Node

Motorway 5x5

The node that turns wire spaghetti into a bus route

By agilly1989Β·Created 2 years agoΒ·Updated about a year agoΒ· 7
Motorway 5x5
  • MOTORWAY πŸšŒπŸ’¨
  • ANY_(A)
  • ANY_(B)
  • ANY_(C)
  • ANY_(D)
  • ANY_(E)
  • MOTORWAY πŸšŒπŸ’¨
  • ANY (A)
  • ANY (B)
  • ANY (C)
  • ANY (D)
  • ANY (E)
β—„ANY_(A)_keyβ€”β–Ί
β—„ANY_(B)_keyβ€”β–Ί
β—„ANY_(C)_keyβ€”β–Ί
β—„ANY_(D)_keyβ€”β–Ί
β—„ANY_(E)_keyβ€”β–Ί

Every big ComfyUI workflow eventually turns into the same disaster: a model, a prompt, a seed, a VAE and a latent all have to reach five different places, so you drag five wires across the whole canvas. Motorway 5x5 is the fix for that. It's a "pipe" node from the agilly1989 Nodes/Motorways pack - think rgthree's Context nodes or Efficiency Nodes, but implemented as a keyed bag of values that rides one single wire instead of a bundle of typed cables.

The naming tells you the shape: Motorway [inputs]x[outputs]. So this one takes five values in and hands five values back out. It's the pack's square middle - balanced, the one you'll reach for when you have roughly as many things to park as you do to pick up. You build a "bus route" across your graph: one MOTORWAY πŸšŒπŸ’¨ wire threads through a chain of these nodes, and each one adds its payload and pulls out what earlier stops left behind.

How it works

Under the hood the motorway is a custom class that behaves like a dict - values are stored under keys, and the keys are sha256-hashed so the object never collides with ComfyUI's own attributes. When a Motorway node runs, it pops the incoming motorway, writes whatever is connected to its inputs under the keys you typed, clones the whole bag, reads one key per output, and passes the bag down the line. The trick that makes it work as a pipe: a key written at an early "stop" can be read at any later stop, so you never have to route a long wire - you just remember the key name.

The author (agilly1989, findable in the Comfy Org Discord) built this because "I didn't like how other pipe implementations were implemented," and the README is upfront that it's a beta, so treat it as a tidy-your-graph tool rather than load-bearing infrastructure.

The inputs and outputs that matter

Only two things matter here. The required MOTORWAY πŸšŒπŸ’¨ input is the bus itself - it only accepts the same custom type, so it connects exclusively to other Motorway nodes. Then each of the five ANY_(A) through ANY_(E) inputs has a matching _key widget, and every output - ANY (A) through ANY (E) plus the continuing MOTORWAY πŸšŒπŸ’¨ - reads by the same letter's key. Type seed into the A key, plug a seed into the A input, and the A output hands back whatever "seed" currently means at this point of the route.

Because a 5x5 has five key slots and five inputs, every key is both a write and a read. Leave a key empty and that slot does nothing - handy when you only need four of the five lanes.

Installing it

Easiest way is ComfyUI Manager - search for ComfyUI_agilly1989_motorway. Or do it by hand:

cd ComfyUI/custom_nodes
git clone https://github.com/agilly1989/ComfyUI_agilly1989_motorway

Then restart ComfyUI. There's no requirements.txt and no model download - it's pure Python built on ComfyUI's own comfy_types, so install is genuinely one line and nothing lands in your models folder.

Common issues

The error you'll actually hit is KeyError: Key: 'foo' doesn't exist in motorway (the README phrases it as 'MotorwayClass' object has no attribute 'hash_'). It means an output tried to read a key that nothing has written yet - check your key spelling and case, keys are exact strings. Second trap: reusing a key further down the route overwrites what was stored earlier, so keep keys unique per pipeline. And remember you must start the whole thing with MotorwayStart (or one of the Motorway primitive nodes, which can start a route on their own).

Categoryagilly1989 Nodes/Motorways

Inputs (11)

NameTypeDefaultDescription
MOTORWAY πŸšŒπŸ’¨MOTORWAY πŸšŒπŸ’¨β€”
ANY_(A)opt*β€”
ANY_(B)opt*β€”
ANY_(C)opt*β€”
ANY_(D)opt*β€”
ANY_(E)opt*β€”
ANY_(A)_keyoptSTRINGβ€”
ANY_(B)_keyoptSTRINGβ€”
ANY_(C)_keyoptSTRINGβ€”
ANY_(D)_keyoptSTRINGβ€”
ANY_(E)_keyoptSTRINGβ€”

Outputs (6)

NameTypeDescription
MOTORWAY πŸšŒπŸ’¨MOTORWAY πŸšŒπŸ’¨β€”
ANY (A)*β€”
ANY (B)*β€”
ANY (C)*β€”
ANY (D)*β€”
ANY (E)*β€”