Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork13
ComfyUI Depth Anything (v1/v2/distill-any-depth) Tensorrt Custom Node (up to 14x faster)
License
yuvraj108c/ComfyUI-Depth-Anything-Tensorrt
Folders and files
| Name | Name | Last commit message | Last commit date | |
|---|---|---|---|---|
Repository files navigation
This repo provides a ComfyUI Custom Node implementation of theDepth-Anything-Tensorrt in Python for ultra fast depth map generation (up to 14x faster thancomfyui_controlnet_aux)
If you like my projects and wish to see updates and new features, please consider supporting me. It helps a lot!
Special thanks tolivepeer.org for supporting the project!
Note: The following results were benchmarked on FP16 engines inside ComfyUI
| Device | Model | Model Input (WxH) | Image Resolution (WxH) | FPS |
|---|---|---|---|---|
| RTX4090 | Depth-Anything-S | 518x518 | 1280x720 | 35 |
| RTX4090 | Depth-Anything-B | 518x518 | 1280x720 | 33 |
| RTX4090 | Depth-Anything-L | 518x518 | 1280x720 | 24 |
| H100 | Depth-Anything-L | 518x518 | 1280x720 | 125+ |
Note: The following results were benchmarked on FP16 engines inside ComfyUI
| Device | Model | Model Input (WxH) | Image Resolution (WxH) | FPS |
|---|---|---|---|---|
| H100 | Depth-Anything-S | 518x518 | 1280x720 | 213 |
| H100 | Depth-Anything-B | 518x518 | 1280x720 | 180 |
| H100 | Depth-Anything-L | 518x518 | 1280x720 | 109 |
Note: The following results were benchmarked on FP16 engines inside ComfyUI
| Device | Model | Model Input (WxH) | Image Resolution (WxH) | FPS |
|---|---|---|---|---|
| H100 | Distill-Any-Depth-Multi-Teacher-Small | 518x518 | 1280x720 | 76 |
| H100 | Distill-Any-Depth-Multi-Teacher-Base | 518x518 | 1280x720 | 68 |
| H100 | Distill-Any-Depth-Multi-Teacher-Large | 518x518 | 1280x720 | 59 |
| H100 | Distill-Any-Depth-Dav2-Teacher-Large-2w-iter | 518x518 | 1280x720 | 57 |
Navigate to the ComfyUI/custom_nodes directory
git clone https://github.com/yuvraj108c/ComfyUI-Depth-Anything-Tensorrt.gitcd ./ComfyUI-Depth-Anything-Tensorrtpip install -r requirements.txtThere are two ways to build TensorRT engines:
- Insert node by
Right Click -> tensorrt -> Depth Anything Engine Builder - Select the model version (v1 or v2 or DAD) and size (small, base, or large)
- Optionally customize the engine name, FP16 settings, and onnx path
- Run the workflow to build the engine
The engine will be automatically downloaded and built in the specified location. Refresh the webpage or strike 'r' on your keyboard, and the new engine will appear in the Depth Anything Tensorrt node.
- Download one of the available onnx models:
- Run the export script, e.g
python export_trt.py --onnx-path ./depth_anything_vitl14-fp16.onnx --trt-path ./depth_anything_vitl14-fp16.engine
- Place the exported engine inside ComfyUI
/models/tensorrt/depth-anythingdirectory
- Insert node by
Right Click -> tensorrt -> Depth Anything Tensorrt - Choose the appropriate engine from the dropdown
- Ubuntu 22.04 LTS, Cuda 12.3, Tensorrt 10.0.1, Python 3.10, RTX 4090 GPU
- Windows (Not tested)
16/09/2025
- Add support for v2 metric models (depth_anything_v2_metric_hypersim_vitl, depth_anything_v2_metric_vkitti_vitl)#21
08/07/2025
- Add support forDistill-Any-Depth
- Add benchmark for Distill-Any-Depth models
20/05/2025
- MergePR#15 for auto engine building inside comfyui byryanontheinside
- MergePR#14 for configurable params in export_trt.py byrickstaa
02/07/2024
- Add Depth Anything V2 onnx models + benchmarks
- MergePR for engine caching in memory byBuffMcBigHuge
26/04/2024
- Update to tensorrt 10.0.1
- Massive code refactor, remove trtexec, remove pycuda, show engine building progress
- Update and standardise engine directory and node category for upcoming tensorrt custom nodes suite
7/04/2024
- Fix image resize bug during depth map post processing
30/03/2024
- Fix CUDNN_STATUS_MAPPING_ERROR
27/03/2024
- Major refactor and optimisation (remove subprocess)
About
ComfyUI Depth Anything (v1/v2/distill-any-depth) Tensorrt Custom Node (up to 14x faster)
Topics
Resources
License
Uh oh!
There was an error while loading.Please reload this page.
Stars
Watchers
Forks
Releases
Sponsor this project
Uh oh!
There was an error while loading.Please reload this page.
Packages0
Uh oh!
There was an error while loading.Please reload this page.
Contributors4
Uh oh!
There was an error while loading.Please reload this page.


