ComfyUI Node

Motorway 2x3

Motorway 2x3

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

Motorway 2x3 is where the fan-out starts to get interesting. The name is Motorway [inputs]x[outputs], so this is two values in, three named values out - one more output than input. It's from the agilly1989 Motorway pack, a beta "pipe" implementation by solo dev agilly1989, and it exists because sometimes two inputs are all you're carrying but three consumers downstream each need something.

The whole pack is a wire-spaghetti reducer in the same family as rgthree's Context nodes and Impact Pack pipes. Instead of dragging every value across the canvas on its own wire, you park values on a bus - a MotorwayClass object passed along a single connection. That connection is literally called MOTORWAY πŸšŒπŸ’¨, it's the required input on every node, and the same type is always the first output so the route can continue. You start with MotorwayStart and drive the bus through however many junctions you like.

How it works

Wire two values into ANY_(A) and ANY_(B), name each in ANY_(A)_key / ANY_(B)_key, and the node stores both on the bus. The extra wrinkle of a 2x3 is that there are three key slots - ANY_(A)_key through ANY_(C)_key - because the pack gives you as many keys as the larger of inputs or outputs. So:

  • inputs ANY_(A) and ANY_(B) (each with a key)
  • an extra read-only key slot ANY_(C)_key with no matching input
  • the required MOTORWAY πŸšŒπŸ’¨ bus input
  • outputs MOTORWAY πŸšŒπŸ’¨, ANY (A), ANY (B), ANY (C)

Keys A and B double as both the name for their input and the read for their output - write model into A and output A gives you model back. Key C is the payoff: there's no input C, so it's a pure reader. Type any key that's already on the bus - a seed parked four nodes earlier, say - into ANY_(C)_key, and output C hands it over. That's the whole reason to pick a 2x3 over a 2x2: one extra "tap" for free.

Keys are sha256-hashed into hash_… attributes internally, and storing the same key twice overwrites the old value. If you ever see 'MotorwayClass' object has no attribute 'hash_', that's a key you referenced that was never written - check your spelling, because matching is exact.

Installing

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

then restart ComfyUI, or find ComfyUI_agilly1989_motorway in ComfyUI Manager. Pure Python, no pip dependencies, no model downloads - install is clone-and-restart and nothing else.

Common issues

  • The hash_ error: key never written, or a mismatch in spelling/case. Keys are exact strings.
  • Fill the key for every output you read. An empty _key means that output is never produced, so wiring anything into it makes ComfyUI error on a missing output.
  • Don't key a slot you left disconnected - it stores None over that key. If you only have two inputs, leave C for a real read.

Beta pack, fair warning from the author, but the "write two, read three" shape is a genuinely handy one when you're feeding a few branches at once.

Categoryagilly1989 Nodes/Motorways

Inputs (6)

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

Outputs (4)

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