ComfyUI Node

TensorRT Loader

Your Fastest SDXL Runs on This Node (After a One-Time Build)

By comfyanonymous·Created 2 years ago·Updated 2 years ago· 705
TensorRT Loader
    • MODEL
    unet_name
    model_type

    If you've seen someone on r/StableDiffusion quote a 1.5–2x speedup on their RTX card, this is the node handing them that result. The TensorRT Loader is the "load" side of the official ComfyUI_TensorRT pack: it takes a TensorRT engine file you built earlier and turns it back into a MODEL you can plug straight into your sampler.

    Here's the part that trips everyone up first: the loader can't load anything until you've built an engine. It has no bundled weights, no downloads, no defaults. Engines are produced by the pack's two other nodes - STATIC_TRT_MODEL_CONVERSION and DYNAMIC_TRT_MODEL_CONVERSION - and the loader just consumes what they wrote to disk. Think of the family as build-then-run: convert once, load forever.

    How it works

    ComfyUI's model loading normally means reading a checkpoint's UNet weights into memory and running them as PyTorch. TensorRT skips that: the conversion nodes compiled your UNet into a serialized engine - machine code tuned for your specific GPU - and the loader hands that engine to ComfyUI as if it were the model. It builds the right model base for the architecture you select with the UNet's own weights disabled, because the engine is the UNet now. ComfyUI never loads the original weights, which is a big part of why generation is both faster and lighter on VRAM. The engine even handles batching internally, splitting large batches on its own.

    The inputs that matter

    Just two, both dropdowns:

    • unet_name - lists the .engine files in ComfyUI's tensorrt folder. Built one during this session and it's not there? Refresh the browser (F5). The list is cached when the page loads.
    • model_type - sdxl_base, sdxl_refiner, sd1.x, sd2.x-768v, svd, sd3, auraflow, flux_dev, flux_schnell. It must match what you built. Mismatch means the wrong model wrapper gets bolted onto the engine, and you get garbage or a crash.

    The filenames encode what each engine supports, so they're worth learning to read: stat-b-1-h-512-w-512 is a static engine (one resolution, one batch), while dyn-b-1-1-1-h-512-512-512-w-… is dynamic with min-max-opt ranges.

    What it outputs

    One MODEL output, and it wires into your KSampler exactly like the model output of a Load Checkpoint node. The engine only replaces the UNet, so CLIP and VAE still come from a regular Load Checkpoint node - keep that in your workflow and feed its CLIP/VAE as you normally would. Sampler, scheduler, CFG, steps: all yours as usual.

    Install

    Same as the whole pack. Easiest is ComfyUI Manager - search "TensorRT Node for ComfyUI" - or manually:

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

    The heavy one is tensorrt>=10.0.1 (a big NVIDIA wheel) plus onnx. And the README is blunt about the hardware floor: GeForce RTX or NVIDIA RTX only. No AMD, no Intel, and this is the one hard requirement you can't talk your way around.

    Common issues

    • Engine not in the dropdown - F5, and confirm the filename prefix started with tensorrt/ when you built it.
    • Resolution errors - dynamic engines only work inside their min–max range; static engines only at their exact shape. Generate outside that and you'll get an error or a rebuild.
    • No LoRAs or ControlNets - the README is explicit that engines aren't compatible with them yet. The community workaround for LoRAs is baking them into a checkpoint first (Load Checkpoint → LoraLoader → CheckpointSave) and converting that.
    • Swapped GPUs - engines are tied to the GPU and TensorRT version they were built on. Move machines, rebuild.

    One aside: this pack is from comfyanonymous, the same pseudonymous dev behind ComfyUI itself, so it's about as first-party as a custom node gets - when NVIDIA's TensorRT integration breaks, this is the repo that gets fixed first.

    CategoryTensorRT

    Inputs (2)

    NameTypeDefaultDescription
    unet_nameCOMBO0 options:
    model_typeCOMBO9 options: sdxl_base, sdxl_refiner, sd1.x, sd2.x-768v, svd, sd3, +3

    Outputs (1)

    NameTypeDescription
    MODELMODEL