Depth Anything Tensorrt Advanced ⚡
The Advanced node hands you the actual numbers
- images
- depths
The basic Depth Anything Tensorrt node gives you a finished grayscale image, ready to drop into a ControlNet. This one gives you the same depth data before anyone paints it into a picture - a raw float32 array where every pixel is a linear depth value, in a custom DEPTHS type. Same engine, same speed, but you own the output instead of inheriting someone's normalization choices.
That sounds like a downgrade until you're doing anything other than feeding a ControlNet. If your downstream step is a 3D reconstruction, a displacement map for Blender, a stereo/VR conversion, or custom math on the depth values, the pre-baked 0–1 grayscale is actually in the way - it's already been clipped and normalized. Raw values let you decide where the useful range is.
It's also the hub of this pack's fancier pipeline. The README's recommended chain for video is:
Depth Anything Tensorrt Advanced → Depth Temporal Stabilizer → Depth Map Display
How it works
Mechanically it's the same inference path as the basic node: resize to the fixed 518×518 model input, run each frame through the TensorRT engine on a CUDA stream, resize the output back to your image's dimensions. The difference is in postprocessing - this node skips the min-max normalization and the uint8 conversion. You get depth_frames_np as float32, straight out of the engine.
One wrinkle in the source worth knowing: Depth Anything v3 outputs inverse depth (1/distance), so when the engine name contains "DA3" the node divides to convert it back to linear values. Everything else passes through as-is. The output is resized to match your input image, so depths has the shape [batch, height, width] at your resolution, not 518×518.
The inputs and outputs that matter
images- same as the basic node: an IMAGE or a batch of them, video frames included.engine- the same dropdown of engines inComfyUI/models/tensorrt/depth-anything, empty until you've built one. Refresh withrafter building.
Output is depths (DEPTHS, float32 numpy). Wire it into Depth Map Display to visualize it, into Depth Temporal Stabilizer GPU to smooth video flicker, or into any node that consumes the DEPTHS type.
Installing it
Same install as the whole pack - it ships in the same repository, so Manager install covers it. Quick version:
cd ComfyUI/custom_nodes
git clone https://github.com/yuvraj108c/ComfyUI-Depth-Anything-Tensorrt
cd ComfyUI-Depth-Anything-Tensorrt
pip install -r requirements.txt
The requirements (tensorrt, opencv-python, polygraphy, huggingface_hub) are the pack-wide ones; nothing extra here. Remember it's NVIDIA/CUDA only, and you need at least one compiled engine before the dropdown populates.
Gotchas
The DEPTHS type is pack-specific, so you can't feed this into stock ComfyUI nodes that expect a normal IMAGE - and conversely, the Display and Stabilizer nodes will reject a regular image. Don't try to short-circuit by taking the basic node's grayscale output and calling it depth; the two paths are deliberately separate.
For plain ControlNet conditioning, honestly, the basic node is the better choice - it normalizes and inverts metric models for you, which is exactly what a preprocessor should do. Reach for Advanced when you need the raw geometry, or when you're building the stabilized-video pipeline. And if you're on a low-VRAM card, the same advice as the basic node applies: stick to small/base engines with FP16 on rather than Large.
Inputs (2)
| Name | Type | Default | Description |
|---|---|---|---|
| images | IMAGE | Input image or batch of images to estimate depth for. | |
| engine | COMBO | TensorRT engine file to use for inference. Engine names containing 'DA3' use Depth Anything V3, others use V2/V1 postprocessing. |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| depths | DEPTHS | Raw linear depth values as a float32 numpy array. Use with the Depth Map Display node for visualization with colormaps and adjustments. |