ComfyUI-Depth-Anything-Tensorrt
ComfyUI-Depth-Anything-Tensorrt copied to clipboard
ComfyUI Depth Anything (v1/v2) Tensorrt Custom Node (up to 14x faster)
This repo provides a ComfyUI Custom Node implementation of the Depth-Anything-Tensorrt in Python for ultra fast depth map generation
⏱️ Performance
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
-
Download one of the available onnx models (518 x 518 resolution). If you want different resolutions, follow this guide
-
Modify and run the following command accordingly:
trtexec --onnx=depth_anything_vitl4.onnx --saveEngine=depth_anything_vitl14.engine --fp16
-
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)