Nodes/opencv-comfyui/OpenCV convertFp16_1
ComfyUI Node

OpenCV convertFp16_1

ConvertFp16_1 — the twin nobody needs to distinguish

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

convertFp16_1 is the second numbered overload of cv2.convertFp16, and like every _1 twin in this pack, it's byte-identical to its _0 sibling in the generated code. OpenCV's Python type definitions list the function twice - once for a plain MatLike array, once for a UMat - and since this pack collapses all of those into the same NPARRAY socket, both came out the same node. Your only real decision is "did I read the _0 article?" If not: start there.

The short version of what it does: src (NPARRAY) in, nparray out, converting a float32 array to 16-bit float to halve its memory footprint. There's also an optional dst input which is an OpenCV out-parameter you should generally leave alone - let the node allocate the output. It's a dtype utility, not an image filter. Don't feed it a photo and expect a viewable result; this is the kind of node where "the output isn't an image" bites you on the way back through Nparrays2Image.

Install and gotchas, same as the pack

cd ComfyUI/custom_nodes
git clone https://github.com/geroldmeisinger/opencv-comfyui
pip install opencv-python-contrib

Or use ComfyUI Manager and search opencv-comfyui. Restart after; no models to fetch.

The standard pack rules apply everywhere: OpenCV nodes eat numpy NPARRAYs, so your Comfy image goes through Image2Nparray first (batch size 1 only - use ImageFromBatch if you hit the batch-size error), and anything you want back on screen comes through Nparrays2Image. And the invalid syntax (<unknown>, line 0) error you might see elsewhere in this pack is the string-input parser choking on a composite parameter - doesn't apply here since this node has no string inputs, but it's worth knowing before you panic about a workflow you loaded.

So, do you need this node specifically? Almost certainly not this one - if you need half-precision conversion you'd grab _0 or _1 by reflex. They're interchangeable, the author of the pack numbered them because that's what auto-generation does, and the README happily admits the whole thing is ugly by design. Don't lose sleep over the suffix; wire whichever node your workflow already has and move on.

Categoryimage/OpenCV

Inputs (2)

NameTypeDefaultDescription
srcNPARRAY
dstoptNPARRAY

Outputs (1)

NameTypeDescription
nparrayNPARRAY