ComfyUI Node

Motorway 7x2

Seven parked, two handed off

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

Motorway 7x2 is the "seven parked, two handed off" pipe: seven inputs in, two ANY outputs out, plus the continuing MOTORWAY πŸšŒπŸ’¨ wire. It's from the agilly1989 Nodes/Motorways pack, and it's for the workflow where seven values ride one bus but only two need to step off at this stop - the other five stay in the bag for later reads.

The 7x2 names the shape: seven inputs, two outputs. Seven key slots (A through G) exist because seven inputs feed in, and the two outputs read by keys A and B. So lanes C through G are pure writes - park values that some downstream stop will fetch by name - while A and B double as write-and-read. It's the pipe equivalent of "route these seven, but hand me these two right here."

How it works

Same engine as every Motorway node. The motorway is a custom object that behaves like a dict, keys stored under sha256 hashes. When the node runs it pops the incoming MOTORWAY πŸšŒπŸ’¨, stores each connected input under its _key widget value, clones the bag, reads keys A and B for the outputs, and passes the bag forward. Any key written at an earlier stop is readable at any later stop; a reused key overwrites the old value rather than keeping both.

The read-after-write ordering is the detail that matters for the A and B outputs: they return whatever those keys hold after this stop's writes. Plug a latent into ANY_(A), key it latent, and ANY (A) hands back that latent immediately. Leave A's key empty and the output idles - no value, no error.

The inputs and outputs that matter

Required MOTORWAY πŸšŒπŸ’¨ input (Motorway-type only). Seven optional inputs ANY_(A) through ANY_(G) with _key widgets. Outputs: MOTORWAY πŸšŒπŸ’¨, ANY (A), ANY (B). Only the A and B keys produce outputs, so if you need one of the C–G values visible right here, grab a bigger fan-out (a 7x10 if you're feeling ambitious). Empty keys idle their lane.

Installing it

ComfyUI Manager - search ComfyUI_agilly1989_motorway - or:

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

Restart ComfyUI. No requirements.txt, no model downloads; it's pure Python on ComfyUI's own comfy_types. One-person beta project - the README's opening line is an honest warning - so pin a version if a workflow depends on it.

Common issues

The familiar failure is KeyError: Key: 'x' doesn't exist in motorway (README's 'MotorwayClass' object has no attribute 'hash_'): an output read a key no stop has written, usually a typo - keys are exact, case-sensitive strings. And keep the overwrite rule in mind: seven keys is seven chances to silently replace a value an earlier stop parked under the same name.

Categoryagilly1989 Nodes/Motorways

Inputs (15)

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

Outputs (3)

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