OpenCV decolor_1
The Twin of the Contrast-Preserving Decolorization Node
- src
- grayscale
- color_boost
- nparray_0
- nparray_1
OpenCV decolor_1 is the overload twin of decolor_0: identical wrapper, identical cv2.decolor(src, grayscale, color_boost) call, identical two outputs. As with every _0/_1 pair in geroldmeisinger/opencv-comfyui, the numbering comes from the code generator emitting one node per overload in cv2's type stubs (MatLike vs UMat). ComfyUI can't tell them apart, so neither should you.
What it does
Turns a color image into a contrast-preserving grayscale image - the classic failure of naive BGR2GRAY is that two different colors can land on the same gray, and decolor specifically avoids that - plus a color-boosted version as a second output. If that sounds useful, the full explanation and the two-output wiring are in the decolor_0 article.
Inputs and outputs
src(NPARRAY) - color input fromImage2Nparray.grayscale,color_boost(NPARRAY, optional) - out-parameters; leave unconnected, the function fills them.nparray_0(NPARRAY, output) - contrast-preserving grayscale.nparray_1(NPARRAY, output) - color-boosted version.
The mental model: OpenCV's out-parameters show up as optional inputs, and the actual results come out as the named outputs. It's the same pattern as decomposeEssentialMat and decomposeProjectionMatrix in this pack - once you've seen one, you've seen them all.
Install
ComfyUI Manager (search opencv-comfyui) or:
cd ComfyUI/custom_nodes
git clone https://github.com/geroldmeisinger/opencv-comfyui
pip install opencv-contrib-python
Restart ComfyUI. No models. decolor needs the contrib build of OpenCV (that's why the pack depends on opencv-contrib-python and not the plain opencv-python), so make sure that's the package you have. If Cannot import name 'guidedFilter' appears, conflicting installs are the cause; the README links the known fix.
Both outputs are single-channel (gray) and 3-channel (boosted) respectively, so treat nparray_0 like a grayscale image downstream - convert with cvtColor code 8 if a node insists on three channels. Batch-size-one only, as with everything in this pack.
Inputs (3)
| Name | Type | Default | Description |
|---|---|---|---|
| src | NPARRAY | — | |
| grayscaleopt | NPARRAY | — | |
| color_boostopt | NPARRAY | — |
Outputs (2)
| Name | Type | Description |
|---|---|---|
| nparray_0 | NPARRAY | — |
| nparray_1 | NPARRAY | — |