CV Build Information
\"Does my OpenCV even have that?\" — asking your build instead of guessing
- info
- has_eigen
- has_nonfree
OpenCV is compiled per-install with a pile of optional features - Eigen, non-free algorithms, OpenCL, CUDA, specific contrib modules - and which ones your wheel has decides whether half the nodes in this pack work at all. This node prints the build banner for the cv2 that ComfyUI actually imported, and turns the two answers you'll actually branch on into booleans.
You'll want it in two situations. Debugging: a node throws an OpenCV error that makes no sense, and the reason is "this distribution was built without that." Reporting: you're writing a bug report for this pack, and the first thing anyone wants is the banner.
It replaces the raw cv2.getBuildInformation wrapper on purpose. That banner is frozen at compile time and quotes the build machine's directories - on a self-built OpenCV it carries your home directory, your username, and your project layout. This node redacts every path and tells you how many it hid.
Inputs
One: redaction. Either hide directories, keep file names (the default) or hide paths entirely, which replaces each path with <path>. Keeping the file names leaves the banner genuinely useful - which compiler, which Python, which libraries, and only where they live is gone. Nothing else in the text is touched.
info is multi-line, so wire it into core Preview as Text rather than a one-line widget:
- read it there, copy it into the issue.
Outputs
info- the redacted banner, as a STRING.has_eigen- true when the build reports "Eigen: YES". This one gates real work: the Eigen-dependent nodes (the BIMEF variants, andximgproc.fastBilateralSolverFilter) raise OpenCV error (-213) on every call when Eigen is absent. The pack's reference build exposesfastBilateralSolverFilterand then fails at run time with exactly that error - the node exists, the implementation doesn't. Branch with an if/else rather than discovering it per run.has_nonfree- true when "Non-free algorithms: YES". Informational, and worth internalising: the pack never exposes a non-free function - they're blacklisted when the node registry is generated - and stockopencv-contrib-python(-headless)wheels are built withOPENCV_ENABLE_NONFREE=OFFanyway. So don't go hunting for SIFT-adjacent patent-era functions here.
The hidden-path count is deliberately not an output; the <path> markers already show it in the text, and no graph could branch on a number like that.
Install
Manager → ComfyUI CV, 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, recent ComfyUI (V3 node API). The pack is curated against opencv-contrib-python-headless~=5.0.0.93; other versions may differ in what's exposed and how it behaves.
The other build question
If nodes are missing rather than erroring, that's usually not a compile flag - it's which wheel won. All four OpenCV distributions share one site-packages/cv2, so a later opencv-python install over a contrib one silently empties the contrib submodules: the nodes disappear from the menus with no error anywhere. The pack ships tools/repair_opencv_contrib.py for exactly this (--check diagnoses, --apply fixes). Run it before you start rebuilding anything.
Inputs (1)
| Name | Type | Default | Description |
|---|---|---|---|
| redaction | COMBO | How much of each path to remove. Keeping the file name leaves the banner informative (which compiler, which python, which libraries - only WHERE they live is gone); hiding paths entirely replaces each one with '<path>'. Nothing else in the text is touched. |
Outputs (3)
| Name | Type | Description |
|---|---|---|
| info | STRING | The build banner with paths redacted. Multi-line; read it with core 'Preview as Text'. |
| has_eigen | BOOLEAN | True when the build reports 'Eigen: YES'. The Eigen-gated nodes (BIMEF, BIMEF2, ximgproc.fastBilateralSolverFilter) raise OpenCV error (-213) on every call when this is false - gate that branch with 'if/else'. |
| has_nonfree | BOOLEAN | True when the build reports 'Non-free algorithms: YES'. The pack never exposes a non-free function (they are blacklisted at generation time), so this is informational. |