OpenCV setLogLevel_0
Make OpenCV shut up, or make it talk
- int
setLogLevel_0 sets OpenCV's global logging verbosity and returns the previous level. That's the whole node. It exists because this pack mechanically generates every top-level cv2 function, and cv2.setLogLevel happens to be one of them.
When does it matter? OpenCV is chatty in a way that ranges from mildly annoying to genuinely useful. Some builds print warnings about missing optimizations or deprecated calls on startup; others stay silent until something actually breaks. If you're running a headless ComfyUI and the console is drowning in OpenCV noise from other nodes, you can quiet it down. If you're debugging why a filter behaves strangely, cranking the level up lets you see what OpenCV thinks it's doing. It's a debug valve, not a workflow feature.
The mechanism is a one-liner: cv2.setLogLevel(level) sets the process-wide verbosity and returns the old value. The levels are integers, and the ones you'll actually use:
6- WARN (the default; prints warnings and above)7- INFO (shows normal operation messages)5- ERROR3- SILENT (this is the "make it shut up" one)
The int output is the previous level, which is a neat trick: you can read it, store it, and restore it later. In practice almost nobody bothers - you set the level once and forget it.
The important caveat: this is a global, process-wide setting. It's not scoped to the node or the subgraph. In ComfyUI, node execution order isn't guaranteed to match the visual layout, so if you set SILENT on one branch and something downstream relies on logging from another branch, you can't be sure which ran first. Treat it as "set once near the start of your workflow" and don't build logic around it.
Installation is the pack standard: ComfyUI Manager → search "opencv-comfyui", or clone https://github.com/geroldmeisinger/opencv-comfyui into ComfyUI/custom_nodes and restart. Requirements are opencv-contrib-python, numpy, and torch - you already have the last two. The one startup trap specific to this pack: Cannot import name 'guidedFilter' from 'cv2.ximgproc' means two different OpenCV packages are fighting; uninstall the extra one.
Honest take: this node is a convenience at best. For most people, the console output from OpenCV is a non-issue - you'll never wire this into a workflow, and if the noise bugs you, a single cv2.setLogLevel call in a custom node or the ComfyUI launch script does the same thing without adding a node to the graph. Grab it when you're debugging an OpenCV-heavy workflow and want visibility, then delete it when you're done.
Inputs (1)
| Name | Type | Default | Description |
|---|---|---|---|
| level | INT | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| int | INT | — |