ComfyUI  >  Nodes  >  ComfyBreakAnim >  GetKeyFrames

ComfyUI Node: GetKeyFrames

Class Name

GetKeyFrames

Category
Frames
Author
LonicaMewinsky (Account age: 1093 days)
Extension
ComfyBreakAnim
Latest Updated
5/22/2024
Github Stars
0.0K

How to Install ComfyBreakAnim

Install this extension via the ComfyUI Manager by searching for  ComfyBreakAnim
  • 1. Click the Manager button in the main menu
  • 2. Select Custom Nodes Manager button
  • 3. Enter ComfyBreakAnim in the search bar
After installation, click the  Restart button to restart ComfyUI. Then, manually refresh your browser to clear the cache and access the updated list of nodes.

Visit ComfyUI Online for ready-to-use ComfyUI environment

  • Free trial available
  • High-speed GPU machines
  • 200+ preloaded models/nodes
  • Freedom to upload custom models/nodes
  • 50+ ready-to-run workflows
  • 100% private workspace with up to 200GB storage
  • Dedicated Support

Run ComfyUI Online

GetKeyFrames Description

Identifies and extracts keyframes from video sequences for AI analysis and manipulation, emphasizing significant frame differences.

GetKeyFrames:

The GetKeyFrames node is designed to identify and extract keyframes from a sequence of frames, which are crucial for representing significant changes or events within the sequence. This node is particularly useful for AI artists who need to analyze or manipulate video content by focusing on the most important frames. By selecting keyframes based on the differences between consecutive frames, the node ensures that the extracted frames capture the essential dynamics of the video. Additionally, it offers options to include the first and last frames of the sequence, providing flexibility in the selection process. The node also labels the keyframes for easy identification and further processing.

GetKeyFrames Input Parameters:

frames

This parameter expects a sequence of frames in the form of an image tensor. The frames represent the video content from which keyframes will be extracted. The quality and content of these frames directly impact the effectiveness of the keyframe extraction process.

num_keyframes

This integer parameter specifies the number of keyframes to be extracted from the sequence. The value must be between 2 and the total number of frames minus 2. The default value is 12. Adjusting this parameter allows you to control the granularity of the keyframe selection, with higher values resulting in more keyframes and finer detail.

include_first_frame

This boolean parameter determines whether the first frame of the sequence should be included as a keyframe. The default value is True. Including the first frame ensures that the initial state of the video is always represented among the keyframes.

include_last_frame

This boolean parameter determines whether the last frame of the sequence should be included as a keyframe. The default value is True. Including the last frame ensures that the final state of the video is always represented among the keyframes.

GetKeyFrames Output Parameters:

Keyframes

This output is an image tensor containing the extracted keyframes. These keyframes represent the most significant frames in the sequence, capturing the essential changes and events.

Labeled Keyframes

This output is an image tensor containing the extracted keyframes with labels. Each keyframe is labeled with its index in the original sequence, making it easy to identify and reference specific frames during further processing or analysis.

GetKeyFrames Usage Tips:

  • To capture the most significant changes in a video, set num_keyframes to a value that balances detail and manageability. For longer videos, a higher number of keyframes may be necessary.
  • Use the include_first_frame and include_last_frame options to ensure that the keyframes include the start and end states of the video, which can be crucial for certain analyses or presentations.
  • After extracting keyframes, you can use the labeled keyframes output to easily reference and manipulate specific frames in subsequent processing steps.

GetKeyFrames Common Errors and Solutions:

FileNotFoundError: File '{file_input} cannot be found.'

  • Explanation: This error occurs when the specified file path for the input frames does not exist.
  • Solution: Ensure that the file path provided in the frames parameter is correct and that the file exists at the specified location.

Error: Could not open video file {file_input}.

  • Explanation: This error indicates that the video file could not be opened, possibly due to an incorrect file path or unsupported file format.
  • Solution: Verify that the file path is correct and that the video file is in a supported format. If the issue persists, try converting the video to a different format.

ValueError: num_keyframes must be between 2 and the total number of frames minus 2.

  • Explanation: This error occurs when the num_keyframes parameter is set to a value outside the valid range.
  • Solution: Adjust the num_keyframes parameter to a value between 2 and the total number of frames minus 2.

RuntimeError: CUDA out of memory.

  • Explanation: This error occurs when the GPU runs out of memory while processing the frames.
  • Solution: Reduce the number of frames or the resolution of the frames being processed. Alternatively, try running the node on a machine with more GPU memory.

GetKeyFrames Related Nodes

Go back to the extension to check out more related nodes.
ComfyBreakAnim
RunComfy

© Copyright 2024 RunComfy. All Rights Reserved.

RunComfy is the premier ComfyUI platform, offering ComfyUI online environment and services, along with ComfyUI workflows featuring stunning visuals.