Nodes/DJZ-Nodes/Batch Thief
ComfyUI Node

Batch Thief

Steal a frame range out of a sequence

By MushroomFleet·Created 2 years ago·Updated 5 months ago· 78
Batch Thief
  • images
  • IMAGE
start_frame0
end_frame1

BatchThief is the extract-and-isolate node of the DJZ batch family. It takes one batch of images and carves out a range of frames - start_frame to end_frame - returning just those frames as a new IMAGE batch. Named after the idea that you're "stealing" a section out of a sequence. It's the exact inverse of BatchRangeInsert (which splices frames into a sequence), and it's the node you reach for when you need to pull a shot, a loop, or a few frames of reference out of a longer render.

Three inputs, all obvious: images, start_frame (default 0), and end_frame (default 1). The one thing to internalize before anything else: end_frame is exclusive. start_frame = 0, end_frame = 5 gives you frames 0 through 4 - five frames. This is the off-by-one that trips everyone coming from the inclusive conventions elsewhere (ironically, the sibling BatchRangeInsert uses an inclusive range, so you really do have to check each node). With start_frame = 10, end_frame = 15 you get frames 10–14.

The safety behavior is forgiving to the point of being silent: negative start_frame clamps to 0, end_frame past the batch length caps at the batch size, and if start_frame >= end_frame you get a warning plus a single empty frame so the graph doesn't crash mid-pipeline. That last one is worth knowing - an empty batch would break downstream nodes, so the author chose to return a dummy frame instead of erroring. If your "stolen" output is one weird blank frame, your range was backwards or empty.

Why you'd actually use this in an AI workflow: video is where it shines. You generated 300 frames, and either you only want frames 40–70 for a specific loop, or you want to run an expensive upscale/pass on a subset first to test parameters before committing to the whole clip, or you need a few frames pulled out as stills for QC. It's also the standard building block for the "extract → modify → reinsert" pattern with BatchRangeInsert - steal a range, run it through a heavy node, splice the result back. That trio (Thief, Insert, Offset) is a complete frame-editing kit that stays entirely inside ComfyUI.

The honest caveat: it's a dumb slice - no easing, no frame interpolation, no "every nth frame" option. If you want to decimate a clip (keep every 5th frame) or pull a range with blending, this isn't the node; it only does contiguous ranges. And while the indices are clamped for safety, there's no explicit feedback if your range was silently truncated by hitting the batch edge - check your frame count against what you expected.

No models, no downloads, pure tensor slicing, and one of the lightest nodes in the DJZ pack. Install: ComfyUI Manager → "DJZ-Nodes", or cd ComfyUI/custom_nodes && git clone https://github.com/MushroomFleet/DJZ-Nodes && pip install -r requirements.txt.

Categoryimage/batch

Inputs (3)

NameTypeDefaultDescription
imagesIMAGE
start_frameINT00–999
end_frameINT10–999

Outputs (1)

NameTypeDescription
IMAGEIMAGE