ComfyUI Node

Motorway 4x1

Four lanes in, one lane out β€” the funnel ramp

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

Motorway 4x1 is the funnel of the agilly1989 Motorway pack: four values in, one value out. At first glance that looks lopsided - why would you merge four lanes just to keep one? - but it earns its keep as a "packing" node. You use it to grab four values that the rest of the graph needs and hand them off as a single bus that carries everything, so the next stretch of your workflow only has to touch one wire.

The pack is a pipe implementation. A custom bus object (MotorwayClass) rides node to node carrying values under string keys, and every Motorway AxB node is an on/off ramp. The bus always starts with MotorwayStart (or a Motorway primitive like MotorwaySeed), and it always flows out of the first output socket even when there are few or no data outputs.

What's on the node

Required input: MOTORWAY πŸšŒπŸ’¨, the bus from a Start node or an earlier ramp. Then four data inputs ANY_(A) through ANY_(D), all typed *, plus four key fields ANY_(A)_key through ANY_(D)_key. And here's the subtle bit that catches people: the generator gives every input and every output a key, so this node's four key slots are shared between the four inputs and the single output.

Output ANY (A) reads whatever is in key slot A. So if you feed the model in on ANY_(A) with key model, output ANY (A) - which reads key model - hands it right back out. In other words, on a 4x1 you typically pick one of your four inputs to also be the output, and the other three are pure store-only lanes that file into the bus for downstream nodes to pull later. The first output is always MOTORWAY πŸšŒπŸ’¨ carrying the bus on, and that's the socket you chain to the next ramp.

A clean usage: file model on input A, clip on B, vae on C, seed on D. Output A (key model) keeps the model flowing inline, while clip, vae and seed ride the bus until something downstream types their key in and pulls them out. Everything downstream is only three or four wires away instead of across the whole canvas.

Install

ComfyUI Manager, search "ComfyUI_agilly1989_motorway". Or by hand:

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

Restart ComfyUI. No model downloads, no pip requirements - pure Python.

The footguns

The README's error is 'MotorwayClass' object has no attribute 'hash_...' - you pulled a key nobody wrote. Keys are sha256-hashed internally, so a typo silently points at an empty slot. And because this node has one data output but four key slots, it's easy to leave ANY (A) wired while its key field is blank - blank key, blank output. Fill the key on any lane you actually read.

Categoryagilly1989 Nodes/Motorways

Inputs (9)

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

Outputs (2)

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