Visit ComfyUI Online for ready-to-use ComfyUI environment
Analyze motion between images, generate flow field, useful for video stabilization and motion tracking.
The Compute Optical Flow node is designed to analyze the motion between two consecutive images, often referred to as frames, and generate a flow field that represents the movement of pixels from one image to the next. This node is particularly useful for tasks such as video stabilization, motion tracking, and dynamic scene analysis. By leveraging advanced optical flow algorithms, it provides a detailed and accurate representation of motion, which can be used to enhance visual effects, create smooth transitions, or analyze movement patterns. The node supports multiple methods for computing optical flow, allowing you to choose the one that best fits your specific needs and the characteristics of your input images.
This parameter represents the previous image or frame in the sequence. It is essential for the optical flow computation as it serves as the reference point from which the motion is calculated. The image should be in a compatible format, typically a tensor, and should match the dimensions of the current image.
This parameter represents the current image or frame in the sequence. It is compared against the previous image to determine the motion of pixels. Like the previous image, it should be in a compatible format and have the same dimensions to ensure accurate optical flow computation.
This parameter allows you to select the method used for computing the optical flow. The available options are DIS Medium
, DIS Fine
, and Farneback
. Each method has its own characteristics and is suited for different types of motion and image content. DIS Medium
and DIS Fine
are variations of the Dense Inverse Search (DIS) algorithm, with DIS Fine
providing more detailed results at the cost of increased computation time. Farneback
is another popular method that offers a good balance between accuracy and performance.
The output of this node is the optical flow field, represented as OPTICAL_FLOW
. This flow field is a detailed map of pixel movements between the previous and current images. It can be used for various applications such as motion tracking, video stabilization, and dynamic scene analysis. The flow field provides both the direction and magnitude of motion for each pixel, enabling a comprehensive understanding of the movement within the image sequence.
DIS Fine
method, especially when dealing with complex or subtle movements.DIS Medium
or Farneback
methods are suitable choices.<method>
'DIS Medium
, DIS Fine
, or Farneback
.© Copyright 2024 RunComfy. All Rights Reserved.