Wan2.1 Frame Adjuster:
The Wan21FrameAdjusterNode is a specialized utility within the ComfyUI framework designed to ensure video frame sequences meet the specific requirements of the Wan2.1 standard. This node automatically adjusts the number of frames in a video by adding blank gray frames, ensuring the total frame count is always a valid number as per Wan2.1's criteria. The standard requires that frame counts be divisible by 4 plus 1, such as 5, 9, 13, and so on. This adjustment is crucial for maintaining compatibility with systems or processes that adhere to the Wan2.1 specifications, thereby preventing potential errors or incompatibilities in video processing workflows. By automating this adjustment, the node simplifies the task for users, allowing them to focus on creative aspects without worrying about technical constraints related to frame counts.
Wan2.1 Frame Adjuster Input Parameters:
images
The images parameter is the primary input for the Wan21FrameAdjusterNode, representing the sequence of video frames that need adjustment. This parameter accepts a tensor of images, where each image is a frame in the video sequence. The function of this parameter is to provide the node with the current set of frames that may require adjustment to meet the Wan2.1 frame count requirements. The impact of this parameter on the node's execution is significant, as it determines the initial frame count and the subsequent need for additional frames. There are no specific minimum, maximum, or default values for this parameter, as it depends on the user's input video sequence. However, the node will ensure that the final frame count is at least 5, as this is the smallest valid count according to Wan2.1 standards.
Wan2.1 Frame Adjuster Output Parameters:
adjusted_images
The adjusted_images output parameter provides the modified sequence of video frames after adjustment. This output is crucial as it contains the original frames along with any additional gray frames added to meet the Wan2.1 frame count requirements. The adjusted sequence ensures compatibility with systems expecting a specific frame count format, thus maintaining the integrity and usability of the video.
final_frame_count
The final_frame_count output parameter indicates the total number of frames in the adjusted video sequence. This value is important for users to verify that the frame count now adheres to the Wan2.1 standard, providing assurance that the video is correctly formatted for further processing or playback.
frames_added
The frames_added output parameter specifies the number of gray frames that were added to the original sequence to achieve the required frame count. This information is valuable for users to understand the extent of modification applied to the original video, allowing them to assess the impact of the adjustment on their content.
Wan2.1 Frame Adjuster Usage Tips:
- Ensure that your input video sequence is correctly formatted and loaded into the
imagesparameter to allow the node to perform the necessary adjustments effectively. - Use the
final_frame_countoutput to verify that your video now meets the Wan2.1 frame count requirements, ensuring compatibility with systems that require this specific format. - Consider the
frames_addedoutput to understand how many additional frames were necessary, which can help in planning for storage or processing resources.
Wan2.1 Frame Adjuster Common Errors and Solutions:
Invalid image tensor shape
- Explanation: This error occurs when the input
imagestensor does not have the expected shape, which should be a 4D tensor representing a batch of images. - Solution: Ensure that your input tensor is correctly formatted as a 4D tensor with dimensions corresponding to (number of frames, height, width, channels).
Device mismatch error
- Explanation: This error can happen if the input tensor and the node's operations are not on the same device, such as CPU vs. GPU.
- Solution: Make sure that the input tensor is on the same device as the node's operations, typically by transferring the tensor to the appropriate device using
.to(device).
Insufficient memory error
- Explanation: Adding frames to a large video sequence may exceed available memory, leading to this error.
- Solution: Consider reducing the resolution or number of frames in the input sequence, or ensure that your system has sufficient memory resources to handle the operation.
