Depth Map Display ⚡
19 colormaps and a handful of knobs
- depths
- IMAGE
Raw depth values are a float32 array - genuinely useless to look at, and useless to a ControlNet until they're rendered into an image. This node is the renderer. It takes the DEPTHS output from the Advanced node and turns it into a viewable depth map with nineteen colormaps, plus invert, contrast, brightness, gamma, and outlier clipping. It's the node people actually search for in this pack, because it's also the one that makes the difference between a depth map that reads clearly and a washed-out gray mush.
How it works
The pipeline in the source is straightforward and worth internalizing, because it explains the knobs. It normalizes the depth values, then applies adjustments in this order: percentile clipping → min-max normalize → optional invert → gamma curve → contrast around the midpoint → brightness shift → colormap.
The one that fixes most "why does my depth map look terrible" cases is percentile_clip, which defaults to 2.0. Depth predictions always have a few extreme outlier values, and if you normalize against the raw min and max, those outliers crush the useful middle range into a low-contrast band. Clipping the top and bottom 2% before normalizing restores the contrast. Set it to 0 if you want no clipping at all.
Then gamma is the tone curve: below 1.0 brightens distant regions (which are usually dark in depth maps), above 1.0 reveals detail in the near range. Contrast stretches values around the 0.5 midpoint, brightness shifts everything up or down.
The inputs that matter
depths- theDEPTHSoutput from Depth Anything Tensorrt Advanced, not the grayscale IMAGE from the basic node. It won't accept the wrong type, so this is hard to get wrong by accident.colormap- nineteen choices. For ControlNet-style work,grayscalegives you the single-channel map a preprocessor expects. For actually looking at depth,infernoandviridisare the scientifically legible defaults,turbois the punchy one, andjetis the familiar-but-slightly-toxic choice. Any of the others are vibes.invert- flips near/far. Default off, which means brighter = closer.
The optional float knobs - contrast, brightness, gamma, percentile_clip - all have sane defaults and you'll rarely touch more than percentile_clip and maybe gamma.
Output is a standard IMAGE (RGB, 0–1). It's marked as an output node, so you can preview it directly, save it, or feed it into a ControlNet. The output is a visualization, though - if you're conditioning a ControlNet you might actually want the basic node's normalized grayscale instead of a colormapped render, unless you need the exact framing this node's knobs give you.
Installing it
Part of the same pack, so Manager install or:
cd ComfyUI/custom_nodes
git clone https://github.com/yuvraj108c/ComfyUI-Depth-Anything-Tensorrt
cd ComfyUI-Depth-Anything-Tensorrt
pip install -r requirements.txt
No extra dependencies beyond the pack's usual tensorrt, opencv-python, polygraphy, huggingface_hub. The colormaps come from OpenCV, which is why it's there.
Where people get burned
The most common confusion is wiring the wrong thing in. This node needs raw DEPTHS - if you've only got the basic node's grayscale IMAGE output, you're one step early. Run it through the Advanced node first.
Second, remember this is a display/visualization node, not a postprocessor that makes depth "better." Fiddling with contrast and gamma changes how the map looks, and if you're feeding the result to a ControlNet, those choices change the conditioning too. percentile_clip is the one adjustment that genuinely improves the map for most inputs; the rest are taste. If the map looks flat no matter what you do, that's usually the input depth, not the display - try a different engine size.
Inputs (7)
| Name | Type | Default | Description |
|---|---|---|---|
| depths | DEPTHS | Raw depth array from the Depth Anything Advanced node. | |
| colormap | COMBO | Color scheme for visualizing the depth map. 'grayscale' outputs a single-channel gray image, others apply OpenCV colormaps. | |
| invert | BOOLEAN | false | Flip the depth values so that near becomes far and vice versa. |
| contrastopt | FLOAT | 1.00.1–5 | Adjusts the spread of depth values around the midpoint. Values above 1.0 increase separation, below 1.0 compress the range. |
| brightnessopt | FLOAT | 0.00-1–1 | Shifts all depth values up or down. Positive values brighten the output, negative values darken it. |
| gammaopt | FLOAT | 1.00.1–5 | Non-linear tone curve. Values below 1.0 reveal more detail in dark/distant regions, above 1.0 reveals more detail in bright/near regions. |
| percentile_clipopt | FLOAT | 2.00–20 | Clips outlier depth values at this percentile from both ends of the distribution before normalizing. Prevents extreme depth values from compressing the useful range. Set to 0 for no clipping. |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| IMAGE | IMAGE | Colormapped depth visualization as an RGB image. |