TorchCompileModelAura
Free-ish speed for AuraFlow, if you'll eat a slow first run
- model
- model
torch.compile is one of the few genuinely free lunches in this space - PyTorch traces your model's forward pass once and compiles it down to fused, optimized kernels. The catch is you pay for that tracing up front: your first inference after connecting this node eats a real compile tax, sometimes well over a minute depending on model and settings, and everything after runs meaningfully faster. TorchCompileModelAura is RES4LYF's version of that trick scoped to AuraFlow.
How it works
Drop it right after your model loader and before your sampler. It patches the model with torch.compile under the hood, using whichever backend and mode you choose, and hands back a MODEL that behaves the same but runs faster from the second call onward.
The inputs and outputs that matter
model(MODEL) in,modelout - standard patch-and-pass wiring.backend-inductor(the default general-purpose PyTorch compiler, plays nicest with the widest range of setups) orcudagraphs(records and replays literal CUDA graphs - can be faster still but more brittle if anything about a run changes shape). Start withinductor.mode(defaultdefault) -default,max-autotune(spends far longer at compile time hunting for the fastest kernels - highest ceiling, slowest warm-up),max-autotune-no-cudagraphs, orreduce-overhead(minimizes per-call Python overhead, useful when launch overhead is a bigger fraction of a fast model's total time).fullgraph(tooltip: "Enable full graph mode") - forces the whole model into one compiled graph instead of allowing silent fallbacks to eager on unsupported ops. Stricter, and it fails loudly rather than quietly if something doesn't compile.dynamic(tooltip: "Enable dynamic mode") - lets the compiled graph tolerate changing input shapes (resolution, batch size) without a full recompile every time you change one.dynamo_cache_size_limit(default 64) - how many distinct compiled graph variantstorch._dynamocaches before giving up and falling back to eager. Matters if you're changing resolution or batch size a lot within one session.
Leave backend on inductor and mode on default until you've confirmed the base setup actually works - max-autotune multiplies your warm-up time and isn't the place to start.
How to install it
Via ComfyUI Manager: search RES4LYF, install, restart.
Manually:
cd ComfyUI/custom_nodes
git clone https://github.com/ClownsharkBatwing/RES4LYF
cd RES4LYF
pip install -r requirements.txt
Portable installs: use the embedded Python's pip.exe. torch.compile itself ships with PyTorch, so there's no separate install for the compiler - but inductor leans on Triton, and Triton support on Windows has historically been rough, the same friction that shows up trying to get SageAttention running there.
Common issues & troubleshooting
Compiling pays off in a stable, repeated pipeline - batch rendering, a server, the same resolution over and over - and can be a net loss for one-off experimentation, since you eat the compile tax again whenever something upstream invalidates the graph: a new LoRA, a changed resolution, a reloaded model.
Errors mentioning Triton on Windows. That's the known friction point for inductor-backed compilation on that platform, not something specific to this node.
It breaks when you add a LoRA or another patch afterward. torch.compile wants a stable graph; a patch applied on top after compiling can violate that assumption. If you need to combine compiling with other model patches, expect to troubleshoot the order they're applied in.
Inputs (6)
| Name | Type | Default | Description |
|---|---|---|---|
| model | MODEL | — | |
| backend | COMBO | 2 options: inductor, cudagraphs | |
| fullgraph | BOOLEAN | false | Enable full graph mode |
| mode | COMBO | default | 4 options: default, max-autotune, max-autotune-no-cudagraphs, reduce-overhead |
| dynamic | BOOLEAN | false | Enable dynamic mode |
| dynamo_cache_size_limit | INT | 640–1024 | torch._dynamo.config.cache_size_limit |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| model | MODEL | — |