CV Color Map
Make a depth map or a score map actually readable
- image
- IMAGE
What this is for
A depth map is a grayscale image, and a grayscale depth map is nearly unreadable - you can tell near from far, but you can't tell a 2cm step from a 20cm one without squinting. A false-colour map fixes that: perceptually uniform ramps put the boundaries where your eye can actually find them. Same story for heat maps, confidence maps, and any single-channel score map coming out of a vision pipeline.
This is the standard viewer node for that job, and it's the one to reach for before you start debugging a depth estimator that might be fine.
How it works
It converts the frame to grayscale and applies cv2.applyColorMap with the palette you chose. That's it - the operation is one cv2 call. The reason it exists as a curated node rather than a raw wrapper call is the second half: color_scale.
COLORMAP_VIRIDIS and COLORMAP_INFERNO are perceptually uniform, which is the property that matters when the numbers are data: equal steps in value look like equal steps in colour, so a 0.1 difference looks the same in the dark end as in the bright end. COLORMAP_JET is the old rainbow everybody used in papers for twenty years; it's vivid, it's a lie about ordering, and it makes banding appear where there is none. The author's own tooltip says as much, which is the kind of bluntness you want from a node.
Turn on color_scale and the node appends a vertical colour bar with 0..1 intensity labels beside the result, so the picture carries its own key. It's drawn to stay legible even on tiny inputs - including a 1-pixel image - which matters more than it sounds: a colour-mapped preview is exactly the thing you screenshot into a bug report or a write-up, and a colour ramp with no labels is decoration.
Inputs and outputs
Three inputs, all simple:
image- a batch is processed frame by frame.colormap- the palette dropdown, defaultCOLORMAP_VIRIDIS.color_scale- off by default; turn it on when the output leaves ComfyUI.
One output: IMAGE. Feed Save Image for an artefact, Preview Image for a look, or keep chaining - the node outputs an ordinary image, so it composes with anything (blend it over the source at low opacity for a depth-overlay, for instance).
Where it fits
For depth specifically: the pipeline is estimator → CV Color Map → your eyes, and that viewing step is not optional overhead. Depth estimators fail in characteristic ways that are obvious as colour and invisible as grey - a hard seam where the model switched from near-field to far-field interpretation, a smooth ramp where there should be an object boundary, a hole. You'll catch all three in a coloured preview and miss them in greyscale.
It's also the honest alternative to a chart when the "data" really is a picture: use this when the array is an image-shaped thing (depth, saliency, confidence), and the CV Chart * nodes when it's a small table of numbers.
Install
cd ComfyUI/custom_nodes
git clone https://github.com/bmad4ever/comfyui_cv
# restart ComfyUI
Or search ComfyUI CV in ComfyUI Manager (publisher bmad4ever). Requires Python ≥ 3.12, a recent V3-node-API ComfyUI, and opencv-contrib-python-headless~=5.0.0.93 (installed from the pack's requirements). No models, no downloads.
Common issues
- The result is grey-ish and boring. You fed it a colour image and it converted to grayscale first, as documented. This node is a false-colour mapper for single-channel data, not a stylize node.
- Bandit artefacts. That's
JET. Switch to viridis or inferno. - The colour bar is missing. Check
color_scale; it's off by default and it's a separate draw step, so it will also cost you a moment on large frames. - Contrib-backed nodes disappeared pack-wide. A non-contrib OpenCV wheel clobbered the shared
site-packages/cv2. Diagnose and repair withpython tools/repair_opencv_contrib.py --check/--apply.
Inputs (3)
| Name | Type | Default | Description |
|---|---|---|---|
| image | IMAGE | Input image. A batch is processed frame by frame. | |
| colormap | COMBO | COLORMAP_VIRIDIS | False-color palette. VIRIDIS/INFERNO are perceptually uniform (best for data); JET is the classic rainbow. |
| color_scaleopt | BOOLEAN | false | Append a vertical colour scale bar with 0..1 intensity labels next to the colour-mapped image (stays legible even for tiny / 1-pixel images). |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| IMAGE | IMAGE | — |