OpenCV getThreadNum_0
It outputs a number. It is not useful. That's fine.
- int
Let's be direct: getThreadNum_0 is the least useful node in this pack, and that's saying something for a pack whose README opens with "Expect dragons!" It has no inputs and one output - an INT that OpenCV reports as the current thread number. That's it. No images in, no images out, nothing you can wire into a sampler or a mask.
Why it exists at all
Because this pack is auto-generated from OpenCV's type definitions. The author ran a parser over every top-level cv2 function and wrapped 600+ of them as nodes, with zero judgment about which ones make sense inside a graph editor. cv2.getThreadNum is a real OpenCV API - it returns which internal OpenCV worker thread is executing the call, which is mildly interesting when you're debugging OpenCV's parallel execution in C++. As a ComfyUI node, it's a dead end.
What it would mean if it mattered
In plain OpenCV, getThreadNum() returns an integer identifying the thread that's currently running - thread 0 is the main thread, and the numbers come from OpenCV's internal thread pool (the one setNumThreads controls). You'd use it in multithreaded code to verify parallel branches actually run on different threads. ComfyUI runs your graph on its own scheduling, doesn't expose OpenCV's thread pool, and you have zero control over which thread a node executes on. So even the "I want to verify threading" use case doesn't survive contact with the graph.
The honest framing
This node is a waste of graph space. It computes a number whose meaning you can't act on - the only thing you can do with the output is route the INT into another node's numeric input, and doing so would just inject noise into whatever it touches. If you saw it in your node list and wondered what you were missing: you're not missing anything.
The one thing it's genuinely good for is diagnosing that your OpenCV installation works at all. If this node runs without error, cv2 loaded and the pack's dependency stack is healthy - but so would any node in the pack. Use a version node (getVersionString_0) for that job instead; at least its output tells you something about your environment.
Install
Same pack, same drill: ComfyUI Manager, search "opencv-comfyui", or
cd ComfyUI/custom_nodes
git clone https://github.com/geroldmeisinger/opencv-comfyui
restart, and the pack pulls opencv-contrib-python. No models, no keys, no extra setup - which is the only reason this node's existence is harmless rather than annoying. It's a freebie from the auto-generator, sitting there for the day someone builds a workflow that genuinely wants to know OpenCV's internal thread id. That day is not today.
Inputs (0)
No inputs
Outputs (1)
| Name | Type | Description |
|---|---|---|
| int | INT | — |