RTX Engine Loader
The node that turns a small ONNX file into a GPU-tuned engine (and it's happy to wait)
- config
- ENGINE
RTX Engine Loader is the heart of this pack. It loads a TensorRT engine - and if a matching one doesn't exist for your GPU, it compiles one on the spot from a source ONNX file. That second sentence is doing a lot of work, because it's where the first-run waiting comes from.
Here's the mental model. A plain ESRGAN-class upscaler runs as a generic ONNX graph; TensorRT instead compiles that graph into kernels tuned for your exact GPU, then runs them on Tensor Cores. That's how this pack gets its "up to 30x faster" claim vs. CPU or unoptimized local inference. The catch: the compiled engine is hardware-specific and takes minutes to build. This node hides all of that behind a dropdown.
What it does under the hood
The node scans ComfyUI's models/onnx folder and lists every .onnx file for its onnx_name dropdown (it skips RIFE models, since those are frame interpolation, not upscaling). Pick one, and it checks models/tensorrt/upscaler/ for a cached .trt file whose name encodes the shape profile and your tensorrt_rtx version. No match? It builds:
- loads the ONNX and converts it to FP16 if it isn't already,
- simplifies the graph with ONNX-SIM,
- runs the TensorRT builder at optimization level 5, with a persistent timing cache so later builds of other models reuse learned kernel timings,
- shows real progress via a TQDM bar in the ComfyUI console,
- saves the result to
models/tensorrt/upscaler/.
That timing cache is the reason your second model builds noticeably faster than your first.
The two inputs that matter
- onnx_name - the upscaler model, as an
.onnxfile you've dropped inComfyUI/models/onnx. The README points at pre-exported ONNX files on Hugging Face (yuvraj108c/ComfyUI-Upscaler-Onnx) - grab 4x-UltraSharp or 4x_NMKD-Siax_200k for general use, 4x-AnimeSharp for anime. These are small files; no giant checkpoint download. - config (optional) - a
CONFIGfrom RTX Engine Dynamic Shape Config. Leave it unwired and you get the defaults (256 to 1280). Wire it to change the resolution envelope, which is the whole reason this fork exists.
The single output, ENGINE, feeds directly into RTX Upscale Image's engine input.
Install & the two pain points
Install the pack via ComfyUI Manager → Custom Nodes Manager → Install via Git URL with https://github.com/ThreadsOfFate/ComfyUI-Upscaler-TensorRT-RTX.git (it's not in the searchable registry yet), or git clone it into custom_nodes. Then, using ComfyUI's own Python:
cd ComfyUI/custom_nodes && git clone https://github.com/ThreadsOfFate/ComfyUI-Upscaler-TensorRT-RTX
cd ComfyUI-Upscaler-TensorRT-RTX && pip install -r requirements.txt
That requirements file pulls tensorrt_rtx, polygraphy, cuda-toolkit, onnx, onnxsim and friends - heavy, and you additionally need the NVIDIA CUDA Toolkit installed on the system, not just a driver.
Where people get burned, from real threads: import failure after install - ModuleNotFoundError: No module named 'tensorrt' - because Manager didn't install the heavy deps into the right environment; run the pip install above in ComfyUI's venv and it clears up. And the first build looks stuck. It isn't necessarily; a first engine build can legitimately take several minutes while the TQDM bar crawls. Give it time. If a build fails on VRAM, shrink the width_max/height_max in the Dynamic Shape Config - and note that every GPU driver or tensorrt_rtx update invalidates your built engines and forces a rebuild. Annoying, but that's TensorRT's deal, not this node's bug.
Inputs (2)
| Name | Type | Default | Description |
|---|---|---|---|
| onnx_name | COMBO | 0 options: | |
| configopt | TRT_RTX_ENGINE_CONFIG | Options for building the TensorRT engine |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| ENGINE | TRT_RTX_ENGINE | — |