Nodes/opencv-comfyui/OpenCV getVersionString_0
ComfyUI Node

OpenCV getVersionString_0

The one version node you'll actually remember

By geroldmeisinger·Created about a year ago·Updated about a year ago· 35
OpenCV getVersionString_0
    • string

    Of the four version-reporting nodes in this pack, this is the one to reach for. getVersionString_0 has no inputs and one STRING output - the full OpenCV version string of whatever wheel is actually loaded in your ComfyUI environment, something like 4.11.0. No parsing, no assembling pieces, no guessing: one node, one readable answer. If you're ever asked "what OpenCV am I running?" this is the node that answers.

    Why it's the good one

    The pack also ships getVersionMajor_0, getVersionMinor_0, and getVersionRevision_0 as separate nodes - each returns a single integer component. Those exist because the pack auto-generated a node for every top-level cv2 function, and splitting versions into parts is what a C++ developer debugging a build wants. In a ComfyUI graph, that granularity is noise. The string node gives you everything the three integer nodes give you, in one socket, in the exact form the OpenCV docs print. It's the difference between checking the clock and assembling it from gears.

    How it works

    It wraps cv2.getVersionString(), which returns the version baked into the compiled cv2 binary. Two things worth knowing:

    • It reports the version of the installed OpenCV, not the version the pack's nodes were generated against. That mismatch - pack generated on 4.11, you running 4.9 - is a real source of AttributeErrors in this pack when nodes call functions your wheel lacks. This node makes that gap visible.
    • It's a quick sanity check after install. Run it once after adding the pack; if it errors or reports something ancient, your environment has a stale or conflicting cv2.

    Where it fits

    Drop it into any workflow when you're troubleshooting, or leave it out entirely - it's not a pipeline node, it's an instrument. The typical story: a cv2 node throws, you've read that the behavior differs across OpenCV versions, and instead of guessing you add getVersionString_0, note the string, and check it against the OpenCV docs page for the function in question. That's the whole job, and it does it cleanly.

    Install

    Standard for the pack:

    cd ComfyUI/custom_nodes
    git clone https://github.com/geroldmeisinger/opencv-comfyui
    

    or via ComfyUI Manager (search "opencv-comfyui"), then restart. Dependency is opencv-contrib-python - no models, no keys, nothing extra to download. The one environment gotcha, worth repeating: if startup throws Cannot import name 'guidedFilter' from 'cv2.ximgproc', you've got duplicate OpenCV packages fighting; uninstall to a single wheel, restart, and use this node to confirm you're back on a sane version. In a pack of rough auto-generated wrappers, this is a rare one that's simple and does exactly what it says.

    Categoryimage/OpenCV

    Inputs (0)

    No inputs

    Outputs (1)

    NameTypeDescription
    stringSTRING