Nodes/comfyui-sequential-batcher/✂️ Precise Audio Slicer
ComfyUI Node

✂️ Precise Audio Slicer

The audio slicer that stays sample-accurate so your chunks don't drift

By Meisoftcoltd·Created 7 months ago·Updated 18 days ago· 3
✂️ Precise Audio Slicer
  • audio
  • sliced_audio
  • log
skip_frames
chunk_frames
fps12

When you render a long video in chunks, the audio is the part that quietly falls apart. Frame counts get padded, cuts land a few frames off, and by the end of the clip your lips are a quarter-second behind the words. This node exists so that doesn't happen.

PreciseAudioSlicer is part of the comfyui-sequential-batcher suite's "perfect audio sync" pipeline: the Video Analyzer pulls the full source track, this node carves out the exact slice matching the current video chunk, and the stitcher puts all the slices back in order at the end. The whole point is that it cuts at the sample level, not at some rounded millisecond - so a 12fps chunk that starts at frame 3,711 lands on the same millisecond of audio every time.

How it works

It's a pure math cut. Give it the full audio (a standard ComfyUI AUDIO dict with waveform and sample_rate), plus skip_frames and chunk_frames - which you should pull straight from your Auto Loop Calculator's outputs - and an fps that matches your video. It converts the frame range to absolute time (start_sec = skip_frames / fps, duration = chunk_frames / fps), then to sample indices, and slices the waveform. Two safety nets: if the slice runs past the end of the track it pads with silence to the exact length, and a global frame offset compensates for multi-scene runs so scene 2 doesn't start 30 frames late.

The inputs that matter

Only two things are yours to get right:

  • fps - must match the fps your chunk math is working in. This defaults to 12, which suits the pack's WanVideo defaults; if your video is 24fps and you don't touch it, every slice is exactly twice as long as the chunk.
  • The wire skip_frames / chunk_frames from the calculator. They're forceInput, so this node refuses to run with hardcoded values - which is honestly a feature, since hand-typing cut coordinates is how you get drift.

Outputs are sliced_audio (AUDIO) to feed your stitcher's audio port, and a log string if you're debugging.

Installing it

It ships inside comfyui-sequential-batcher, so install the pack once:

cd ComfyUI/custom_nodes
git clone https://github.com/Meisoftcoltd/comfyui-sequential-batcher

or via ComfyUI Manager (search "comfyui-sequential-batcher"), then restart. The pack's requirements cover torchaudio, which does the waveform math here - there are no extra model downloads.

Common issues

The usual failure is a mismatched fps, which produces audio that's subtly short or long per chunk. If the final video's audio drifts worse the longer the clip, that's your bug. Also: if no audio reaches it (or the track couldn't be decoded), it returns silence rather than crashing - a graceful failure, but check the log output because silent audio is easy to mistake for success. And remember the Audio Slicer only slices; the source track still has to come from the Video Analyzer upstream.

Category🔁 Sequential Batcher/Tools

Inputs (4)

NameTypeDefaultDescription
audioAUDIO
skip_framesINT
chunk_framesINT
fpsFLOAT121–120

Outputs (2)

NameTypeDescription
sliced_audioAUDIO
logSTRING