Nodes/opencv-comfyui/OpenCV applyColorMap_1
ComfyUI Node

OpenCV applyColorMap_1

OpenCV applyColorMap_1

By geroldmeisinger·Created about a year ago·Updated about a year ago· 35
OpenCV applyColorMap_1
  • src
  • dst
  • nparray
colormap

applyColorMap_1 is the duplicate of applyColorMap_0: same src + colormap inputs, same optional dst, same colorized nparray output. OpenCV exposes two overloads of cv2.applyColorMap that share this signature, opencv-comfyui generated a node for each, and you get two identical entries. There is no difference worth thinking about - pick one and stop.

What it does

Maps a grayscale image through a built-in color palette so data reads as color. A depth map becomes the familiar blue→red heat gradient, a saliency or mask becomes a glowing intensity plot. In ComfyUI, that makes it the display node for anything a model outputs as grayscale: depth, disparity, attention, density. It's free, deterministic, and changes no data - purely for your eyes, which makes it a permanent fixture in debugging graphs.

The inputs that matter

  • src (NPARRAY) - the grayscale image to colorize.
  • colormap (INT) - palette index 0–22. The ones people actually use: 2 (JET, the classic depth rainbow), 12 (PARULA, modern and less banded), 11 (HOT), 16 (VIRIDIS, colorblind-safe).
  • dst (NPARRAY, optional) - out-parameter; skip it.

Output: one nparray - the colorized image.

Wiring it up

IMAGEImage2NparraycvtColor (code=6, BGR2GRAY) → applyColorMap_1Nparrays2Image. Feed an RGB image straight in and the per-channel mapping produces a muddy, wrong-looking result - the gray conversion is the step people skip and then blame the node for. Remember batch_size is 1; slice with ImageFromBatch.

Installing opencv-comfyui

ComfyUI Manager → search "opencv-comfyui", or:

cd ComfyUI/custom_nodes
git clone https://github.com/geroldmeisinger/opencv-comfyui

Restart ComfyUI. Dependency: opencv-contrib-python.

Gotchas

  • Grayscale in - cvtColor (code=6) first, always.
  • Int colormap, no dropdown - you type 2 for JET; this pack has no COMBO widgets yet (author's stated todo).
  • Batch_size == 1 - use ImageFromBatch.
Categoryimage/OpenCV

Inputs (3)

NameTypeDefaultDescription
srcNPARRAY
colormapINT
dstoptNPARRAY

Outputs (1)

NameTypeDescription
nparrayNPARRAY