ComfyUI CV
Computer-vision nodes for ComfyUI: curated high-level nodes plus auto-generated wrappers for ~470 raw functions of the OpenCV (cv2) library. Built on the V3 node API.
Nodes (763)
Cv2.absdiff, the difference image — and why yours comes out black
Cv2.accumulate is one +=, not a running total
The second-moment accumulator nobody explains
Variance without a second pass
The running average, and the alpha=0 trap
Stop blowing out half the page
Cv2.add saturates — that's the entire point
Crossfade, sharpen, and composite with one node
Make a grey score map readable
256 pixels, and OpenCV does the rest
Turn a 400-point contour into four corners
\"give me a hexagon\", not \"give me fewer points\"
Perimeter in pixels, and the four things it feeds
Draw the arrow, then remember BGR means green is (0,255,0)
Useful, and your output is raw NPARRAY
The matcher under BFMatcher, for when you need the matrix
Smooth the skin, keep the edges, pay the clock
Mask algebra on masks, bit surgery on photos
The boolean that also works on photographs
Union two masks and stop hand-drawing them twice
The mask op that means 'in one, or the other, but not both'
A per-pixel weighted average, for when a hard composite won't do
A mask feather that costs nothing
The one-number answer for 'where does OpenCV think that pixel is?'
Turn any mask or point cloud into a crop rectangle
The same blur as cv2.blur, plus the option to *sum* instead of average
Unwrap a rotated rectangle into its four corners
Stretch one value into a full array — without copying a byte
The covariance matrix, and the flag you have to get right
Dense motion, and the seven numbers that default to 0
Track points between two frames, and know which ones you lost
What your camera matrix actually means in millimetres
Colour tracking that runs in microseconds, and gives up when the subject hides
The edge map every 'canny' ControlNet was trained on
Run the hysteresis on derivatives you computed yourself
Turn 'how much left and how much down' into 'how far and which way'
The gamma node with the same name as the other gamma node
Throw out the calibration shot before it poisons the fit
Does this machine actually have AVX2, yes or no
Find the NaN before it paints your image black
The cheapest way to put a ring on a frame (and build a mask)
Trim a segment to a box, and answer \"is this visible at all?\"
Recolour one region without leaving the pixel layer
Turn \"which is bigger\" into a mask you can actually use
Score two histograms, and mind which direction \"better\" is
The matrix half you didn't compute
Chain two camera poses into one (plus eight Jacobians you'll ignore)
For a point here, the line it must lie on there
Score how well two images line up (no warping, just a number)
Count and label the blobs in a mask
The same blobs, faster — if you can name the algorithm
Blob count, boxes, areas and centroids in one pass
Stats plus an algorithm picker, minus the good names
How big is this shape, really
Turn float remap maps into the fast fixed-point pair
Get real pixels back out of homogeneous maths
Put the 1 on the end so matrices can act on your points
The node that makes float edge maps visible (and why it's wrong sometimes)
The rubber band around a point set
Find the dents — the geometry behind finger counting
The honest way to pad an image inside the graph
One image, one mask, hard edges, no blending
The eigen-decomposition hiding under every corner detector
Cv2.cornerHarris hands you a score map, not a list of corners
The one-number corner test (and why it beats Harris)
Turning pixel corners into sub-pixel corners
Fixing colour fringing, if you have a calibration
Fixing correspondences that only *almost* line up
The mask-coverage meter you'll use more than you expect
The window you multiply an image by before phase correlation
A math node you'll rarely need, and that's fine
What UI is OpenCV built against? (in a headless build, nothing)
Building the half-float type code OpenCV keeps asking for
The type code behind fast fixed-point remapping
The type code for depth maps and stereo disparity
The type code that stops your Sobel filter truncating
The type code behind label maps and index arrays
Unsigned 32-bit, the newest and least useful type code here
Double precision, for the maths that actually needs it
Signed 64-bit integers, and why this node exists at all
The 64-bit-unsigned type code, and why it's a signpost
Signed 8-bit, and almost nothing wants it
The decoder ring for OpenCV's type codes
Build an OpenCV type code from depth + channels
Gray, HSV, and the two traps nobody mentions
When a codec hands you raw NV12 planes
JPEG's transform, exposed as two toggles
Grayscale that keeps what your eye actually sees
Four candidate poses, one of which is real
Pull K, R and t back out of a camera matrix
Turning a camera's raw Bayer plane into a picture
A depth map in, a point cloud out
3D for just the pixels you asked about
The stitcher's feathering weights, exposed
Local contrast pop from two sliders, no model
The second half of the stitcher's blend
Do these two frames even overlap?
One integer, no inputs, mildly useful
Catch a degenerate matrix before it wrecks your graph
Into the frequency domain without leaving ComfyUI
The mask-grower that eats hairline seams
Every pixel's distance to the nearest edge
Which blob does this pixel belong to?
Divide your image by a blur and the lighting disappears
The reciprocal node, argument order and all
Frequency-domain division, i.e. deconvolution by hand
What a neural net actually wants as input
A five-second answer to 'what is dnn running on?'
The boring answer is the good answer
The node for hardware you don't have
Get a plain array out of an ONNX file
A global switch you probably shouldn't flip
The sanity check that saves your calibration
See where a solved camera pose actually points
Mark a point so you can actually see it
Smooth the skin, keep the eyelashes
Eigenvalues for people who don't want a linear algebra lecture
Real eigenvalues only, and it won't tell you when they aren't
Circles are just a special case, and half-axes will bite you
The fitEllipse shortcut nobody notices
The distance metric you don't need until you really do
The 90s contrast trick your face detector still wants
Shrink a mask the right way (the kernel is the whole story)
Fit a transform to two point sets and get the outliers told on
Registering two 3D point clouds, outliers included
The no-RANSAC overload, and the reflection switch
The 4-DOF fit that doesn't invent shear
Is your calibration shot actually in focus?
When you know the clouds only shifted
It's e^x, and that matters
Pull one channel out, and the BGR/RGB trap waiting in it
Plot landmark points on a face, but you bring the points
Haar face detection in one shot, with no knobs to turn
Read 68 landmark points out of a .pts file
Two numbers in, degrees out (and that's the point)
The classic denoiser, and yes it really is that slow
Denoise in LAB so the colour doesn't drift
Turn four points into a mask (mind the LINE_AA default)
Write the kernel nobody has a node for
Same maths, different door — and a raw output instead of an image
Killing Speckles with cv2.filterSpeckles
Refining Chessboard Corners with cv2.find4QuadCornerSubpix
Cv2.findChessboardCorners in ComfyUI
Cv2.findChessboardCornersSB
Cv2.findChessboardCornersSBWithMeta
Cv2.findEssentialMat (1/3), the One That Wants Your Camera Matrix
Cv2.findEssentialMat (2/3)
Cv2.findEssentialMat (3/3)
Cv2.findFundamentalMat (1/2)
Cv2.findFundamentalMat (2/2)
Cv2.findHomography
Cv2.findNonZero
Cv2.findTransformECC (1/2)
Cv2.findTransformECC (2/2)
Cv2.findTransformECCWithMask
NaN Hunting With cv2.finiteMask
Cv2.fisheye.distortPoints (1/2)
Cv2.fisheye.distortPoints (2/2)
Cv2.fisheye.estimateNewCameraMatrixForUndistortRectify
Cv2.fisheye.initUndistortRectifyMap
Checking a fisheye pose before you believe it
Pose from 3D-2D pairs, the wide-lens version
The fisheye pose solver you actually want
Making two fisheye cameras comparable
Straightening a wide-angle frame
Fix the coordinates, not the pixels
Turning a pile of points into one ellipse
For when your ellipse points aren't evenly spread
The ellipse fit that won't hand you nonsense
The dominant direction through a point set
Mirror an image, a mask or a latent in one node
Flip one axis of the array you're actually holding
The magic wand Photoshop has and ComfyUI mostly doesn't
The smoothing scale knob nobody told you about
Building a fuzzy kernel from your own basis
A denoiser that isn't a blur, and needs no model
The half of the fuzzy transform you can edit
Fuzzy-transform smoothing in one node
The careful version of the one-step fuzzy filter
Rebuild a picture from fuzzy coefficients
The one node in this pack that wants its own output wired back in
A smoother that fits windows instead of averaging them (fuzzy transform, one step)
The fuzzy transform's model of your image, before it's turned back into pixels
An OpenCV helper matrix, exposed because the generator wraps everything
The other half of the fuzzy transform's gradient basis
Turning fuzzy-transform components back into a picture
Noise-robust gradients, from a fit instead of a difference kernel
The fuzzy transform, upgraded so gradients don't come out as staircases
The third inpainter, and the one with the backwards mask
Gaussian blur with the knobs core ComfyUI hides from you
Actual matrix multiplication inside a ComfyUI graph
Three points in, one warp matrix out
The ellipse function OpenCV 5 added and nobody has heard of
\"Why is this node fast for them and slow for me?\" — one string that answers it
Timing a node from inside the graph
The one-value node that explains why two identical installs disagree
The cheap camera matrix you need before you can undistort anything
Sobel is two 1-D filters glued together — here they are separately
\"Make this label 40 pixels tall\" — the number putText never gave you
A kernel that finds stripes at exactly the angle and spacing you pick
The blur kernel you only need when GaussianBlur isn't enough
What OpenCV thinks your CPU can do
How many cores OpenCV is willing to use
The thread count OpenCV is actually running with
Pad before you FFT, or pay for it
The answer to black corners after undistort
Four points in, one homography out
Crop at x=100.5 and get away with it
The 2×3 matrix behind every rotate-this-image node
The kernel factory every morphology graph needs
Measure the label before you draw it
The answer is zero, and that's fine
A stopwatch you have to read in pairs
The denominator that makes getTickCount mean something
Crop your disparity map before you trust it
Is this machine on OpenCV 4 or 5?
The digit that explains a missing node
It returns 0, and the 93 in the wheel name isn't it
The five-second check that explains a broken node pack
The corner detector behind every tracking pipeline
Cv2.goodFeaturesToTrack (2/2)
Cv2.goodFeaturesToTrackWithQuality
The classic CV answer to \u201ccut this thing out\u201d
Is there anything in this mask? cv2.hasNonZero, the cheapest branch in your graph
Cv2.HoughCircles for wheels, coins and dials
Circle detection with the confidence column attached
Cv2.HoughLines (and why you probably want HoughLinesP)
The Hough transform you actually want for drawing and counting
Fit a line through a pile of points, not a picture
Line detection that tells you how sure it is
Seven numbers that recognise a shape after you rotate it
Turning DCT coefficients back into an image
The inverse FFT, and the DFT_SCALE tick everyone forgets
Flatten a glare spot without repainting the whole frame
When the image arrives as bytes, not as a file
The fastest way to ask \u201chas this image changed?\u201d
Two hash lengths, one dropdown that changes everything
The one hash that doesn\u2019t care about rotation
Hashing the edges, for when \u201cclose\u201d isn\u2019t close enough
The perceptual hash you should reach for first
The hash that survives a rotation, and reads its score backwards
The reverse lookup that gets you from the clean image back to your lens
Build the lookup table once, fix the whole video with it
For dust, scratches and logos — the fix you should try before you spend a diffusion pass
Turn 'keep pixels in this range' into a mask — and the hue-wrap trap that comes with it
Gluing single channels back into a colour image (the pack does it in its own Wiener filter)
The summed-area table, or 'how to average a rectangle in constant time'
Two summed-area tables, so local variance is also free
Two tables and a tilted one — the node for Haar-feature archaeology
Stop guessing exposure numbers, let the frame set its own range
The exposure fixer that raises an error on a stock install
Same Eigen wall as BIMEF, but this time you pick the exposure ratio
A tone curve you draw with two points
The exposure knob that doesn't wash out your whites
One node, no settings, and a very strong opinion about shadows
How much do these two shapes actually overlap?
It inverts a matrix, not your image — and that trips up everyone who googles it
Going backwards through a warp without rebuilding the matrix by hand
The one-bit answer that stops your geometry nodes from lying to you
Palette, clusters and grouping — the workhorse the pack builds three subgraphs around
The edge map that comes back pure black until you fix ddepth
Draw on an IMAGE or MASK without leaving ComfyUI (and yes, that color is BGR)
A debug visualiser for LINEMOD's quantised depth bins
For HDR and spectra, not for slapping a 'log look' on 0-255 pixels
The whole tone curve, for the price of one table lookup
Turning a Sobel pair into one gradient map
The one node in this pack that isn't about images at all
Shape similarity that ignores size, rotation and position — on purpose
You get a score map, not a match — and that's the point
Jacobians of a matrix product, for the three people doing this by hand
Per-pixel maximum, a.k.a. the Lighten blend mode (not the max of your image)
The fastest sanity check in the pack — and yes, those numbers are BGR
A mode-seeking search window, and the rectangle it lands on
The two numbers a colour-match pass is actually built from
The salt-and-pepper killer, and the blur that doesn't smear your edges
Per-pixel minimum, the Darken blend mode and your cheapest mask intersection
The rotated box that fits your contour, angle quirks included
Centre and radius of the smallest circle around your points
Fit exactly k corners around your points (OpenCV 5 only)
Three corners that contain everything, plus the area it cost
Find the extreme pixel, then get its coordinates
24 numbers that describe a blob (and why the output isn't a list)
Open and close are the mask hygiene you keep forgetting
Which way is it moving, in degrees
Turn 'when' into 'which way'
An image that remembers when things moved
Multiply in frequency space (this is how convolution gets fast)
The scalar multiply you'll actually reach for
The Gram matrix in one node
How big is this array, as one number
The difference metric for two arrays
Two different nodes wearing one name
Does your OpenCV have the AMD BLAS extension?
The sibling of a node almost nobody needs
One boolean about your OpenCV build
Is OpenCL switched on, not just available?
Rectify a fisheye without the edge-pinching
Check your fisheye calibration by projecting into it
Fisheye pair in, 3D point cloud out
Two inputs, two outputs, and an honest caveat
Flatten a 360 mirror-rig frame into something you can actually look at
The raw wrapper exists, and it's still not the node you want
Dense motion between two frames, with only five knobs
The same SimpleFlow, now with all fifteen knobs
Track a few hundred points, get a full motion field
A threading knob, not an image node
The one-line fix for the NaN that just ate your depth map
Rebuild the original data from its principal components
Find the axes your data actually lies along
Keep 99% of the variance instead of counting components
PCA with the eigenvalues attached
Eigenvalues, and let the variance pick the component count
Turn your data into its principal components
Line-art and colour-pencil looks in one deterministic node
Push points through a homography instead of resampling an image
The angle of a vector field, when you only have the components
Sub-pixel shift between two frames, in one FFT
OpenCV 5's beefed-up version, with no confidence score
Is this point inside my shape, and by how much
Angle plus magnitude, back into x and y
Cv2.pow is your gamma curve — and the uint8 clipping that comes with it
Stress-test your PPF pose before the scan does it for you
The pack's one node that asks you to type a file path
A corner map, not corners — and the ksize that must not be 0
Put a 3D point where the camera would see it
Same projection, seven outputs, one shrug from the docs
One number for 'how close are these two images', and how to read it
Burn text into a frame — and the two defaults that make it invisible
The half-size step you build pyramids with, not the resizer you want
The flatten-everything filter, and the one input that makes it slow
It doubles the pixels, it does not sharpen the image
Gaussian noise you can actually reproduce — if you seed it right
Shuffle a list of points or indices, not a picture
Uniform noise and random test fields, bounded by two array inputs
Turning matched search lines into points you can solve a pose with
The debug picture that tells you why your pose refinement failed
See the lines RAPID is looking along — and why it found nothing
Project your mesh into the frame and see if the pose is a lie
Where RAPID's silhouette samples come from
The strip of pixels RAPID searches along, as an array
The edge-search step nobody can spell
One pose-refinement step of OpenCV's model tracker
Relative camera pose from two calibrated views
Decompose an essential matrix you already have
The uncalibrated shortcut, and when it lies to you
The overload that triangulates while it decomposes
Draw a box from two corners, in the right colour order
X, y, width, height — the variant detectors actually give you
Two rectangles, one number
Collapse a matrix to a row or a column (and don't overflow it)
Which column is the brightest one?
The same trick, for the darkest line
Put the depth sensor's map on the RGB camera's grid
The one warp behind undistortion, rectification and every map node
Tile an array — the cheapest node in a point-cloud pipeline
Turn disparities into an XYZ map you can actually use
Millimetres to metres, and why your depth PNG lies
Dsize, fx/fy, and the one interpolation choice that matters
Rvec to matrix and back, the conversion everything else assumes
The only warp that doesn't resample anything
Did Those Two Tilted Boxes Actually Overlap?
The QA Number That Tells You Your Matches Are Rubbish
Alpha×A + B, and Why the Default alpha of 0 Looks Broken
The 3×3 Gradient That Doesn't Lie About Edge Angles
Kill the Seam on Your Composite Without Touching a Model
Blur and Sharpen for O(k) Instead of O(k²)
The Neutral Matrix Your Math Chain Starts From
Rate-Converting a Signal Inside a ComfyUI Graph
Finite Differences Done Right (and the ddepth Setting Everyone Gets Wrong)
Solving Ax = B Inside Your ComfyUI Graph
Real Roots of a Cubic, in Closed Form
A Real Simplex Solver, Hiding in Your Node Menu
The Same LP Without the Tolerance Knob
Where Is That Object, Actually? (Pose From Points)
Pose Estimation That Survives Your Bad Matches
Polish a Pose You Already Roughly Have
Pose Refinement With a Gain Knob
Real Roots of a Polynomial of Any Degree
Ordering Rows and Columns Without Leaving the Graph
Rank Things Without Losing Track of Which Is Which
Both derivatives in one call, and why your preview is black
Local energy in a box, and the depth setting that ruins it
Cv2.sqrt is a gamma curve in disguise — and a quantizer if you feed it an IMAGE
Gaussian-looking blur at box-blur speed (and it eats LATENTs)
The step between a calibrated stereo pair and a depth map
Rectifying a stereo pair you never calibrated
The painterly filter that runs in milliseconds and needs no model
Saturated difference, and the one version that won't wrap around on you
Sum every pixel, get back a Scalar you can actually reuse
The solve step that turns an SVD into an answer
The singular values are the interesting part
Keep the edges, delete the texture
The one node that turns an image into a decision
Threshold only inside the region you care about
One number that tells you if your matrix is sane
Not a warp, a channel mixer — and the name fools everybody
A mirror across the diagonal, not the 90° rotation you meant
Two views in, 3D points out (and a 4-row array you have to divide)
Straighten the lens, and remember it doesn't crop for you
Fix the coordinates, keep the pixels
Fix lens distortion when you only have points, not pixels
The ComfyUI node that answers one question and does nothing else
The left-right check SGBM runs inside itself, exposed for your own maps
Rotate, scale and shear — and yes, you can warp a latent
Reproject an RGB-D frame through a rigid camera move (OpenCV 5's deep end)
The homography node, and what it's actually good at
Unwrap a circle into a straight line (and why that's useful)
Separating blobs that are touching
The guided smoother that uses a second image as its opinion
The one node in this pack the author tells you not to use
Smooth the texture, keep the shape
Template matching that doesn't throw away the colour
Put a number on how wrong your depth map is
Two disparity maps, one number
Turn an edge map into a fixed number of points
A local covariance map, for people who need one
The doorway into colour Fourier, which almost nobody walks through
Edge-preserving smoothing that doesn't care how big sigma is
Two nodes share this name and they are not the same algorithm
The node that always raises an error, and why
Flatten a photo without wrecking its edges
FastHoughTransform gives you an accumulator, not lines — here's what to do with it
Detect circles that aren't quite circles
Compare shapes that are rotated, rescaled or just drawn sloppier
Making a stereo disparity map actually viewable
An edge detector that doesn't get slower when you smooth more
The vertical half of the Deriche gradient pair
The mask-feathering tool you already have, with the real parameters
Denoise one image using another image's edges
For when you want flat regions with genuinely sharp edges
The threshold that survives a badly lit photo
The 'make this shape canonical' maths node
The quaternion conjugate, i.e. how you turn a multiply into a match
A Fourier transform for colour images that actually treats colour as one thing
The quaternion product, which is how you convolve a colour image
Keep the phase, throw away the magnitude (in colour)
Find how far a scan is tilting, without guessing angles
Smoothing that knows what size of detail it's removing
Turn a fat blob mask into a one-pixel skeleton
Rotate and rescale a silhouette using Fourier descriptors
The denoiser that won't eat your edges — if you feed it a guide
ApplyChannelGains ships with the gains at 0 — i.e. it hands you a black image
It wants to know how noisy your image is, and it means it
Read the mask twice, it's the opposite of cv2.inpaint
The overload where you pick the colour space the brush mixes in
The same brush, one fewer knob — here's when to pick it
Pick an annotation colour that can't hide in the picture
The rigid fit that tells you when rigid was the wrong answer
The first thing every hand-held exposure bracket needs
When you don't want the frames negotiating with each other
Drag two images into alignment and get the warp for free
Click anchors onto a 3D model, in its own coordinate frame
Click a seed, get a mask — the node most graphs secretly need
The one-wire bridge into 470 low-level OpenCV functions
Add the lens defect that makes a render look photographed
The other half of the CCM pair — and the easy half
How to find the motion that isn't the moving thing
How a numpy table becomes something ComfyUI can crop
The bridge that turns one array into fifty graph executions
Get your measurements out of the graph and into a file
Generating an ArUco / ChArUco target in ComfyUI
CV ArUco Board Pose (Average)
ArUco detection in one node — and the one setting that makes it return nothing
Drawing detected ArUco markers
One frame, one node, no hidden state
Pull a subject out of static-camera footage without a segmentation model
EAN and UPC decoding in ComfyUI — yes, it reads the curved label on a bottle
Reading BOUNDING_BOX data as plain arrays
Turning boxes into masks (and knowing when not to)
The overlap matrix that scores and matches detections
\"Does my OpenCV even have that?\" — asking your build instead of guessing
Back-projection, and why it powers CamShift
Histogram anything in a ComfyUI graph — including just the part you painted
Get real intrinsics, not a guessed focal length
The case where a half-visible board still counts
The target OpenCV actually recommends for wide lenses
Building a camera matrix by hand
LOAD3D_CAMERA from a calibration
Why the old Haar detector is still in the box
The cast you need before OpenCV will do arithmetic on your arrays
A similarity matrix rendered as a five-pixel image is useless — CV Chart Matrix fixes that
CV Chart Scatter for k-means centres and feature vectors
One score per detected face? CV Chart Series is the chart the numbers always needed
The calibration board that still works when half of it is off-frame
CV Chessboard Flags — stop retyping 512+32 into six different detector nodes
Real lateral-CA fixes need a calibration file, and it has to exist
Turning a raw score vector into 'top-1: golden retriever'
The colour picker that talks to cv2's BGR draw calls
2016 colorization, still the fun kind of wrong
Steal the palette from a reference image
Make a depth map or a score map actually readable
InRange with a hue that knows it wraps at 179
Scribble on the colour, let the node work out the numbers
The sky is whatever runs off the edge of the frame
Chaining camera poses into a trajectory, with one number monocular vision can't give you
FAST corners described by SIFT, because OpenCV splits the two
The join that gives you cv2.merge back
One mask in, one mask per blob out
The all-white mask you warp alongside the image
Get a contour out of Contour Land and into cv2's geometry functions
The contrast fix that doesn't hallucinate
The axis flip that quietly mirrors your 3D scene
See what your classifier actually thinks
Synthesize a chromatic-aberration profile on purpose
You can't fix colour by eye — fit a 3×3 matrix instead
40 regions, one node, and a lossless paste back
Mask in, context-padded crops out
Stop guessing what a cv2 node just handed you
B frames out of a cv2 loop? Here's the way back onto the canvas
The one-string node that kills 'wrong dtype' errors
The debugger for a graph that has no printf
See the array, including the NaN pixels
The quadrant swap everyone forgets
One wire for (width, height), no more swapped resizes
Getting cv2 output back onto the canvas
Pushing a cv2 array back into the sampler's world
Turning raw array data into something ComfyUI can mask with
The pre-warp that makes panoramas line up
Author the bitmask once, feed every transform
Getting camera motion out of a homography
You have a camera matrix — here's how to get intrinsics and rotation back out
Freeze any ONNX backbone and turn it into a feature extractor
Scattered points in, mesh out — Delaunay and its Voronoi dual in one node
The two lines of math, and the unit trap
The shape filters that threshold + findContours can't give you
Easier to detect than chessboards, if you set the flag right
The first step to a real color-correction matrix
Picking corner detectors that hand you keypoints, not bare points
ORB, SIFT, AKAZE or BRISK — detect and describe in one node
Canny, votes, and a drawing on the way out
Straight segments with subpixel endpoints and no threshold to tune
Threshold-free region proposals that survive bad lighting
One flags node, many DFT calls — and the one OpenCV scaling trap it fixes
Fills the holes without dragging your edges
Making a holey disparity map dense — with planes, not smears
Heat haze, glass, and wobble from any image's brightness
The preprocessing step every ONNX model needs and nobody documents
Load an ONNX model and run it, in one node
Every output at once, and how to drive a two-frame model
Turning a network's output tensor back into pictures
The boring resize that your YOLO graph silently depends on
Turning a segmentation blob into an actual ComfyUI MASK
Getting the right tensor out of a multi-output ONNX model
See what your prompt turns into before the model does
Cut the cloud before the maths gets quadratic
The debug overlay that plugs straight into HoughCircles
Draw the skeleton, not just the joints
Make Find Contours stop lying to you
Because straight-line fitting lies about round things
Seeing whether your fundamental matrix is actually right
The quiver plot for dense optical flow
Arrows between two point sets, the honest way to check tracking
The two-line sanity check for any feature detector
Name your keypoints so debugging isn't a guessing game
The RANSAC inlier picture that tells you if your homography is real
Showing which end a trajectory started from
Axes under your trajectory, so 3 metres doesn't look like 300
Markers, cluster colours, and why shape beats hue
Outlines, filled quads, and masks from rotated boxes
Bearings out of a shared origin, drawn over the evidence
Actually see the lines Hough found
Burn the number into the picture
Find the text in a photo, boxes not letters
Edges that are already chains, plus the ellipses nothing else finds
Who is this face, and how sure are you?
Get a dial's centre in one node
The identity matrix, i.e. the do-nothing transform
The line detector that can merge its own pieces
Kill the seam where two warped images meet
DISK and SuperPoint keypoints inside ComfyUI
Turn a ring into a disk before you erode it
Keep the round ones, throw away the squiggles
Matching a template, and the mirroring trap nobody warns you about
Stop letting tiny details poison your matches
Pruning the depth points that ruin your view
Keep only the points a second view agrees with
Keep the ticks in the band, not the noise
Throw out the matches RANSAC didn't believe
The fork in the road for every vision pipeline
Two views, one matrix, and a found flag you must read
Teach two photos that they're the same wall
The four corners of your document, without a model
Align two frames by intensity, no keypoints required
The chessboard fit that a pinhole model gets wrong
Straighten the wide lens, and pick your framing
Turn metres into pixels without lying about the scale
One minus sign, and a mirrored point cloud
Stop hand-OR-ing bit values into cv2.floodFill
Warp an image along its own motion (the honest way to interpolate)
Look at your vector field without lying to yourself
The three transpose bits nobody wants to type as integers
Find any shape you can draw, even half-hidden
The number that tells you if your colour fit is any good
Pull the colour matrix out of a fitted model
Cut a subject out with a hint and no model download
The object points solvePnP needs and you can't type
The HDR look without the exposure times
Real linear light, not a displayable image
Four operators, one radiance map, no guessing
Superpixel regions with no model and no GPU
81 numbers per image, and a classifier you can actually train
Perspective as one entry in a longer distortion chain
Point-cloud alignment that will lie to you about how well it did
The blank sheet every remap chain starts from
Run OpenCV on a whole clip instead of per-frame
Four points that let you move a frame's outline somewhere else
Is this the same picture, or just a similar one?
Measuring a shape by how bright it is, not just its outline
Stop eyeballing your upscaler A/B tests
The adapter every OpenCV node in ComfyUI needs
Get one frame out of a stack, without it ever erroring
The one node to press before anything else in the pack
The node that keeps tracking after the detector gives up
One blob, everything else gone
Turn a label map into masks ComfyUI understands
Poking around inside the latent before it becomes pixels
A local LLM running through cv2.dnn, on purpose
Calibrate once, reuse those numbers forever
So your detections say 'dog' instead of '16'
A regression at every pixel, and the matte that falls out of it
The missing link between a mask and every crop node
Get your mask out of ComfyUI's type system and into numpy
Pairing two images' keypoints, and the ratio test that makes it work
LightGlue matching in ComfyUI, plus the normalization nobody tells you about
Shape matching that can tell two shaded discs apart
Template matching that survives the object being a different size
The boring node that makes homography chains work
Turn a 4x4 back into something that can be rendered
Put a broken outline back together
Two scans in, one mesh out (if they're in the same frame)
Get vertices and triangles out of a GLB so OpenCV can use them
The mesh tweak that stops cv2.rapid from drifting
The 180° fix for PPF and ICP
Make your own RAW file, because you can't download one
21 keypoints per hand, straight into your graph
Hand detection that runs through OpenCV's DNN module
De-duplicate boxes from anything, not just YOLO
Get a list of floats back into numpy
Place a model once, in the viewer and the tracker both
Camera calibration for lenses past 180 degrees
Two mirror-ball photos in, a point cloud out — the whole omnidirectional depth pipeline in one node
A 360 mirror shot isn't a photo until you pick a projection
Set your optical-flow flags once, then fan them out to every flow node in the graph
The two dense-flow methods with no knobs and a real niche
DIS is the dense-flow node you should reach for first
Farneback flow, and why the raw cv2 wrapper for it is unusable
RLOF is the optical-flow node that survives an exposure change
The accuracy reference for optical flow, priced in seconds per megapixel
See your masks before you trust them — color every one differently, in one node
Paste a table, get an array — the return leg of 'CV Array To Text'
You parked the model by hand — now get that placement into the graph as data
Put the crops back where they came from — no policy, no fuss
Put THIS picture THERE — correspondence-driven warping and compositing
HWC to CHW without writing numpy in your head
Sub-pixel shift in one FFT — the laziest good registration there is
Match exposure between two shots — and get a free 'nothing changed here' mask
Pull one number out of an array — 'the angle of the hand with the largest radius'
Pinch and stretch a frame without a lens — a border-anchored remap, per axis
Turn a column of numbers into an image you can actually save
Did your registration actually work? Median nearest distance is the honest answer
The node that stops PPF lying to you
Type coordinates, get geometry the cv2 nodes accept
The adapter between cv2's output and the contour nodes
Turn a bunch of points into bearings around a centre
Bearings back into pixels
Barrel, pincushion and lens warp you can compose
Rvec and tvec into something 3D tools understand
Find a 3D model in a scene with no initial guess
Load a cv2.ml model and classify in one step
AR overlay that actually lines up
One point set, a whole tracked clip
A flat look at a 3D cloud
When OpenCV's detector misses the code but you can see it
Read every QR code in a photo, no models required
Generate scannable QR codes, correctly spaced
The target rectangle for a document scan
Straighten a photographed page, or paste onto a screen
Grade an image with nothing to compare it to
The 36 numbers behind the score
Score a parameter sweep against one reference
The stereo matcher with no disparity range to get wrong
Fake a lens — or undo one — with four numbers
A labelled toy dataset with zero downloads and no VRAM
An edge tracker, not a detector — and that's the whole catch
The silhouette and depth you actually wanted from a 3D render
Monocular geometry gives you a direction, never a distance
One row per region — the flat-poster trick, and much more
One representative per cluster, and the clock-hand trick
Mean and median both lie — use the mode
Polish a flow field you already have
Turn a mask into a spreadsheet
Define the column list once, reuse it everywhere
The 3D counterpart of findHomography
The map that outputs zero, and why that's not useless
The boring node that four other nodes won't work without
A subject mask with no model file and no download
Look up this map where the features are
Calibrate once, then never again
Train once, predict forever, no Python node needed
The tiny constant-vector node the raw cv2 wrappers can't live without
When the box you found is in the wrong coordinate space
Your warp works, it's just at the wrong resolution
Multiplying keypoints by a number, and why you keep needing to
'give me the blob that's under this pixel'
Stop filtering by area, just ask for the biggest one
Florence-2 and ViT-GPT2 driven through cv2.dnn
The seed node that has to sit on a wire
Face recognition in ComfyUI without the InsightFace install
Matching shapes when 'similar' isn't a moment
The shape measurements Hu moments throw away
Turn a fat blob into a one-pixel centerline
Numpy slicing as a node, one axis at a time
One crop policy, every crop node obeying it
Where is this chessboard in 3D space?
The pose problem has more than one answer
Getting x and y out of a point so you can actually use them
Unpack a size, a point, or a box into four sockets
Turning a list of arrays into one batched array
Building a labeled training set out of feature arrays
The before/after strip node (and a contact sheet trick)
Get R and T Right the First Time
The Circle Grid Exists Because a Chessboard Looks the Same Upside Down
Already Have Calibration in a CSV? Skip the Chessboard Entirely
SGBM Is the Stereo Depth Matcher You Actually Want by Default
Faster Than SGBM, Full of Holes, Still Worth Having
WLS Is What Turns a SGBM Depth Map Into Something Usable
Rectify Two Cameras Without Calibrating Either One
Stitch a Batch of Photos Into One Panorama, Inside ComfyUI
Every Panorama Knob OpenCV Hides Behind `cv2.Stitcher`
The Full Stitching Pipeline, Fed One Image at a Time
The Canvas Math Behind a Two-Image Stitch (and Why You Need It)
Panorama From a List, Which Is How ComfyUI Loaders Actually Hand You Images
Stop Editing Pixels, Start Editing Regions
One Flags Value, However Many SVD Nodes You Wire It To
Paint a Label Map With a Lookup Table (No 256-Colour Limit)
Delete Everyone From the Shot
The Magic Number 3 Doesn't Have to Be Your Problem
Type a List of Labels, Get an Array Your Nodes Will Actually Accept
When a Homography Isn't Enough, Bend the Image Through Your Points
Pick Your Thresholding Mode Once, Share It Everywhere
The blob converter that doesn't flatten your float32 first
The corner tracker that tells you when it failed
MeanShift tracking you can actually chain from frame to frame
Train a real classifier in the graph, then check whether it's lying to you
How to tell whether your odometry is actually any good
One warpAffine instead of four stacked nodes
Moving a point cloud into someone else's coordinate frame
Turning matched pixels in two photos into actual 3D
How you feed a (width, height) to a node that only takes two numbers
Turning a click on a pixel into a 3D point
Getting one frame at a time out of a DNN output batch
Warping with a direction, not just an amount
Recover a camera path from a video, scale problem included
A 3B vision-language model inside cv2.dnn, one slow token at a time
Stop typing WARP_RELATIVE_MAP into eight different nodes
The flag-and-water ripple, as coordinate maths
Read every QR code in a frame, including the tiny ones
Getting a numpy point cloud out of the graph and onto your screen
Fixing a colour cast so your reference photo is actually usable
Turning a raw YOLO head into boxes nobody has to guess about
YOLO Instance Segmentation Without the Ultralytics Install
Faces and Five Landmarks, Minus the InsightFace Licence
⚠️ CV ZeroStride Like Hands cv2 a Canvas Made of Nothing
ComfyUI CV
Computer-vision nodes for ComfyUI. The pack exposes the functions of the
OpenCV library (cv2) as nodes — ~470 auto-generated raw cv2.* wrappers
plus curated high-level nodes — but it is not limited to plain cv2 calls:
a few nodes implement their own algorithm, and not all of cv2 is reachable.
See the disclaimers below for both caveats.
This project is an independent, personal endeavor and is not affiliated with, endorsed by, or part of the official OpenCV project. It does not reflect the official roadmap or the views of the OpenCV maintainers. It is provided 'as is', without any express or implied warranties.
"OpenCV" is a registered trademark of the Open Source Vision Foundation — the name as much as the logo. This pack is therefore named ComfyUI CV, not after the library, and names OpenCV only to describe what it wraps.
<details> <summary> <b>Disclaimers</b> (that you should read) ⬅ click to expand </summary> <br>-
Created with heavy use of Generative AI (LLMs). The following models were used: opencode's "Big Pickle" stealth models; DeepSeek V4 family; Dots3-Note Preview; Fable 5; Kimi K3; Ling-3.0-flash; Opus family.
Besides potential ethical concerns, it also entails the following practical risks:
-
Test‑driven overfitting: During development, some workflows were developed via a test‑driven approach with sample inputs and outputs. In some cases, the agent generating the code appears to have over‑fitted to the provided examples at the expense of broader correctness. For instance, the 5th and 6th Hu Moments were initially dropped because they were not represented in the test suite. While this specific error was later corrected, it is possible that similar undetected mistakes exist elsewhere in the codebase.
-
Exhaustive input handling: The "smart" behavior for input types and processing is implemented via exhaustive lists in lowlevel.py. This does not directly affect end‑users, but it may present a maintenance burden for future contributors or for anyone extending the library.
-
Production readiness: Given the points above, it is not recommended to use this library in production without a thorough, independent review of the used source code. You should verify that all logic aligns with your own requirements, validate with your own test cases, and consider adding additional safeguards.
-
-
Updates not planned; may happen at any time. Do not expect prompt support regarding potential issues/fixes.
-
Not all OpenCV functionality is exposed. Despite ~470 auto-generated raw
cv2.*wrappers plus curated nodes, only a subset of cv2 is reachable: the generator parses top-level functions only, so class-based APIs (create*factories, detectors, matchers) and complex multi-return functions are absent unless a curated node bridges them (see docs/custom_nodes.md). -
Some low-level nodes cannot run on a given OpenCV distribution. The node registry is generated from whatever the installed build exposes, which can include entries whose implementation the build lacks. On the pinned reference build, for instance,
ximgproc.fastBilateralSolverFilteris exposed but always raises(-213) needs to be compiled with EIGENwhen executed; another build could surface more or fewer such entries.[!NOTE]
NONFREE entries are not something to go hunting for: stockopencv-contrib-python(-headless)wheels are built withOPENCV_ENABLE_NONFREE=OFF.NO shipped workflow uses NONFREE functions.
-
DNN support is limited, and ComfyUI often already does it better. Everything here goes through
cv2.dnnon principle — that is the point of the pack — even where ComfyUI has a first-class node for the same job. Frame interpolation is the clearest example: core ships "Run Frame Interpolation Model" (FrameInterpolate) plus its loader, which run RIFE and FILM natively in PyTorch, on the GPU, in fp16, with model offloading and a 2–16× multiplier applied across a whole batch. The example workflow for RIFE does it the heretic way instead: an ONNX export, driven through the genericcv2.dnnnodes, on the CPU, one frame pair per execution, with the input padded to a multiple of 32 by hand. If you actually want to interpolate a video, use the core node. Use this one to see how the pieces fit together or to reach a model core does not support.The same caveat applies to the DNN examples generally. Models that run fine in PyTorch had to be converted to ONNX, because that is the format OpenCV's DNN module supports — and conversion is sometimes not sufficient: a perfectly valid export can still be unloadable here. Support for modern architectures is limited by both the DNN implementation and the pinned OpenCV version.
-
Models are not bundled. DNN/LLM workflows need external model downloads (
models/onnx), and some might require conversion into.onnx(.tflitemay also work, I did not test).Model source URLs in the workflow notes.
-
Raw low-level wrappers are auto-generated and uncurated — expect to handle conversions and edge cases yourself.
-
The workflows are not production-grade. They exist mainly to showcase, plan and test the functionalities; several pipelines/heuristics are overfitted to specific datasets (e.g. the sky mask and stereo settings tuned to StereoGeo-CARLA) or may be lacking, so they are not usable in actual production contexts. Individual nodes may still be genuinely useful in real workflows.
-
Most nodes are direct
cv2.*wrappers or high-level compositions of cv2 calls, but a few are genuine exceptions that reimplement an algorithm instead.CV Photometric Align (Gain/Bias)fits a robust per-channel gain/bias via trimmed numpy least squares, andCV Local Linear Fitruns a windowed regression around every pixel; the crop/paste geometry (boxpolicy/polytype) is pure Python + numpy with no cv2 at all. They are curated like everything else, but they are not OpenCV functions in the wrapper sense (see docs/custom_nodes.md).
Requires Python ≥ 3.12 and a recent ComfyUI built on the V3 node API.
The only required python dependency can be installed via the pyproject.toml/requirements or with the following command:
pip install "opencv-contrib-python-headless~=5.0.0.93"
Behavior is curated against 5.0.0.93; other versions may behave differently.
The headless wheel is the declared dependency because nothing in the pack uses highgui (no imshow/waitKey/trackbars — the registry generator blacklists them outright). The GUI opencv-contrib-python build is equally usable if something else already installed it.
What does matter is contrib: installing a non-contrib wheel (opencv-python / opencv-python-headless) over a contrib one silently empties the contrib submodules and contrib nodes disappear — all four distributions share one site-packages/cv2. tools/repair_opencv_contrib.py diagnoses (--check) and repairs (--apply) that, but there is no install-time guard.
Some workflows and subgraphs are dependent on other custom node packages, namely:
- Dr.Lt.Data's ComfyUI-Inspire-Pack
- pythongosssss's ComfyUI-Custom-Scripts
- StableLlama's Basic Data Handling
Install the example inputs
The example workflows load their photos, videos and the MilkTruck.glb model
from this pack's example_inputs/ folder. ComfyUI's Load Image / Load
Video / Load 3D nodes are dropdowns, though: they can only offer what is
already inside ComfyUI/input, so on a fresh install those nodes open red.
Run workflows/01_install_example_inputs.json once and the copy is done for
you — it is a single node, CV Install Example Inputs (image/CV), with
nothing to wire up:
- Load the workflow and press Run.
- Reload the ComfyUI page. The
Load*dropdowns are built when the node definitions are fetched, so files copied during a session only appear after a refresh.
Details worth knowing:
- Nothing is overwritten by default.
existing_filesstarts on keep the file already there, so a name that already exists in your input folder wins and a second run is a no-op (everything comes back asskipped). Switch it to overwrite it with the packaged copy only to repair a sample you edited in place. - Look before you leap. Setting
modeto list what would be copied (dry run) reports exactly what a real run would do and writes nothing — worth doing if your input folder holds work of your own. - 3D models go to
ComfyUI/input/3d, which is the only folder core's Load 3D nodes list. Everything else — images, video, and the calibration.json/.yaml/.csv/.txtsidecars — lands inComfyUI/inputitself. - Nothing outside
inputis touched, and nothing is ever deleted. The node is failure tolerant: a missing source folder or an unwritable file leavesok=falseand names the problem inreportinstead of halting the run.
Copying by hand works just as well — example_inputs/ is ~33 MB of ordinary
files, and example_inputs/sources.txt records where each one came from and
under which license.
[!NOTE] The
.onnx/ cascade / LLM / VLM models are a separate matter: they are not in this repo and not part ofexample_inputs. Seemodel_sources.txtat the repo root for where to get them.Two inputs do not ship, because of size: the 48 MB driving clip for
exercise_visual_odometry_video.json(its ground-truth poses do ship, under a non-commercial licence) and the flash / no-flash photo pair in10_ximgproc_edge_aware_filters.json. Each of those workflows carries a note on the canvas explaining where to get them. Everything else a workflow loads is inexample_inputs/, and the development test suite fails if that stops being true.
More reading and reference material: Documentation below.
</details> <details> <summary> <b>Documentation</b> ⬅ click to expand </summary> <br>| Link | What it is | Open it when |
| --- | --- | --- |
| Custom nodes | Catalog of every hand-written node with usage notes and limits | wiring a graph and want a node's intended use |
| Subgraph blueprints | 65 reusable compositions, each a one-node workflow to open and build around | a step you keep rebuilding — a blueprint may already exist |
| OpenCV 5.0 documentation | Official upstream API reference | using a low-level cv2.* wrapper and want the exact signature/edge cases |
| Model sources | External DNN/LLM models: download URLs, target folders, license record | a model-backed workflow opens red |
| Example input sources | Provenance and licenses of the bundled sample media | planning to redistribute outputs or audit assets |
Credits
Gerold Meisinger, the maintainer of opencv-comfyui from which this project was forked.
Abhishek Gola, the maintainer of opencv_contribution which contains many of the .onnx models showcased in this project and example scripts on how to run them.
License and provenance
Copyright (C) 2026 bmad4ever. Licensed under GPL-3.0-only — every
first-party source file carries an SPDX-License-Identifier: GPL-3.0-only
header.
The GPL is inherited, not picked: this pack is a fork of
opencv-comfyui (GPL-3.0),
which is also where the pack's name, the idea of generating raw cv2.* node
wrappers from the type stubs, and the NPARRAY socket come from. What ships
today is a rewrite on ComfyUI's V3 node API; the handful of files whose lineage
still runs back upstream — __init__.py, opencv_nodes/convert.py,
opencv_nodes/lowlevel.py, the generated opencv_nodes/registry*.py, and
generator/generator.py — say so in their own header.
Bundled third-party code
Not covered by the notice above; each keeps its own license.
| Where | What | License |
|---|---|---|
| web/lib/ | three.js, plus GLTFLoader / OrbitControls / TransformControls / BufferGeometryUtils | MIT — web/lib/LICENSE.three.txt |
| web/lib/ | Apache ECharts | Apache-2.0 — web/lib/LICENSE.echarts.txt, web/lib/NOTICE.echarts.txt |
| web/lib/ | KaTeX and its fonts | MIT — web/lib/LICENSE.katex.txt |
| workers/dnn_tasks.py | the _MPPalmDet / _MPHandPose classes, ported from the OpenCV Zoo handpose_estimation_mediapipe reference (upstream models: Google MediaPipe Hands) | Apache-2.0 |
| workers/stitch_advanced_worker.py | stage order and parameter set follow OpenCV's own samples/python/stitching_detailed.py | Apache-2.0 |
| opencv_nodes/param_docs.py, opencv_nodes/return_docs.py | per-parameter tooltip text extracted from the OpenCV documentation | Apache-2.0, OpenCV contributors |
OpenCV itself is a runtime dependency, not bundled: cv2 comes from the
opencv-contrib-python-headless wheel you install (Apache-2.0), and no OpenCV
binaries ship here.
Image and video assets are recorded in
example_inputs/sources.txt, and the screenshots
and GIFs in this README — with the inputs each one derives from — in
docs/sources.txt. The .onnx,
cascade, LLM and VLM models are not in this repo at all; their provenance
and licenses are in model_sources.txt. Read that file
before redistributing anything you download through it: a few of those models
carry terms stricter than this pack's (notably yolo26n-seg.onnx, AGPL-3.0
with a network clause).
One asset is not under the GPL grant.
example_inputs/kitti_2011_09_26_drive_0009_poses.txt is the KITTI
ground-truth pose track, CC BY-NC-SA 3.0 — non-commercial, inherited from
the KITTI benchmark. It is the only non-commercial file in the repository,
included for the visual-odometry example only; the GPL-3.0 grant above does not
extend to it. Remove that one file if you need a uniformly commercial-safe tree.
OpenCV is a registered trademark of the Open Source Vision Foundation. This pack is an independent, unofficial wrapper, as stated at the top.