ComfyUI-Depth-Anything-Tensorrt

ComfyUI-Depth-Anything-Tensorrt
★ 129

深度估计TensorRT加速ComfyUI扩展实时性能
在ComfyUI中以Python实现Depth-Anything-Tensorrt节点,利用TensorRT与FP16显著加速深度图生成,支持多款模型与高帧率推理。
💡 在ComfyUI中快速生成高分辨率深度图以用于合成与后期处理
🍴 13 Forks💻 Python🔄 2026-03-02
📦
网盘下载
复制链接后前往夸克网盘下载
https://pan.quark.cn/s/6862a2001521
📦 requirements.txt
tensorrt
opencv-python
polygraphy
huggingface_hub
📄 README

ComfyUI Depth Anything TensorRT

[](https://www.python.org/downloads/release/python-3123//)

[](https://developer.nvidia.com/cuda-downloads)

[](https://developer.nvidia.com/tensorrt)

[](https://github.com/spacewalk01/depth-anything-tensorrt/blob/main/LICENSE)

This repo provides a ComfyUI Custom Node implementation of the Depth-Anything-Tensorrt in Python for ultra fast depth map generation (up to 14x faster than comfyui_controlnet_aux)

Last tested: 10 January 2026 (ComfyUI v0.8.2@a60b7b8 | Torch 2.9.1 | 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!

[](https://github.com/yuvraj108c/ComfyUI-Depth-Anything-Tensorrt)

[](https://github.com/yuvraj108c/ComfyUI-Upscaler-Tensorrt)

[](https://github.com/yuvraj108c/ComfyUI-Dwpose-Tensorrt)

[](https://github.com/yuvraj108c/ComfyUI-Rife-Tensorrt)

[](https://github.com/yuvraj108c/ComfyUI-Whisper)

[](https://github.com/yuvraj108c/ComfyUI_InvSR)

[](https://github.com/yuvraj108c/ComfyUI-FLOAT)

[](https://github.com/yuvraj108c/ComfyUI-Thera)

[](https://github.com/yuvraj108c/ComfyUI-Video-Depth-Anything)

[](https://github.com/yuvraj108c/ComfyUI-PiperTTS)

Special thanks to livepeer.org for supporting the project!

[](https://www.buymeacoffee.com/yuvraj108cZ)

[](https://paypal.me/yuvraj108c)


⏱️ Performance (Depth Anything V1)

_Note: The following results were benchmarked on FP16 engines inside ComfyUI_

| Device | Model | Model Input (WxH) | Image Resolution (WxH) | FPS |

| :—–: | :————–: | :—————: | :——————–: | :–: |

| RTX4090 | Depth-Anything-S | 518×518 | 1280×720 | 35 |

| RTX4090 | Depth-Anything-B | 518×518 | 1280×720 | 33 |

| RTX4090 | Depth-Anything-L | 518×518 | 1280×720 | 24 |

| H100 | Depth-Anything-L | 518×518 | 1280×720 | 125+ |

⏱️ Performance (Depth Anything V2)

_Note: The following results were benchmarked on FP16 engines inside ComfyUI_

| Device | Model | Model Input (WxH) | Image Resolution (WxH) | FPS |

| :—-: | :————–: | :—————: | :——————–: | :-: |

| H100 | Depth-Anything-S | 518×518 | 1280×720 | 213 |

| H100 | Depth-Anything-B | 518×518 | 1280×720 | 180 |

| H100 | Depth-Anything-L | 518×518 | 1280×720 | 109 |

⏱️ Performance (Depth Anything V3)

_Note: The following results were benchmarked on FP16 engines inside ComfyUI_

| Device | Model | Model Input (WxH) | Image Resolution (WxH) | FPS |

| :—-: | :————–: | :—————: | :——————–: | :-: |

| RTX5090 | DA3Mono-Large | 518×518 | 1280×720 | 85 |

| RTX5090 | DA3Metric-Large | 518×518 | 1280×720 | 85 |

⏱️ Performance (Distill Any Depth)

_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 | 518×518 | 1280×720 | 76 |

| H100 | Distill-Any-Depth-Multi-Teacher-Base | 518×518 | 1280×720 | 68 |

| H100 | Distill-Any-Depth-Multi-Teacher-Large | 518×518 | 1280×720 | 59 |

| H100 | Distill-Any-Depth-Dav2-Teacher-Large-2w-iter | 518×518 | 1280×720 | 57 |

🚀 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

There are two ways to build TensorRT engines:

Method 1: Using the EngineBuilder Node

  • 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.

    Method 2: Manual Building

  • Download one of the available onnx models:
  • Depth Anything v1
  • Depth Anything v2
  • Depth Anything v3
  • Distill Any Depth
  • Run the export script, e.g
  • “`bash

    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-anything directory
  • ☀️ Usage

    Depth Anything Tensorrt (Basic)

  • Insert node by Right Click -> tensorrt -> Depth Anything Tensorrt
  • Choose the appropriate engine from the dropdown
  • Returns a grayscale depth image (IMAGE type) ready for direct use in workflows
  • Depth Anything Advanced + Depth Map Display

    For more control over depth visualization, use the two-node pipeline:

  • Depth Anything Tensorrt Advanced (Right Click -> tensorrt -> Depth Anything Tensorrt Advanced)
  • Returns raw linear depth values instead of a processed image
  • Depth Map Display (Right Click -> tensorrt -> Depth Map Display)
  • Connect to the Advanced node’s depths output
  • Visualizes depth using colormaps with the following adjustments:
  • | Parameter | Default | Range | Description |

    |———–|———|——-|————-|

    | colormap | — | grayscale, inferno, viridis, plasma, magma, turbo, jet, hot, cool, spring, summer, autumn, winter, bone, rainbow, ocean, hsv, parula, pink | Color scheme for depth visualization |

    | invert | false | true/false | Flip depth so near becomes far and vice versa |

    | contrast | 1.0 | 0.1 – 5.0 | Spread of depth values around the midpoint |

    | brightness | 0.0 | -1.0 – 1.0 | Shifts all depth values up or down |

    | gamma | 1.0 | 0.1 – 5.0 | Non-linear tone curve. Below 1.0 reveals detail in distant regions, above 1.0 in near regions |

    | percentile_clip | 2.0 | 0.0 – 20.0 | Clips outlier depth values at this percentile from both ends before normalizing. Prevents extreme values from compressing the useful range |

    📝 Changelog

  • 31/01/2026
  • Added multiple depth colormaps
  • Added Depth Map Display adjustments: contrast, brightness, gamma, percentile clipping
  • Added tooltips, descriptions, and output tooltips to all nodes
  • 29/01/2026
  • Major refactoring (file structure, logging)
  • Moved model definitions to config/models.json
  • Use huggingface_hub to download onnx models
  • 10/01/2026
  • Add partial support for Depth Anything V3 (DA3Mono-Large, DA3Metric-Large)
  • 16/09/2025
  • Add support for v2 metric models (depth_anything_v2_metric_hypersim_vitl, depth_anything_v2_metric_vkitti_vitl) https://github.com/yuvraj108c/ComfyUI-Depth-Anything-Tensorrt/pull/21
  • 08/07/2025
  • Add support for Distill-Any-Depth
  • Add benchmark for Distill-Any-Depth models
  • 20/05/2025
  • Merge PR#15 for auto engine building inside comfyui by ryanontheinside
  • Merge PR#14 for configurable params in export_trt.py by rickstaa
  • 02/07/2024
  • Add Depth Anything V2 onnx models + benchmarks
  • Merge PR for engine caching in memory by BuffMcBigHuge
  • 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)
  • 👏 Credits

  • NVIDIA/Stable-Diffusion-WebUI-TensorRT
  • spacewalk01/depth-anything-tensorrt
  • martenwikman/depth-anything-tensorrt-docker
  • Westlake-AGI-Lab/Distill-Any-Depth
  • kijai/ComfyUI-DepthAnythingV2