TorchCompileCosmosModel
Deprecated, and Cosmos moved on too
- model
- *
The node's own description doesn't leave room for debate: "This node has been replaced with TorchCompileModelAdvanced node, please use that instead." So let's be upfront - if you're building a workflow today, go install that one. This page exists because old Cosmos workflows still reference this node by name, and if you've inherited one, you probably want to know what it did before you rip it out.
It's a double fossil, actually. Not only is the node deprecated in favor of KJNodes' unified compiler, the model family it targeted didn't stick around either. Cosmos-Predict2 was NVIDIA's world foundation model, built for Physical AI - think robotics simulators, not art. It landed in mid-2025, got a couple of weeks of polite curiosity from the image-gen crowd, and was quietly written off as not competitive with Flux for anything you'd actually want to generate. NVIDIA archived the repo by the end of that year in favor of Cosmos-Predict2.5. Its one genuine afterlife: Circlestone Labs took the 2B text-to-image variant as the base for Anima, an anime model that turned out to punch above its weight because a backbone that never marinated in Danbooru tags kept language understanding that SDXL anime finetunes had lost. So if you're compiling a Cosmos-derived model today, there's a decent chance it's actually Anima under the hood, not raw Cosmos.
What torch.compile was doing here
The general idea, for context: torch.compile traces a model's computation graph and fuses the operations into optimized CUDA kernels instead of running PyTorch's default eager-mode execution. The trade is timing - the first pass through the model is slower, sometimes noticeably, because that's when the compilation happens. Every later run at the same input shape reuses the compiled kernels and comes out ahead. It's a real speedup, but only if you generate more than once at the same resolution; a single one-off render just pays the compile tax for nothing.
Inputs and outputs
This is where the deprecation shows: the schema is now a bare pass-through. One required input, model, typed as a wildcard rather than the model-specific type it presumably had when it was actively maintained, and one output that mirrors it back out, also wildcard-typed. No exposed backend, mode, or block toggles - whatever tuning knobs this node once had were stripped down (or never fully exposed) by the time it got marked deprecated. You plug a model in, you get a model out, and that's the whole interface today.
How to install it
It ships inside the same KJNodes pack as everything else from kijai - there's no separate download for this one node. Through ComfyUI Manager, search "KJNodes for ComfyUI" and install. Manually: cd ComfyUI/custom_nodes && git clone https://github.com/kijai/ComfyUI-KJNodes, then pip install -r ComfyUI-KJNodes/requirements.txt (or the python_embeded\python.exe -m pip install -r ... variant if you're on the portable Windows build), then restart ComfyUI.
Common issues & troubleshooting
It's throwing errors after an update, or missing entirely. Don't spend time debugging a deprecated node - that's effort with no future. Swap in TorchCompileModelAdvanced and move on.
You're chasing a compile bug against Cosmos-Predict2 itself. Worth knowing that NVIDIA archived that repo. If your actual base model is Anima rather than raw Cosmos, treat any Cosmos-specific documentation or issue threads you find as historical, not current.
General torch.compile prerequisites still apply. Compilation needs Triton and, on Linux, usually a working C compiler toolchain (build-essential if you're missing it). Windows users hit more friction here than Linux ones - community Triton wheels are the usual path in, not an official one.
Inputs (1)
| Name | Type | Default | Description |
|---|---|---|---|
| model | * | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| * | * | — |