ComfyUI > Nodes > DJZ-Nodes > Batch Range Swap

ComfyUI Node: Batch Range Swap

Class Name

BatchRangeSwap

Category
image/batch
Author
DriftJohnson (Account age: 4052days)
Extension
DJZ-Nodes
Latest Updated
2025-04-25
Github Stars
0.04K

How to Install DJZ-Nodes

Install this extension via the ComfyUI Manager by searching for DJZ-Nodes
  • 1. Click the Manager button in the main menu
  • 2. Select Custom Nodes Manager button
  • 3. Enter DJZ-Nodes 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

Batch Range Swap Description

Facilitates swapping image frames within batches for creative manipulation in video editing and animation workflows.

Batch Range Swap:

The BatchRangeSwap node is designed to facilitate the swapping of image frames within a batch of images, allowing you to replace a specified range of frames in a target sequence with frames from another batch. This node is particularly useful in scenarios where you need to modify or enhance specific segments of an image sequence, such as in video editing or animation workflows. By enabling the selective replacement of frames, BatchRangeSwap provides a flexible tool for creative manipulation of image sequences, allowing for seamless integration of new content into existing sequences. The node ensures that the swap operation is performed efficiently, even when dealing with large batches of images, making it an essential tool for AI artists looking to streamline their image processing tasks.

Batch Range Swap Input Parameters:

target_sequence

The target_sequence parameter represents the main batch of images that you intend to modify. It is crucial for this sequence to contain multiple images, as the node is designed to operate on batches rather than single images. The target sequence serves as the canvas where the specified range of frames will be swapped with frames from the swap_frames batch. This parameter is essential for defining the context in which the swap operation will occur.

swap_frames

The swap_frames parameter is the batch of images that you wish to use for replacing frames in the target_sequence. This batch should also contain multiple images to ensure a successful swap operation. The frames from this batch will be inserted into the target sequence, starting from the specified start_frame and continuing for the number of frames available or until the end_frame is reached. This parameter is key to introducing new content into the target sequence.

start_frame

The start_frame parameter specifies the starting index of the frame range in the target_sequence that you want to replace. It is an integer value with a default of 0, a minimum of 0, and a maximum of 999. This parameter determines where the swap operation will begin within the target sequence, allowing you to precisely control the segment of the sequence that will be modified.

end_frame

The end_frame parameter defines the ending index of the frame range in the target_sequence that you want to replace. It is an integer value with a default of 1, a minimum of 0, and a maximum of 999. This parameter, in conjunction with start_frame, establishes the boundaries of the frame range to be swapped, ensuring that the operation is confined to the desired segment of the sequence.

Batch Range Swap Output Parameters:

IMAGE

The output of the BatchRangeSwap node is a modified batch of images, represented by the IMAGE parameter. This output contains the target_sequence with the specified range of frames replaced by frames from the swap_frames batch. The result is a seamless integration of new content into the original sequence, providing a visually coherent output that reflects the intended modifications.

Batch Range Swap Usage Tips:

  • Ensure that both target_sequence and swap_frames contain multiple images to avoid warnings and ensure the node functions correctly.
  • Adjust the start_frame and end_frame parameters carefully to target the exact segment of the sequence you wish to modify, keeping in mind the available frames in the swap_frames batch.
  • Use this node in conjunction with other image processing nodes to create complex and dynamic visual effects in your projects.

Batch Range Swap Common Errors and Solutions:

Warning: Batch Range Swap node requires a batch of multiple images for target sequence

  • Explanation: This warning occurs when the target_sequence does not contain multiple images, which is necessary for the node to function properly.
  • Solution: Ensure that the target_sequence is a batch of images with more than one image.

Warning: Batch Range Swap node requires a batch of images for swap frames

  • Explanation: This warning is triggered when the swap_frames parameter does not contain a batch of images.
  • Solution: Verify that the swap_frames input is a batch containing multiple images.

Warning: Selected frame range is empty

  • Explanation: This warning indicates that the specified range between start_frame and end_frame is zero, meaning no frames will be swapped.
  • Solution: Adjust the start_frame and end_frame values to define a non-zero range for the swap operation.

Warning: Only X frames were swapped (insufficient swap frames for entire range)

  • Explanation: This warning occurs when there are not enough frames in the swap_frames batch to cover the entire specified range in the target_sequence.
  • Solution: Ensure that the swap_frames batch contains enough frames to match the range defined by start_frame and end_frame.

Batch Range Swap Related Nodes

Go back to the extension to check out more related nodes.
DJZ-Nodes
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 Playground, enabling artists to harness the latest AI tools to create incredible art.