OpenCV solvePoly_1
SolvePoly_1 — the root finder's identical twin
- coeffs
- roots
- float
- nparray
Let's not make you read the same thing twice: solvePoly_1 is solvePoly_0 with a different number on the end. The opencv-comfyui generator emits one node per overload in OpenCV's type stubs, cv2.solvePoly's (coeffs, roots, maxIters) signature appears in MatLike and UMat forms, and you get two nodes that call the identical function with the identical arguments. Nothing about the behavior differs. Use whichever appears in your search.
The actual explanation - what polynomial roots are doing in a ComfyUI pack, how to order the coefficients, why you can't preview the output as an image - is in the solvePoly_0 article. This page is the short-form duplicate reference.
What it takes
- coeffs (NPARRAY) - polynomial coefficients, highest degree first;
[2, 3, -5]is2x² + 3x − 5. - maxIters (INT) - iteration cap for the root-finding loop.
- roots (NPARRAY, optional) - out-parameter; unwired is fine.
Outputs: float (the solver's reported solution error) and nparray (the roots, with complex roots as interleaved real/imaginary pairs).
The same honest caveats
Two things to remember, both pack-wide rather than node-specific:
- A root vector is not an image. Send it to
Nparrays2Imageand you get the README's documented'NoneType' object has no attribute 'shape'error. There is no nparray preview node yet (the README lists it as a to-do). - There's no "type in your coefficients" widget.
coeffsis aNPARRAYsocket; you need an array that came from somewhere else in the graph, or a Python node to build one. For real math-in-the-graph, a Python/Execute node is usually the more direct route.
Neither is a defect - they're the cost of a pack that auto-generates a node for every top-level cv2 function, math solvers included.
Install
cd ComfyUI/custom_nodes
git clone https://github.com/geroldmeisinger/opencv-comfyui
pip install opencv-contrib-python
or ComfyUI Manager → "opencv-comfyui". Restart. Deps: opencv-contrib-python, numpy, torch - no downloads.
Troubleshooting
'NoneType' object has no attribute 'shape'→ you're treating a non-image array as an image.invalid syntax (<unknown>, line 0)→ a malformed literal input; the pack's parser is strict.Cannot import name 'guidedFilter'at startup → conflicting OpenCV packages; README links the fix.
Same roots, second name. If you've got solvePoly_0, you've got this one.
Inputs (3)
| Name | Type | Default | Description |
|---|---|---|---|
| coeffs | NPARRAY | — | |
| maxIters | INT | — | |
| rootsopt | NPARRAY | — |
Outputs (2)
| Name | Type | Description |
|---|---|---|
| float | FLOAT | — |
| nparray | NPARRAY | — |