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

Image Batch Reverse

Play a clip backwards, or make it a seamless ping-pong loop

By WASasquatch·Created 3 years ago·Updated 4 days ago· 1,844
Image Batch Reverse
  • images
  • images
  • batch_size
modereverse

Some effects are embarrassing in how simple they are. Want a clip to run backwards? Reverse the frame order. Want a loop that doesn't snap back to the start? Run it forward, then run it backwards - a ping-pong. Image Batch Reverse is a one-node home for all three variants, and the reason to use it instead of doing the same thing with array-index nodes is that the two ping-pong modes already solve the "my loop stutters" problem for you.

It's part of WAS Node Suite, WASasquatch's long-running MIT pack (v3 ships 457 nodes across image, text, mask, logic and more). The batch-manipulation family it belongs to - Ends, Split, Repeat, Reverse, Frame Sample - is where people do their video bookkeeping, and this is the simplest member.

The three modes

Feed it 8 frames. The mode dropdown decides what you get:

  • reverse - the batch played back-to-front. 8 frames in, 8 out, 8 to 1. Use it for review, for a "rewind" beat, or to mirror a motion you only captured one way.
  • ping-pong - 1 to 8, then 8 to 1: 16 frames total. This loops smoothly in direction but holds the two end frames twice (positions 8 and 9 are both frame 8), which reads as a little pause at each end of the swing. Sometimes that's exactly the organic feel you want for a pendulum or a wave.
  • ping-pong trimmed - 1 to 8, then 7 to 2: 14 frames, with the duplicated endpoints dropped. This is the one that loops at an even pace with no double frame and no stutter at the join. If the goal is an endless, seamless loop, this is your mode.

The outputs are images (the reordered frames, same size and channels) and batch_size (how many frames came out - 8, 16, or 14 from 8 in - ready to wire to a video saver or anything that needs the length). A one-frame batch comes back as itself on reverse and shows that frame twice on the two ping-pong modes.

Why you'd bother

The biggest use is loop material: a clip of a candle flame, a fan, a character breathing - something with no clean end - made endlessly repeatable by running it out and back. ping-pong trimmed gets you a loop that doesn't visibly hitch, which matters a lot more than people think until they've exported a "loop" that jumps.

The second use is a trick from the motion folks: reverse the same clip and feed both directions into an interpolation pass, and the model has a closed cycle to work from. And for video-generation chaining, reversing is how you'd play a clip's continuation from the "wrong" side without regenerating it.

Notes and gotchas

Install is the usual WAS Node Suite route: ComfyUI Manager, search "WAS Node Suite v3", or git clone https://github.com/WASasquatch/was-node-suite-comfyui into ComfyUI/custom_nodes and restart (needs ComfyUI 0.14.0+, Python 3.10+). v3 installs no Python packages - none of v2's pip-dependency baggage that used to collide with other packs.

Don't overthink which ping-pong mode you want - the difference is literally one duplicated frame at each end. If your loop will be watched for a while, A/B both and look at the endpoints; ping-pong's held ends are a feature for swing-type motion and a flaw for anything meant to read as constant speed. And remember this node reorders but never regenerates: reversed frames are the same pixels, so motion will look physically correct backwards only if the original didn't include irreversible things like gravity pulling a wave down. Reverse a splash and you've got a perfectly plausible "unsplash."

CategoryWAS Suite/Image

Inputs (2)

NameTypeDefaultDescription
imagesIMAGEThe frames to reorder, in the order they arrived. Feed it a video load, a sampler's frames, or any batch. A one-frame batch comes back as it went in, except on `ping-pong`, which shows that frame twice.
modeCOMBOreverseHow the frames are laid out. Given 8 frames: `reverse` = 8 frames, played 8 to 1; `ping-pong` = 16, 1 to 8 then 8 to 1, holding on frames 8 and 1 for two; `ping-pong trimmed` = 14, 1 to 8 then 7 to 2, which is the one that loops without a stutter.

Outputs (2)

NameTypeDescription
imagesIMAGEThe frames in their new order, same size and count of channels as they went in. Wire it to Save Video or an encoder.
batch_sizeINTHow many frames came out: 8 in gives 8 on `reverse`, 16 on `ping-pong` and 14 on `ping-pong trimmed`. Feed it to whatever downstream needs the length told to it.