cv2.ocl.haveOpenCL
One boolean about your OpenCV build
- bool
This node takes no inputs, shows no picture, and outputs one BOOLEAN. It answers a single question: does this OpenCV build have OpenCL available at runtime?
You're reading this because you found it in the node menu and wondered what it was for, so here's the honest answer: it's a diagnostic, and the reason it's here at all is that this pack auto-generates a wrapper for every function the installed cv2 exposes - including one-line capability probes like this one. cv2.ocl is a small submodule from opencv-contrib, and all four of its functions in the pack (haveOpenCL, useOpenCL, haveAmdBlas, haveAmdFft) are queried the same way: drop the node, run anything, read the boolean.
What the answer actually means
OpenCL availability is two conditions stacked. The wheel has to have been built with OpenCL support, and there has to be a working OpenCL runtime (ICD loader plus a platform driver) on the machine. The opencv-contrib-python-headless wheel the pack pins is a general-purpose build; whether haveOpenCL returns true on your box depends on your drivers, not on ComfyUI. A headless server with no OpenCL ICD installed will report false even though the build supports it.
Why you might care: when OpenCV can use OpenCL, its transparent API kicks in. Supported operations get offloaded to the OpenCL device even when you hand OpenCV an ordinary numpy array - that's the entire point of the T-API, and it means ops inside this pack can quietly run on a GPU without any node asking them to. The catch is the host↔device round trip on every call, and the fact that on a ComfyUI box the OpenCL device is usually the same card torch is already using (or a weaker integrated one). So "true" is not automatically good news.
The honest verdict for a ComfyUI user: it's a fact worth knowing about your install, not a switch worth chasing. If a cv2-heavy workflow is oddly slow and haveOpenCL is true, that's a plausible suspect. If it's false, nothing in this pack got slower because of it.
Reading it usefully
The output is a plain BOOLEAN, so wire it wherever booleans go: a note, a log, or a switch that gates an OpenCL-only path. Because the node has no inputs, the answer is a constant for the session - it's evaluated once and cached like any other no-input node, so don't put it in a loop and expect it to change.
For the fuller picture, use the pack's curated CV Build Information node instead. It prints OpenCV's whole build banner with filesystem paths redacted, reporting Eigen, non-free, OpenCL and CUDA availability - a much better first stop than four separate booleans. The raw probe is what the generated layer gives you; the curated node is what the author built on top.
Install
ComfyUI Manager → search ComfyUI CV → install → restart, or:
cd ComfyUI/custom_nodes
git clone https://github.com/bmad4ever/comfyui_cv
pip install "opencv-contrib-python-headless~=5.0.0.93"
Python ≥ 3.12, ComfyUI on the V3 node API. cv2.ocl lives in opencv-contrib, so this node only exists if your installed wheel is a contrib build. That's the one install mistake that matters for it: installing plain opencv-python-headless over the contrib wheel silently removes the contrib submodules - and every contrib node here, this one included, disappears from the menu. The pack ships tools/repair_opencv_contrib.py --check (and --apply) to diagnose and fix exactly that.
Inputs (0)
No inputs
Outputs (1)
| Name | Type | Description |
|---|---|---|
| bool | BOOLEAN | — |