Nodes/opencv-comfyui/OpenCV cvtColorTwoPlane_1
ComfyUI Node

OpenCV cvtColorTwoPlane_1

The Overload Twin of the Two-Plane Converter

By geroldmeisinger·Created about a year ago·Updated about a year ago· 35
OpenCV cvtColorTwoPlane_1
  • src1
  • src2
  • dst
  • nparray
code
hint

OpenCV cvtColorTwoPlane_1 is the identical twin of cvtColorTwoPlane_0. Same wrapper, same inputs, same output, same cv2.cvtColorTwoPlane call underneath. If you've already read the cvtColorTwoPlane_0 article, you know the node; this page exists so the twin has its own address.

The _1 exists because geroldmeisinger/opencv-comfyui generates one node per overload in cv2's Python type stubs - MatLike and UMat - and both get emitted even though ComfyUI treats them identically. It's the same codegen artifact that gives you cvtColor_0/cvtColor_1, dct_0/dct_1, and most other pairs in this pack. The honest answer to "which one do I use?" is "whichever".

What it's for

Converts a semi-planar YUV image (two separate nparrays: luma src1, chroma src2) into a standard color image using a code enum like cv2.COLOR_YUV2BGR_NV12. This is camera-pipeline territory - NV12 and friends are what webcams and hardware decoders emit before conversion to BGR. For regular diffusion workflows you'll never touch it; use plain cvtColor for your color-space needs.

Inputs and outputs

  • src1 (NPARRAY) - luma plane.
  • src2 (NPARRAY) - chroma plane.
  • code (INT) - the large COLOR_*YUV* enum value (look it up in OpenCV docs).
  • hint (INT) - conversion hint, 0 is fine.
  • dst (NPARRAY, optional) - out-parameter; leave unconnected.
  • nparray (NPARRAY, output) - the converted image.

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 model downloads. Watch the package name (opencv-contrib-python, not the README's swapped version), and if you see Cannot import name 'guidedFilter', you've got conflicting OpenCV installs - the README links the fix.

One practical note if you do feed it camera frames: the two planes have different sizes (chroma is downsampled in NV12), so both inputs must be genuine half/half-plane pairs, and only batch_size==1 images are supported, as with the whole pack.

Categoryimage/OpenCV

Inputs (5)

NameTypeDefaultDescription
src1NPARRAY
src2NPARRAY
codeINT
hintINT
dstoptNPARRAY

Outputs (1)

NameTypeDescription
nparrayNPARRAY