ComfyUI-Depth-Anything-Tensorrt icon indicating copy to clipboard operation
ComfyUI-Depth-Anything-Tensorrt copied to clipboard

ComfyUI Depth Anything Tensorrt Custom Node (up to 5x faster), licensed under CC BY-NC-SA 4.0

ComfyUI Depth Anything TensorRT

python cuda trt mit

This repo provides a ComfyUI Custom Node implementation of the Depth-Anything-Tensorrt in Python for ultra fast depth map generation

⏱️ Performance

Original Source

Device Model Model Input (WxH) Image Resolution (WxH) Inference Time(ms)
RTX4090 Depth-Anything-S 518x518 1280x720 3
RTX4090 Depth-Anything-B 518x518 1280x720 6
RTX4090 Depth-Anything-L 518x518 1280x720 12

🚀 Installation

Navigate to the ComfyUI /custom_nodes directory

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

🛠️ Building Tensorrt Engine

  1. Download one of the available onnx models (518 x 518 resolution). If you want different resolutions, follow this guide

  2. Modify and run the following command accordingly:

    trtexec --onnx=depth_anything_vitl4.onnx --saveEngine=depth_anything_vitl14.engine --fp16
    
  3. Place the engines inside ComfyUI /models/depth_trt_engines directory

🤖 Environment tested

  • Ubuntu 22.04 LTS, Cuda 12.3, Tensorrt 8.6.1, Python 3.10, A10G GPU
  • Windows (Not tested)

👏 Credits