π Threshold (jov)
The older build of Jovimetrix's segmentation workhorse
- pixels
- image
- mask
Thresholding is one of those image-processing moves that sounds academic until you need it: you want to turn a noisy grayscale or color image into a clean binary yes/no - pixel is "in" or "out". That's what this node does, and it's the older lowercase build of the one the current pack ships as THRESHOLD (JOV) π. If an old workflow references "Threshold (jov)", this is it: same OpenCV machinery, a slightly different face.
It's a required-input node, which is the tell of the older design. pixels takes the image or mask, and then the thresholding controls are right there: op (BINARY, TRUNC, or TOZERO), adapt (ADAPT_NONE, ADAPT_MEAN, or ADAPT_GAUSS), threshold (0β1, default 0.5), block (the adaptive block size, default 3), and const - the OpenCV C constant subtracted in adaptive mode (default 0, -1 to 1). Then optional width/height and a mode (NONE/FIT/CROP/ASPECT) to resize, plus invert to flip the result. Outputs are image and mask, so the binary result doubles as either.
If you've touched OpenCV, every one of these is familiar under another name. BINARY makes pixels above the threshold white and everything else black - the classic segmentation. TRUNC caps bright pixels at the threshold instead of flipping them, and TOZERO zeroes everything below the threshold while leaving bright pixels alone. ADAPT_MEAN and ADAPT_GAUSS swap the global threshold for a locally-computed one, which rescues images with uneven lighting; block sets how big that local neighborhood is, and const nudges the cutoff. Rule of thumb: global BINARY at ~0.5 for clean inputs, adaptive when the lighting varies.
The real-world use is building masks from luminance. Threshold a portrait to separate the bright background from the subject, feed the mask into compositing or inpainting, then clean it up with a morphological node if it's noisy. TRUNC and TOZERO are the ones people skip, and they're genuinely useful - TOZERO in particular is a soft "keep the highlights" pass.
The practical difference from the current THRESHOLD node: this one requires its inputs up front, carries explicit width/height and mode controls, and exposes the adaptive const. The modern version is list-friendly, keeps adapt/op/threshold/block/invert, and drops the resize plumbing (you'd resize separately). Both run the same underlying OpenCV threshold/adaptiveThreshold calls.
Since it's legacy, current Jovimetrix installs won't have it under this name - swap in THRESHOLD (JOV) if your workflow complains. To install the pack at all:
cd ComfyUI/custom_nodes
git clone https://github.com/Amorano/Jovimetrix.git
pip install -r Jovimetrix/requirements.txt
or ComfyUI Manager β "Jovimetrix", then restart. Dependencies are the shared set (numpy, opencv-contrib-python - that's where the thresholding lives - Pillow, matplotlib, cozy-comfyui helpers), no model downloads. And the usual history note: the pack split several node families into separate Jovi_* packs in v2.0, which is why legacy names pop up missing in old workflows.
Inputs (10)
| Name | Type | Default | Description |
|---|---|---|---|
| pixels | * | β | |
| op | COMBO | BINARY | 3 options: BINARY, TRUNC, TOZERO |
| adapt | COMBO | ADAPT_NONE | 3 options: ADAPT_NONE, ADAPT_MEAN, ADAPT_GAUSS |
| threshold | FLOAT | 0.500β1 | β |
| block | INT | 31β101 | β |
| const | FLOAT | 0.00-1β1 | β |
| widthopt | INT | 25632β8192 | β |
| heightopt | INT | 25632β8192 | β |
| modeopt | COMBO | NONE | 4 options: NONE, FIT, CROP, ASPECT |
| invertopt | FLOAT | 0.000β1 | β |
Outputs (2)
| Name | Type | Description |
|---|---|---|
| image | IMAGE | β |
| mask | MASK | β |