Nodes/ComfyUI_agilly1989_motorway/TorchCompileModel_motorway_edition
ComfyUI Node

TorchCompileModel_motorway_edition

The fastest-slowest node in ComfyUI, now with keys

By agilly1989·Created 2 years ago·Updated about a year ago· 7
TorchCompileModel_motorway_edition
  • MOTORWAY 🚌💨
  • MOTORWAY 🚌💨
INPUT_model_keymodel
backend
OUTPUT_MODEL_keyMODEL

Torch.compile is the closest thing ComfyUI has to free speed. It doesn't change your results, it makes the same computation run faster - the catch is you pay for it all up front, in one long, terrifying compile step. This _motorway_edition version is that stock node wired into the agilly1989 "Motorway" pipe system, so instead of plugging a MODEL wire in, you type a key and the model comes out of the shared Motorway dict.

If you've never seen a Motorway before, here's the one-paragraph tour. It's a pipe system from the ComfyUI_agilly1989_motorway pack: start with MotorwayStart, then every _motorway_edition node reads its inputs from and writes its outputs to a shared dict keyed by short strings. You end up with one MOTORWAY wire running through everything instead of spaghetti. Each of these nodes is an auto-generated clone of a core ComfyUI node, so the underlying math is exactly what you already know.

What it does. This node wraps your MODEL in torch.compile with the backend you pick: inductor (the general-purpose one) or cudagraphs (GPU-only, great when it works). Inside ComfyUI it shows up under _for_testing because it's genuinely experimental - the payoff is real for video models like Wan and Hunyuan where one denoise pass is expensive, but you'll sit through a minutes-long first-run compile before you see anything. On the Motorway that's fine: it's a set-and-forget speed upgrade on the model key.

The inputs that matter. MOTORWAY (required) brings in the shared state. INPUT_model_key defaults to model - that's the key in the Motorway your base model is stored under, so if your checkpoint landed under MODEL (uppercase, which is what the loaders default to), you have to type MODEL here or nothing will be found. The backend dropdown is the only real decision. OUTPUT_MODEL_key defaults to MODEL and decides where the compiled model is stored for the sampler to grab later. The only output is the MOTORWAY port itself - no separate MODEL wire, the compiled model lives in the dict.

Common issues. Two things bite people. First, the key mismatch trap above: loader defaults are uppercase (MODEL), consumer defaults are lowercase (model). Get it wrong and you'll see 'MotorwayClass' object has no attribute 'hash_' - that's the pack's way of saying "that key isn't in the Motorway." Second, torch.compile itself: it needs a recent torch, cudagraphs can quietly eat VRAM, and a failed compile fails the whole run. If you're on a workflow that takes 10 minutes anyway, the warm-up cost is often not worth it - reach for this when you're rendering lots of frames. One more: in the pack's current main branch, the motorway-ed clones are commented out in __init__.py, so if the node isn't in your menu at all, you're on a version where it isn't registered.

Install via ComfyUI Manager (search "ComfyUI_agilly1989_motorway") or clone the repo into custom_nodes. No models to download, no requirements.txt. The author is a solo dev who labels the pack beta and says, honestly, "it works on my system" - treat it as a convenience layer, not infrastructure.

Categoryagilly1989 Nodes/Motorway-ed/_for_testing

Inputs (4)

NameTypeDefaultDescription
MOTORWAY 🚌💨MOTORWAY 🚌💨
INPUT_model_keySTRINGmodel
backendCOMBO2 options: inductor, cudagraphs
OUTPUT_MODEL_keySTRINGMODEL

Outputs (1)

NameTypeDescription
MOTORWAY 🚌💨MOTORWAY 🚌💨