ComfyUI Node
CV Optical Flow (DeepFlow / PCAFlow)
Two more dense optical-flow algorithms from cv2.optflow, both class-gated and neither tunable (their Python bindings expose no setters). DeepFlow matches a descriptor pyramid before the variational solve, which is what lets it follow LARGE displacements that pyramidal methods lose. PCAFlow projects the field onto a learned low-dimensional basis: it is fast and immune to noise, but it can only produce motion its basis can express, so fine structure is smoothed away. Start with 'OpenCV Optical Flow (DIS)' and come here when the motion is too big (DeepFlow) or the input too noisy (PCAFlow).
CV Optical Flow (DeepFlow / PCAFlow)
- frame_a
- frame_b
- flow
- magnitude
- angle
◄algorithmDeepFlow (large motion)►
Categoryimage/CV/contrib
Inputs (3)
| Name | Type | Default | Description |
|---|---|---|---|
| frame_a | NPARRAY,IMAGE | First frame (earlier in time); converted to grayscale. Accepts a ComfyUI IMAGE/MASK directly (frame 0 of a batch) or an NPARRAY. Arithmetic ops (add, multiply, etc.) process the full IMAGE batch when both inputs have the same batch size. | |
| frame_b | NPARRAY,IMAGE | Second frame; resized to frame_a if the sizes differ. Accepts a ComfyUI IMAGE/MASK directly (frame 0 of a batch) or an NPARRAY. Arithmetic ops (add, multiply, etc.) process the full IMAGE batch when both inputs have the same batch size. | |
| algorithm | COMBO | DeepFlow (large motion) | DeepFlow: descriptor matching + variational refinement, best on large motion, slowest here. PCAFlow: learned-basis projection, fast and noise-tolerant, blurs fine structure. |
Outputs (3)
| Name | Type | Description |
|---|---|---|
| flow | NPARRAY | HxWx2 float32 (dx, dy) displacement per pixel. |
| magnitude | NPARRAY | HxW float32 motion magnitude in pixels. |
| angle | NPARRAY | HxW float32 motion direction in RADIANS - feed 'CV Flow To Color' in its default radians mode. |