ComfyUI Node

Motorway 2x1

Motorway 2x1

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

Motorway 2x1 is the smallest asymmetric junction in the agilly1989 Motorway pack: two inputs go in, one named value comes out, and the bus keeps driving. It reads Motorway [inputs]x[outputs], so 2x1 is "two in, one out." If that sounds like an odd shape to build a node around, that's kind of the point - these aren't hand-designed utilities, they're procedurally generated in every input/output combination from 0x1 up to 10x10, and you pick the shape your workflow actually needs.

The Motorway is a beta "pipe" implementation from solo dev agilly1989 - think rgthree Context or Impact Pack pipes, but built around a custom MotorwayClass bus object instead of a dict. Every node in the pack shares one required input, MOTORWAY πŸšŒπŸ’¨, which is the bus being passed from node to node, and one output of the same type that continues the route. You always start with MotorwayStart (or a Motorway primitive node acting as a start), then thread the bus through the graph.

How it works

Connect two values to ANY_(A) and ANY_(B), and give each one a key in ANY_(A)_key and ANY_(B)_key. The node writes both onto the bus under those names - keys are sha256-hashed into hash_… attributes, so a missing key shows up as 'MotorwayClass' object has no attribute 'hash_'. Reusing a key anywhere later overwrites what was stored.

Now the output side. Both keys write their values to the bus, but there's only one data output on this node and it's bound to slot A:

  • data inputs ANY_(A) and ANY_(B) with keys ANY_(A)_key and ANY_(B)_key
  • the required bus input MOTORWAY πŸšŒπŸ’¨
  • outputs MOTORWAY πŸšŒπŸ’¨ and ANY (A)

Key A does double duty: it names input A for storage, and it's also the key that reads output A. So write model into input A, output A reads model back out, and input B's cfg value just rides the bus for later. One quirk of the generated code: outputs are filled from the key slots in order, so with both keys set, the single data output reflects A's key. In effect, 2x1 is a "store two, surface one" node - useful when a branch downstream needs one value now and the other is destined for later in the route.

Installing

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

then restart ComfyUI. Or install it from ComfyUI Manager under ComfyUI_agilly1989_motorway. There are no pip dependencies and no model downloads - pure Python, ready after a restart. Example.json in the repo shows the intended bus pattern.

Common issues

  • The hash_ error means the key you asked for was never written upstream - double-check the exact string, including capitalization.
  • An empty _key box is a footgun: the matching output never gets produced, so wiring anything into it makes ComfyUI hit a missing-output error. Fill the key for any output you read.
  • Only key inputs you actually connect. An unconnected input with a key writes None over that key, silently nuking a value you might need later.

It's a beta pack and the author will tell you so himself. For a compact "stash two, hand one over" step, 2x1 is a tidy fit.

Categoryagilly1989 Nodes/Motorways

Inputs (5)

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

Outputs (2)

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