ComfyUI Node

Motorway 2x4

Motorway 2x4

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

Motorway 2x4 is a "two in, four out" junction from the agilly1989 Motorway pack - two values go onto the bus, and you get four named outputs, two of which are pure taps into values that were already parked there. It's the kind of node you reach for when a workflow has two things you're actively passing along, but four different spots downstream each need something from the bus.

The Motorway is a beta "pipe" implementation by solo dev agilly1989, in the same family as rgthree Context nodes and Impact Pack pipes. Where those carry a dict, this one passes a MotorwayClass bus object along a single wire - the MOTORWAY πŸšŒπŸ’¨ connection that every node in the pack shares as its required input and its first output. You begin every route with MotorwayStart (the Motorway primitive nodes can also start one), then thread the bus through as many junctions as you need.

How it works

The mechanism is consistent across the whole pack, so once you've got one you've got them all. Connect two values to ANY_(A) and ANY_(B), type a key into ANY_(A)_key and ANY_(B)_key, and both get stored on the bus under those names. Then the fun part of a fan-out node: there are four key slots - ANY_(A)_key through ANY_(D)_key - because the pack hands you as many keys as the larger side, inputs or outputs. Slots A and B are double-duty: the key names the input and reads the matching output. Slots C and D have no input behind them, so they're read-only taps - type any key that exists on the bus and the output hands it over.

So for this node:

  • inputs ANY_(A) and ANY_(B) with keys
  • read-only key slots ANY_(C)_key and ANY_(D)_key
  • the required MOTORWAY πŸšŒπŸ’¨ bus input
  • outputs MOTORWAY πŸšŒπŸ’¨, ANY (A) through ANY (D)

A concrete picture: write positive and negative on A and B, and use C and D to pull seed and steps that a 2x0 parked earlier in the route. One compact node, four consumers fed. Keys are sha256-hashed to hash_… attributes internally, so a missing key surfaces as 'MotorwayClass' object has no attribute 'hash_' rather than anything friendly - and writing the same key twice overwrites the first value.

Installing

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

then restart ComfyUI, or use ComfyUI Manager and search ComfyUI_agilly1989_motorway. No pip packages, no model files. Pure Python, so it's clone-and-restart.

Common issues

  • hash_ error: key never written, or written with different spacing/case. Keys match exactly.
  • Empty _key boxes are the classic footgun - the output for that slot is never produced, so wiring anything into it makes ComfyUI error on a missing output. Fill every key.
  • Leave the read-only slots (C and D) disconnected; keying a slot with no input stores None and can erase a value you wanted.

Beta pack, and the author's README basically shrugs at you, but for "pass two, tap four" it's exactly the right shape.

Categoryagilly1989 Nodes/Motorways

Inputs (7)

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

Outputs (5)

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