🐇 Pixel Hold:
PixelHold is a sophisticated node designed for stabilizing pixels in video frames by referencing a specific source frame. This node is particularly useful in scenarios where maintaining consistency across frames is crucial, such as in video editing or animation. By leveraging advanced algorithms, PixelHold ensures that low-change pixels are locked to a reference frame, thereby reducing flicker and enhancing visual stability. This process is achieved through a series of configurable parameters that allow you to fine-tune the stabilization effect according to your specific needs. The node's primary goal is to provide a seamless and stable visual experience by intelligently analyzing and adjusting pixel values across frames.
🐇 Pixel Hold Input Parameters:
frames
This parameter represents the video frames that you want to stabilize. It is a tensor containing the pixel data for each frame. The frames are processed to identify and stabilize low-change pixels based on the reference frame.
ref_source
This parameter specifies the source of the reference frame. It can be set to "external" or other predefined options, determining where the reference frame is sourced from. The default value is "external".
ref_index
This parameter indicates the index of the reference frame within the source. It is an integer value that helps in selecting the specific frame to be used as a reference for stabilization. The default value is 0.
reference
This optional parameter allows you to provide a specific reference frame as a tensor. If not provided, the node will use the frame specified by ref_source and ref_index.
linearize
This boolean parameter determines whether the pixel values should be linearized before processing. Linearization can improve the accuracy of stabilization by normalizing pixel values. The default value is True.
auto_luma
This boolean parameter controls whether automatic luminance adjustment should be applied. It helps in maintaining consistent brightness across frames. The default value is True.
auto_k
This parameter is a float that adjusts the strength of automatic stabilization. It influences how aggressively the node stabilizes the pixels. The default value is 2.5.
tau_luma
This float parameter sets the threshold for luminance changes. It defines the sensitivity of the node to luminance variations, with a default value of 1.5 / 255.0.
tau_grad
This float parameter specifies the threshold for gradient changes, affecting how the node responds to changes in pixel gradients. The default value is 0.02.
mode
This parameter defines the mode of operation for the node, such as "tile" or other modes. It determines how the stabilization is applied across the frames. The default value is "tile".
tile_size
This integer parameter sets the size of the tiles used in the "tile" mode. It affects the granularity of the stabilization process. The default value is 32.
score_mode
This parameter specifies the scoring method used to evaluate pixel changes, such as "l1_tile". It influences the decision-making process for stabilization.
edge_band
This boolean parameter indicates whether an edge band should be applied to enhance edge stabilization. The default value is True.
band_radius
This integer parameter sets the radius of the edge band, affecting the width of the area around edges that is stabilized. The default value is 4.
tau_edge_low
This float parameter defines the low threshold for edge stabilization, influencing how subtle edge changes are handled. The default value is 1.5 / 255.0.
tau_edge_high
This float parameter sets the high threshold for edge stabilization, affecting the response to significant edge changes. The default value is 6.0 / 255.0.
apply
This parameter specifies the application mode for stabilization, such as "all". It determines which parts of the frames are affected by the stabilization process.
dilate
This integer parameter controls the dilation applied to the stabilization mask, affecting the spread of the stabilization effect. The default value is 1.
feather_sigma
This float parameter sets the sigma value for feathering, which smooths the transition between stabilized and non-stabilized areas. The default value is 2.0.
process_on
This parameter specifies the processing device, such as "auto", determining whether the node runs on CPU or GPU. The default value is "auto".
gpu_clear_every
This integer parameter sets the interval for clearing GPU memory, helping to manage resources during processing. The default value is 0.
🐇 Pixel Hold Output Parameters:
output
The output is a tensor containing the stabilized frames. It reflects the adjustments made to the input frames to achieve pixel stabilization, providing a smoother visual experience.
mask
The mask is a tensor that indicates which pixels were stabilized. It helps in understanding the areas of the frames that were affected by the stabilization process.
🐇 Pixel Hold Usage Tips:
- Experiment with the
ref_sourceandref_indexparameters to find the most suitable reference frame for your specific video sequence. - Adjust the
auto_kparameter to control the strength of stabilization, especially in scenes with varying levels of motion. - Use the
tile_sizeparameter to balance between processing speed and stabilization granularity, depending on the resolution and complexity of your frames.
🐇 Pixel Hold Common Errors and Solutions:
"Invalid reference frame index"
- Explanation: The
ref_indexprovided does not correspond to a valid frame in the reference source. - Solution: Ensure that the
ref_indexis within the range of available frames in the specifiedref_source.
"Unsupported processing device"
- Explanation: The
process_onparameter is set to a device that is not available or supported. - Solution: Set the
process_onparameter to "auto" or specify a valid device such as "cpu" or "gpu".
"Memory allocation failed"
- Explanation: The node ran out of memory during processing, possibly due to large frame sizes or high tile counts.
- Solution: Reduce the
tile_sizeor increase thegpu_clear_everyinterval to manage memory usage more effectively.
