ComfyUI Node
cv2.cvtColor
Raw wrapper of cv2.cvtColor(src, code, dstCn?, hint?). Parameters marked '?' are optional; blank means OpenCV default. See the OpenCV documentation for details.
cv2.cvtColor
- src
- nparray
◄codeCOLOR_BGR2GRAY►
◄dstCn0►
◄hintALGO_HINT_DEFAULT►
Categoryimage/CV/low-level/cv2 C
Inputs (4)
| Name | Type | Default | Description |
|---|---|---|---|
| src | NPARRAY,IMAGE,MASK | input image: 8-bit unsigned, 16-bit unsigned ( CV_16UC... ), or single-precision floating-point. Accepts a ComfyUI IMAGE/MASK directly (frame 0 of a batch) or an NPARRAY. Arithmetic ops (add, multiply, etc.) process the full IMAGE batch when both inputs have the same batch size. | |
| code | COMBO | COLOR_BGR2GRAY | color space conversion code (see #ColorConversionCodes). |
| dstCnopt | INT | 0-2147483648–2147483647 | number of channels in the destination image; if the parameter is 0, the number of the channels is derived automatically from src and code. Preset to the OpenCV default (0). |
| hintopt | COMBO | ALGO_HINT_DEFAULT | Implementation modification flags. See #AlgorithmHint |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| nparray | NPARRAY | — |