Save 4 hours! We auto-setup your workflow! Free!

Drop your workflow.json β€” we handle every dependency, custom node, and model. Just open the link and run.

Auto-Setup Workflow Json (Free) Now!
ComfyUI > Nodes > WhiteRabbit > πŸ‡ Trim Batch Ends

ComfyUI Node: πŸ‡ Trim Batch Ends

Class Name

TrimBatchEnds

Category
video utils
Author
Artificial-Sweetener (Account age: 594days)
Extension
WhiteRabbit
Latest Updated
2026-07-28
Github Stars
0.08K

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 frames from video clips to manage batch beginnings and ends, ensuring content integrity and precise duration control.

πŸ‡ Trim Batch Ends:

The TrimBatchEnds node is designed to efficiently manage video clips by trimming frames from the beginning and/or end of a batch of frames. This node is particularly useful for video editing and processing tasks where you need to remove unnecessary frames from a clip, ensuring that the final output is concise and focused. The node guarantees that at least one frame is retained, preventing the complete removal of content. This functionality is essential for maintaining the integrity of the video while allowing for precise control over the clip's duration. By using this node, you can streamline your video processing workflow, making it easier to prepare clips for further editing or analysis.

πŸ‡ Trim Batch Ends Input Parameters:

clip_frames

This parameter represents the batch of frames from your video clip that you want to process. It is a tensor with dimensions representing the number of frames, height, width, and channels (framesΓ—HΓ—WΓ—C), with values ranging from 0 to 1. The clip_frames parameter is crucial as it provides the raw data that the node will trim according to the specified start and end frame counts.

trim_start_frames

This integer parameter specifies the number of frames to remove from the start of the clip. It allows you to control how much of the initial part of the video is discarded. The minimum value is 0, meaning no frames are removed, and the maximum is 100,000. The default value is 0, which means the trimming process will not affect the start of the clip unless specified otherwise.

trim_end_frames

Similar to trim_start_frames, this integer parameter determines the number of frames to remove from the end of the clip. It provides control over how much of the final part of the video is discarded. The minimum value is 0, indicating no frames are removed, and the maximum is 100,000. The default value is 0, ensuring that the end of the clip remains unchanged unless specified.

πŸ‡ Trim Batch Ends Output Parameters:

images

The output parameter, images, is a tensor that contains the trimmed batch of frames. This output reflects the original clip with the specified number of frames removed from the start and/or end. The images parameter is essential as it provides the processed video data that can be used for further editing or analysis, ensuring that the clip is concise and meets the desired specifications.

πŸ‡ Trim Batch Ends Usage Tips:

  • To maintain the integrity of your video, ensure that the sum of trim_start_frames and trim_end_frames does not exceed the total number of frames in clip_frames. This will prevent accidental removal of all frames.
  • Use trim_start_frames and trim_end_frames to focus on the most relevant part of your video clip, which can be particularly useful for highlighting specific scenes or actions.
  • Experiment with different trimming values to achieve the desired video length and content focus, especially when preparing clips for presentations or further processing.

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

"IndexError: index out of range"

  • Explanation: This error occurs when the sum of trim_start_frames and trim_end_frames exceeds the total number of frames in clip_frames, resulting in an attempt to access non-existent frames.
  • Solution: Ensure that the total number of frames to be trimmed does not exceed the number of frames in the input clip. Adjust trim_start_frames and trim_end_frames accordingly.

"TypeError: Expected input to be a tensor"

  • Explanation: This error indicates that the clip_frames input is not in the expected tensor format.
  • Solution: Verify that the input provided to clip_frames is a tensor with the correct dimensions and data type. Convert the input to a tensor if necessary before using the node.

πŸ‡ 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.

πŸ‡ Trim Batch Ends