Nodes/GigaAM (OreX)/🎛️ Audio Subtitle Aligner (OreX)
ComfyUI Node

🎛️ Audio Subtitle Aligner (OreX)

The node that makes dubbed audio actually line up

By orex2121·Created 3 months ago·Updated 12 days ago· 4
🎛️ Audio Subtitle Aligner (OreX)
  • audio_batch
  • aligned_audio
timestamps_batch

Dubbing has a dirty secret: your translated TTS clips are almost never the right length. The Russian sentence runs 40% longer than the English one, or the LLM was terser than the original and the voice cuts off three seconds early. orex-Audio-Aligner is the last node in the OreX dubbing pipeline, and its one job is fixing exactly that - stretching or squeezing each generated clip so it lands on the video's original timestamps, without the Chipmunk effect. It takes your TTS batch and your timestamp batch and hands you a single, finished, time-aligned audio track.

The name is honest about what it is. This isn't a full dubbing suite - no voice cloning, no video here. It's a glue node, the "make it fit" step. If you've ever manually re-timed audio clips in an editor by hand, you'll recognize immediately why people reach for it.

How it works

The mechanism is WSOLA time-stretching via the audiotsm library. For every line it parses the [start - end] timestamp, works out the target duration, then computes how much your generated clip needs to change: rate = actual_duration / target_duration. If that rate is meaningfully off 1.0, WSOLA stretches or compresses the audio while preserving pitch - the voice stays the same, only the timing moves. Each clip is then placed at its start time in a fresh mono track, and all the clips are summed into one waveform, normalized so nothing clips.

Two details are worth knowing because they bite. First, the rate is hard-clipped to between 0.5x and 2.0x. If your TTS audio is more than twice as long as its target slot, it doesn't fail - it just silently plays at 2x, which sounds rushed and wrong. Second, overlapping segments are mixed (added) rather than one replacing the other, so if your subtitles overlap, you get both voices on top of each other.

Inputs and outputs

Two list inputs, one output.

  • audio_batch - the AUDIO list from your TTS node, one clip per subtitle line, in order.
  • timestamps_batch - the STRING list from the Cutting Subtitles node ([mm:ss:cc - mm:ss:cc]: text lines). The node reads only the bracketed time range; the text is ignored.
  • aligned_audio - one AUDIO object, the finished track. Wire it into any Save Audio node to get your dubbed file.

The two batches must be index-aligned: element 0 of the timestamps list describes element 0 of the audio list. That's exactly the alignment the cutting node preserves, which is why this pack ships them as a pair.

Install

Part of ComfyUI-GigaAM. Manager → search "ComfyUI-GigaAM", or:

cd ComfyUI/custom_nodes
git clone https://github.com/orex2121/ComfyUI-GigaAM

Then restart. Here's the gotcha: this node needs audiotsm, and the pack's INSTALL_DEPS.bat doesn't install it - it only handles gigaam and pyannote. You'll want the README's full line:

pip install gigaam pyannote.audio audiotsm soundfile

Missing audiotsm doesn't crash the whole pack; the node just raises a clear "pip install audiotsm" error the first time you run it. Easy fix, mildly annoying way to meet it.

Where people get burned

The 0.5x–2.0x limit is the big one, and the author knows it - the README tells you to ask your LLM for more concise translations if the audio keeps coming out too long. If your final track sounds frantic, the fix is upstream in the translation, not in this node. The other classic mistake is feeding the timestamps in a different order than the audio, which shifts every clip to the wrong place; keep the two batches in the same order and you're fine. It's a small, single-purpose node - but it's the difference between a dub that looks synced and one that's clearly playing at 1.7x.

CategoryOrex Nodes 🛠️

Inputs (2)

NameTypeDefaultDescription
audio_batchAUDIO
timestamps_batchSTRING

Outputs (1)

NameTypeDescription
aligned_audioAUDIO