OpenCV CV_32FC_0
CV_32FC_0 — the type constant you'll actually need (float32)
- int
CV_32FC_0 computes cv2.CV_32FC(channels) - the OpenCV type constant for a 32-bit float array with N channels. One channels INT in, one int out. Of all the CV_* calculator nodes in this pack, this is the one you're most likely to genuinely use, because CV_32F is the default workhorse depth for real image math in OpenCV. Most of what the corner detectors and filter nodes produce is float32.
The encoding, one more time because it's the whole secret: type = depth + (channels - 1) × 8. CV_32F is depth 5, so CV_32FC(1) = 5, CV_32FC(2) = 13, CV_32FC(3) = 21, CV_32FC(4) = 29.
Where you'd wire it
Any node in this pack with a type or dstType parameter that wants a constant, and you need float32. The clean in-pack example: createHanningWindow_0 takes a type input for its output array, and float is the sensible choice for window math. CV_32FC_0(channels=1) outputs 5 - exactly the CV_32F constant that node wants. That's the pattern: instead of hardcoding type codes from a table you half-remember, let the generator node hand you the number, and keep your graph readable.
This also matches the wider post-processing picture from the KB: when you leave image-space (uint8, 0–255) and go into float math (gradients, corners, filtering intermediates), you're in float32 land. CV_32FC_0 is the constant generator for that land - the one calculator in this family that earns its place next to the actual image nodes.
The spec
channels- INT. 1–4 is the useful range (CV_32FC1=5,CV_32FC2=13,CV_32FC3=21,CV_32FC4=29).- Output:
int- the type constant.
Install
ComfyUI Manager → search opencv-comfyui → install, or:
cd ComfyUI/custom_nodes
git clone https://github.com/geroldmeisinger/opencv-comfyui
Restart. Requirements: opencv-contrib-python, numpy, torch. No model downloads.
Anything to watch?
Sibling awareness: CV_16FC_0 (half float, depth 7) and CV_64FC_0 (double, depth 6) exist too; make sure you grab the right depth. And don't confuse the channels input with the output - the node is asking how many channels, not "which constant." That's genuinely all there is to it. This is the most useful calculator in a family of calculators, and "useful calculator" is not a backhanded compliment - it's a node that removes a whole class of magic-number typos.
Inputs (1)
| Name | Type | Default | Description |
|---|---|---|---|
| channels | INT | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| int | INT | — |