Nodes/KJNodes for ComfyUI/TorchCompileModelWanVideo
ComfyUI Node Runs on cloud

TorchCompileModelWanVideo

Deprecated, but the speedup it chased is real

By kijai·Created 3 years ago·Updated about 9 hours ago· 2,930
TorchCompileModelWanVideo
  • model
  • *

This node tells you not to use it, right in its own description: "This node has been replaced with TorchCompileModelAdvanced node, please use that instead." It's still shipping in the pack so old workflow JSON doesn't break, and that's the only reason to know it exists.

The reason anyone reached for it in the first place holds up, though. Wan Video generation is exactly the workload torch.compile was built for: the same model runs the same forward pass over and over, once per sampling step, across dozens of frames per clip. torch.compile traces that forward pass once and swaps in a faster compiled version - at the cost of a slower first pass while the trace happens. On a workload with this many repeat calls at a fixed shape, that upfront cost gets paid back fast. This is not a theoretical benefit - a community benchmark on a 4090 running 592x736 at 81 frames, 30 steps, found that stacking TeaCache with SageAttention and torch.compile together brought total generation time to around five and a half minutes; each of those three tools is doing real, separately-measurable work, and torch.compile's slice of that is the per-step speedup once the trace is warm.

Inputs and outputs

As bare as this deprecated family gets:

  • model (*, required) - your loaded Wan model object.
  • Output: * - the same object, compiled.

No backend, no mode, no strictness flag - none of the controls that would let you tune how it compiles, or fall back cleanly when it can't.

What replaced it

TorchCompileModelAdvanced is the live node in this pack now. This pack's TorchCompileVAE node - current, not deprecated - shows the shape of what that upgrade path buys you: a choice of compile backend, an optimization mode, and a fullgraph strictness toggle, instead of the take-it-or-leave-it wrapper this node gives you.

How to install it

Ships with the pack, no extra step needed for this node specifically.

Via ComfyUI Manager: search KJNodes for ComfyUI, install, restart.

Manually:

cd ComfyUI/custom_nodes
git clone https://github.com/kijai/ComfyUI-KJNodes
pip install -r ComfyUI-KJNodes/requirements.txt

Then restart. This node doesn't fetch any model weights itself - it compiles whatever Wan model you've already loaded through a separate loader node.

Common issues & troubleshooting

Can't find it in the search box. That's normal for a deprecated node on newer Manager builds, which often hide these from search while still letting old workflows load them. Go find TorchCompileModelAdvanced instead.

First clip after adding this took longer, and you assumed it was broken. It isn't - that's the compile trace happening. The payoff shows up on the second and later runs at the same resolution and frame count, not the first one. If your workflow changes resolution every generation, you never get past paying that first-run tax.

No visible speedup, or an outright crash, especially on Windows. torch.compile's default backend leans on Triton, and Triton on Windows is a genuinely rough install - rough enough that Windows Triton builds are maintained essentially by one dedicated community member outside PyTorch's own release process. If you're on Windows, this is the most likely wall you're hitting, and it's exactly the kind of failure TorchCompileModelAdvanced's backend option is meant to route around by offering a non-Triton path this older node never had.

CategoryKJNodes/deprecated

Inputs (1)

NameTypeDefaultDescription
model*

Outputs (1)

NameTypeDescription
**