Skip to content

huchukato/ComfyUI-Upscaler-TensorRT-Auto

 
 

Repository files navigation

ComfyUI Upscaler TensorRT ⚡

python cuda trt by-nc-sa/4.0

This project provides a Tensorrt implementation for fast image upscaling using models inside ComfyUI (2-4x faster)

Last tested: 12 January 2026 (ComfyUI v0.8.2@c623804 | Torch 2.9.1 | Tensorrt 10.14.1.48 | Python 3.12.3 | RTX5090 | CUDA 13.1 | Ubuntu 24.04)

⭐ Support

If you like my projects and wish to see updates and new features, please consider supporting me. It helps a lot!

ComfyUI-QwenVL-Mod comfy-tagcomplete ComfyUI-HuggingFace ComfyUI-Rife-Tensorrt stemify-audio-splitter

buy-me-coffees

⏱️ Performance

Note: The following results were benchmarked on FP16 engines inside ComfyUI, using 100 identical frames

Device Model Input Resolution (WxH) Output Resolution (WxH) FPS
RTX5090 4x-UltraSharp 512 x 512 2048 x 2048 12.7
RTX5090 4x-UltraSharp 1280 x 1280 5120 x 5120 2.0
RTX4090 4x-UltraSharp 512 x 512 2048 x 2048 6.7
RTX4090 4x-UltraSharp 1280 x 1280 5120 x 5120 1.1
RTX3060 4x-UltraSharp 512 x 512 2048 x 2048 2.2
RTX3060 4x-UltraSharp 1280 x 1280 5120 x 5120 0.35

🚀 Installation

🎯 Fully Automatic Installation (Recommended)

This node features fully automatic CUDA detection and TensorRT installation! When ComfyUI loads the node for the first time, it will:

  1. Auto-detect your CUDA version (12 or 13)
  2. Install the appropriate TensorRT packages automatically
  3. Configure everything for seamless operation No manual steps required! Just clone the repo and restart ComfyUI.

📦 Manual Installation Options

If you prefer manual installation or encounter issues: Auto-install scripts:

# Linux/macOS
./install.sh

# Windows
install.bat

# Python (cross-platform)
python install.py

Manual requirements files:

# For CUDA 13 (RTX 50 series)
pip install -r requirements.txt

# For CUDA 12 (RTX 30/40 series) - LEGACY METHOD
pip install -r requirements_cu12.txt

💡 Note: The requirements_cu12.txt is provided as a legacy fallback method. The automatic installation is strongly recommended as it handles CUDA detection and package installation seamlessly.

📦 CUDA Toolkit Required

The node automatically detects your CUDA installation via CUDA_PATH or CUDA_HOME environment variables.

CUDA_PATH
CUDA_HOME

If CUDA is not detected, download from: https://developer.nvidia.com/cuda-13-0-2-download-archive

🛠️ Supported Models

☀️ Usage

  • Load example workflow
  • Choose the appropriate model from the dropdown
  • The tensorrt engine will be built automatically
  • Load an image of resolution between 256-1280px
  • Set resize_to to resize the upscaled images to fixed or custom resolutions

🔧 Custom Models

  • To export other ESRGAN models, you'll have to build the onnx model first, using export_onnx.py
  • Place the onnx model in /ComfyUI/models/onnx/YOUR_MODEL.onnx
  • Then, add your model to this list load_upscaler_config.json
  • Finally, run the same workflow and choose your model
  • If you've tested another working tensorrt model, let me know to add it officially to this node

🚨 Updates

12 January 2026

  • Add more resizing scale factors
  • Add custom resolution resizing

27 August 2025

  • Support 4x-UltraSharpV2_Lite, 4x_UniversalUpscalerV2-Neutral_115000_swaG, 4x-ClearRealityV1
  • Load models from config PR#57

30 April 2025

  • Merge yuvraj108c#48 by @BiiirdPrograms to fix soft-lock by raising an error when input image dimensions unsupported

4 March 2025 (breaking)

  • Automatic tensorrt engines are built from the workflow itself, to simplify the process for non-technical people
  • Separate model loading and tensorrt processing into different nodes
  • Optimise post processing
  • Update onnx export script

⚠️ Known issues

  • If you upgrade tensorrt version, you'll have to rebuild the engines
  • Only models with ESRGAN architecture are currently working
  • High ram usage when exporting .pth to .onnx

🤖 Environment tested

  • Ubuntu 24.04, Debian 12
  • Windows 11

👏 Credits

License

Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International (CC BY-NC-SA 4.0)

About

2-4x faster ComfyUI Image Upscaling using Tensorrt ⚡

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

No contributors

Languages

  • Python 86.8%
  • Shell 5.6%
  • Batchfile 5.1%
  • JavaScript 2.5%