yuvraj108c / ComfyUI-Upscaler-Tensorrt

3-4x faster ComfyUI Image Upscaling using Tensorrt
Other
51 stars 4 forks source link
comfyui custom-nodes esrgan realesrgan stable-diffusion upscaling
# ComfyUI Upscaler TensorRT [![python](https://img.shields.io/badge/python-3.10.12-green)](https://www.python.org/downloads/release/python-31012/) [![cuda](https://img.shields.io/badge/cuda-12.3-green)](https://developer.nvidia.com/cuda-downloads) [![trt](https://img.shields.io/badge/TRT-10.0-green)](https://developer.nvidia.com/tensorrt) [![by-nc-sa/4.0](https://img.shields.io/badge/license-CC--BY--NC--SA--4.0-lightgrey)](https://creativecommons.org/licenses/by-nc-sa/4.0/deed.en)

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

This project is licensed under CC BY-NC-SA, everyone is FREE to access, use, modify and redistribute with the same license.

For commercial purposes, please contact me directly at yuvraj108c@gmail.com

If you like the project, please give me a star! ⭐


⏱️ Performance

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

Device Model Input Resolution (WxH) Output Resolution (WxH) FPS
L40s RealESRGAN_x4 512 x 512 2048 x 2048 5
L40s RealESRGAN_x4 960 x 540 3840 x 2160 2
L40s RealESRGAN_x4 1280 x 1280 5120 x 5120 0.7

🚀 Installation

Navigate to the ComfyUI /custom_nodes directory

git clone https://github.com/yuvraj108c/ComfyUI-Upscaler-Tensorrt.git
cd ./ComfyUI-Upscaler-Tensorrt
pip install -r requirements.txt

🛠️ Building Tensorrt Engine

  1. Download one of the available onnx models. These onnx models support dynamic image resolutions from 256x256 to 1280x1280 px (e.g 960x540, 512x512, 1280x720 etc). Here are the original models:

  2. Run python export_trt.py and set onnx/engine paths accordingly

  3. Place the exported engine inside ComfyUI /models/tensorrt/upscaler directory

☀️ Usage

⚠️ Known issues

🤖 Environment tested

👏 Credits

License

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