OpenCV pollKey_0
OpenCV pollKey_0 — the most useless node in this pack, and why it exists
- int
I'll be straight with you: pollKey_0 is the node you will never use, and understanding why is actually a useful lesson about how this pack works.
pollKey_0 is a port of cv2.pollKey(), an OpenCV function that checks whether a key has been pressed in an OpenCV window and returns the key code (or -1 if nothing was pressed). It's a HighGUI feature - it belongs to OpenCV's graphical-window system, the same world as namedWindow, imshow, and waitKey. It has no inputs, no options, and one output: an int.
And here's the thing: ComfyUI has no OpenCV windows. Nobody is calling imshow in your workflow. So pollKey_0 has no window to poll, nothing ever gets pressed, and it will dutifully return -1 forever. There is no scenario in normal ComfyUI use where it does anything useful.
Why it's here at all
The opencv-comfyui pack auto-generates a node for every top-level standalone function in OpenCV's Python API - around 635 of them after filtering out the unsupported ones. pollKey is a top-level function, so it got a node. That's it. The generator doesn't ask whether a function makes sense inside a node graph; it just wraps whatever exists. The author, Gerold Meisinger, was upfront about this when he shipped the pack on r/comfyui in April 2025: the nodes are auto-generated, "ugly and complex to use", and - his own words - best for "small and quick transformations", not replicating whole OpenCV apps inside Comfy. pollKey_0 is the extreme case: a GUI utility that got mechanically ported into a graph with no GUI.
This is actually the pack's single most important lesson, better than any troubleshooting tip: not every node in here is meant to be used. Some are junk by construction, and recognizing which ones is part of the skill. pollKey_0 is the canary.
The one legitimate thing you can learn from it
cv2.pollKey is the non-blocking sibling of waitKey. If you were ever going to add real-time keyboard interaction to a Python OpenCV script, that's a separate project that doesn't belong in ComfyUI at all - you'd write it outside the graph. Inside ComfyUI, the honest way to add interactivity is the opposite direction: ComfyUI already has pause/blocking nodes and widget-based controls, and the whole frontend is the "window." Trying to poll a key from inside a headless backend is fighting the architecture.
Install (in case you're wondering)
It's in the pack like everything else: ComfyUI Manager → search "opencv-comfyui", or
cd ComfyUI/custom_nodes
git clone https://github.com/geroldmeisinger/opencv-comfyui
restart, then pip install opencv-contrib-python. No special setup - which only makes the point better. This node needs nothing because it does nothing.
The takeaway
If you landed here hoping for a keyboard-input node: there isn't a good one in this pack, and this isn't it. Skip pollKey_0, and let it be your reminder that a third of an auto-generated pack is filler you should ignore. The useful half of opencv-comfyui - the filters, the math, the geometry - is genuinely handy; just don't expect every one of its 635 nodes to earn its keep. This one's a freebie that should've stayed in the generator's recycle bin.
Inputs (0)
No inputs
Outputs (1)
| Name | Type | Description |
|---|---|---|
| int | INT | — |