Nodes/ComfyUI CV/cv2.getVersionRevision
ComfyUI Node

cv2.getVersionRevision

It returns 0, and the 93 in the wheel name isn't it

By bmad4ever·Created 4 months ago·Updated 14 days ago· 1
cv2.getVersionRevision
    • int

    Fourth in the version family, and the one guaranteed to confuse somebody: no inputs, one int out, and on the recommended install it's 0. Not because anything is wrong - because OpenCV's own version has three components and you're looking at the third.

    The thing to get straight

    This pack tells you to install opencv-contrib-python-headless~=5.0.0.93. It also says it's curated against OpenCV 5.0.0.93. So you add a version node, expecting 93, and get 0. Both numbers are correct:

    • 5.0.0 is the library's version. Major 5, minor 0, revision 0.
    • .93 is the PyPI package build counter - how many times that OpenCV release has been re-uploaded as a wheel. It's packaging metadata, invisible to the library itself.

    Wheels follow this pattern consistently (you'll see 4.10.0.84, 4.12.0.88 and so on in older installs), which is why "the version of OpenCV you have" and "the version of the wheel you installed" are two different facts. When someone in a thread says "I'm on 4.10.0.84" they're quoting pip; when the library reports, it says 4.10.0.

    So: cv2.getVersionString → 5.0.0. cv2.getVersionRevision → 0. Nothing to fix, and no need to go hunting for a wheel with a matching revision.

    What it's for, then

    Same as its siblings: a diagnostic that costs nothing to run. The revision digit moves for patch releases - bug fixes, security fixes, no new API surface - so it's the least interesting of the three if you're debugging missing nodes (see major and minor for that). It's genuinely useful in one narrow case: two machines on the same minor OpenCV but behaving differently, where a patch-level difference is the last remaining explanation. That's a rare investigation, and when it happens you'll be glad the number was already on the canvas.

    int output, so the reading pattern is the usual one for this pack: Inspect CV Data (it takes any input type and emits a text summary) into core's Preview as Text, or into a converted integer widget if the number should drive something.

    Install

    pip install "opencv-contrib-python-headless~=5.0.0.93"
    

    ComfyUI Manager → search ComfyUI CV, or:

    cd ComfyUI/custom_nodes
    git clone https://github.com/bmad4ever/comfyui_cv
    

    Restart ComfyUI afterwards. Python ≥ 3.12 and a recent ComfyUI (V3 node API) are required - everything here is generated at import time, so a version of ComfyUI without that API gives you no nodes at all.

    Gotchas

    • Contrib vs non-contrib is the wheel question that actually bites. All four OpenCV distributions share one site-packages/cv2, so installing opencv-python over the contrib wheel empties the contrib submodules and some of this pack's nodes stop appearing. The pack ships tools/repair_opencv_contrib.py - --check to diagnose, --apply to repair - and notes there's no install-time guard for this.
    • The pack's stable-looking 4th number is a pip detail. If you're writing install docs or a Dockerfile for somebody, quoting 5.0.0.93 is correct for pip and meaningless to cv2. Say both when it matters.
    • Don't over-read a 0. A zero revision is normal, not a broken install, and it isn't evidence that a partial upgrade happened. If something's genuinely wrong with the environment, the version major and whether contrib submodules are present will tell you far more.
    Categoryimage/CV/low-level/cv2 G

    Inputs (0)

    No inputs

    Outputs (1)

    NameTypeDescription
    intINT—