ComfyUI > Nodes > WhiteRabbit > πŸ‡ Trim Batch Ends

ComfyUI Node: πŸ‡ Trim Batch Ends

Class Name

TrimBatchEnds

Category
video utils
Author
Artificial-Sweetener (Account age: 367days)
Extension
WhiteRabbit
Latest Updated
2025-11-17
Github Stars
0.04K

How to Install WhiteRabbit

Install this extension via the ComfyUI Manager by searching for WhiteRabbit
  • 1. Click the Manager button in the main menu
  • 2. Select Custom Nodes Manager button
  • 3. Enter WhiteRabbit 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
  • 16GB VRAM to 80GB VRAM GPU machines
  • 400+ preloaded models/nodes
  • Freedom to upload custom models/nodes
  • 200+ ready-to-run workflows
  • 100% private workspace with up to 200GB storage
  • Dedicated Support

Run ComfyUI Online

πŸ‡ Trim Batch Ends Description

Efficiently trims video clip frames from start and end, ensuring at least one frame remains, useful for batch image processing.

πŸ‡ Trim Batch Ends:

The TrimBatchEnds node is designed to efficiently remove frames from both the start and end of a video clip, ensuring that at least one frame is always retained. This node is particularly useful for video processing tasks where you need to trim unnecessary frames from a batch of images, which are represented in the NHWC format (Number of frames, Height, Width, Channels) with pixel values ranging from 0 to 1. By allowing you to specify the number of frames to be trimmed from the beginning and end, this node provides a quick and straightforward method to refine your video clips, making them more concise and focused on the essential content. This functionality is especially beneficial in scenarios where you need to prepare video data for further processing or analysis, ensuring that only the most relevant frames are included.

πŸ‡ Trim Batch Ends Input Parameters:

clip_frames

This parameter represents the video clip you want to process, formatted as a batch of images with dimensions corresponding to frames, height, width, and channels (NHWC). The pixel values should be normalized between 0 and 1. This input is crucial as it provides the raw data that the node will operate on to perform the trimming.

trim_start_frames

This integer parameter specifies the number of frames to remove from the start of the video clip. It has a default value of 0, meaning no frames are removed unless specified otherwise. The minimum value is 0, and the maximum is 100,000, allowing for flexibility depending on the length of your video. Adjusting this parameter helps in discarding unnecessary initial frames, focusing on the more relevant parts of the clip.

trim_end_frames

Similar to trim_start_frames, this integer parameter determines the number of frames to be removed from the end of the video clip. It also defaults to 0, with a range from 0 to 100,000. By setting this parameter, you can eliminate redundant frames at the end of your video, ensuring that the final output is concise and contains only the desired content.

πŸ‡ Trim Batch Ends Output Parameters:

images

The output parameter images is the processed video clip after the specified frames have been trimmed from the start and end. This output retains the NHWC format and includes at least one frame, ensuring that the video remains valid for further processing or viewing. The trimmed clip is more focused and relevant, containing only the frames you wish to keep.

πŸ‡ Trim Batch Ends Usage Tips:

  • To quickly remove unwanted frames from a video clip, set the trim_start_frames and trim_end_frames parameters according to the number of frames you wish to discard from the beginning and end, respectively.
  • Use this node in preprocessing pipelines where you need to prepare video data for machine learning models or other analysis tools, ensuring that only the most relevant frames are included.

πŸ‡ Trim Batch Ends Common Errors and Solutions:

"AudioTrim: Start time must be less than end time and be within the audio length."

  • Explanation: This error occurs when the calculated start frame is greater than or equal to the end frame, which can happen if the trim parameters are set incorrectly.
  • Solution: Ensure that the trim_start_frames and trim_end_frames are set such that the resulting start frame is less than the end frame. Adjust the parameters to fit within the actual length of the video clip.

πŸ‡ Trim Batch Ends Related Nodes

Go back to the extension to check out more related nodes.
WhiteRabbit
RunComfy
Copyright 2025 RunComfy. All Rights Reserved.

RunComfy is the premier ComfyUI platform, offering ComfyUI online environment and services, along with ComfyUI workflows featuring stunning visuals. RunComfy also provides AI Models, enabling artists to harness the latest AI tools to create incredible art.