Nodes/WAS Node Suite v3/Image Batch Split
ComfyUI Node Runs on cloud

Image Batch Split

Cut a batch of frames at exactly the right spot

By WASasquatch·Created 3 years ago·Updated 4 days ago· 1,844
Image Batch Split
  • images
  • at
  • head
  • tail
  • head_count
  • tail_count
out_of_rangeclamp

Every now and then you need to cut a batch of frames in two - the head goes one way, the tail goes another, and later you'll rejoin them. Maybe you're dropping an overlap frame before stitching a video continuation, maybe you're splitting a contact sheet down the middle, maybe you just want to process the first half with one denoise and the second half with another. Image Batch Split is the clean, precise knife for that, and its headline feature is one small design choice: the cut frame belongs to the tail.

That asymmetry is the whole trick. Head and tail, joined back in order, are exactly the batch you put in - nothing lost, nothing duplicated. If you've ever tried to hand-slice a batch with a math node and ended up with a duplicated or missing frame at the seam, you'll appreciate it immediately.

It's part of WAS Node Suite (WASasquatch's MIT pack, v3 ships 457 nodes). Its siblings Image Batch Ends and Image Batch Reverse handle the other edge cases in the same family, and this is the one that cuts anywhere.

The inputs that matter

  • at - where to cut, counting frames from 0. With 8 frames, at 3 gives a head of frames 0–2 and a tail of 3–7. Negative values count back from the end, so at −1 holds the last frame back on its own - that's the classic move when you need to drop an overlapping final frame before stitching a continuation onto the clip. Decimals are truncated (2.7 = 2), and it accepts INT, NUMBER or FLOAT, so you can drive it from a math chain.
  • out_of_range - what happens when at is outside 1..count−1 (or 0, which is also "outside" since it would leave the head empty). clamp (default) pulls it onto the nearest valid cut, wrap rolls it around, error stops the run with a message. The head and tail are never allowed to come out empty, so anything downstream always has a frame to read.

The four outputs - head, tail, head_count, tail_count - are what you'd expect, with the counts letting a downstream node know how many frames each side holds after clamp or wrap moved the cut.

Where you'll use it

The workflow that this node was clearly written for: video continuation. You generate a clip, hand its last frame to the next I2V pass as a seed, and the model gives back a clip whose opening frame repeats that seed. Split at −1 on the new clip, keep the tail's head... actually, the cleaner route is its sibling's without_first output. Where Split earns its keep is when you want to chop at an arbitrary interior point - say, keep frames 0–120 for one render path and 121+ for a different denoise - or when you're assembling from both ends and the overlap to drop is at the tail.

It's also handy for batching discipline in general: process a long sequence in two halves to stay inside a context window, or peel the "title card" frames you appended to a clip.

Notes

Install is standard WAS Node Suite: ComfyUI Manager → search "WAS Node Suite v3", or git clone https://github.com/WASasquatch/was-node-suite-comfyui into ComfyUI/custom_nodes, then restart. Requires ComfyUI 0.14.0+ and Python 3.10+. No extra packages - v3 deliberately installs nothing, which is a relief after the v2 days of dependency collisions.

Two gotchas worth remembering. The input batch needs at least 2 frames - a one-frame batch can't be split into two non-empty sides, so it's refused. And because at counts from 0, a cut "in the middle" of an 8-frame batch is at 4, giving 4 and 4 - not at 4 giving 5 and 3 as a 1-based count would. Count from zero, and remember the cut frame rides with the tail, and you'll never produce a doubled or missing frame again.

CategoryWAS Suite/Image

Inputs (3)

NameTypeDefaultDescription
imagesIMAGEThe batch to cut. It needs at least 2 frames, and neither side is altered: head and tail joined back together are the batch that came in.
atINT,NUMBER,FLOAT1-16384–16384Where to cut, counting frames from 0. That frame starts the tail: with 8 frames, at 3 gives head 0 to 2 and tail 3 to 7. Negative counts back from the end, so -1 holds the last frame back on its own. A decimal is truncated: 2.7 = 2.
out_of_rangeCOMBOclampA cut outside 1..count-1, where both sides keep a frame. With 4 frames and at 5: `wrap` = 2, `clamp` = 3, `error` stops the prompt. An at of 0 is outside as well: `wrap` = 3, `clamp` = 1.

Outputs (4)

NameTypeDescription
headIMAGEFrames before the cut. With 8 frames and at 3 that is frames 0, 1 and 2. Never empty, so whatever reads it always has a frame.
tailIMAGEThe cut frame and everything after it. With 8 frames and at 3 that is frames 3 to 7, so a cut at -1 answers the final frame on its own.
head_countINTHow many frames head holds, which is the cut point after clamp or wrap has moved it. Always 1 or more.
tail_countINTHow many frames tail holds, which is the batch size minus head_count. Always 1 or more.