Nodes/comfyui_epub_tts/Combine Audio → Single File
ComfyUI Node

Combine Audio → Single File

Gluing Every TTS Part Into One Listenable File

By kallama·Created 7 months ago·Updated 7 months ago· 0
Combine Audio → Single File
  • audio
  • audio

Every audiobook pipeline ends the same way: your TTS produced audio for dozens or hundreds of text chunks, and now you have a pile of clips instead of a book. CombineAudioToSingle is the bookend of the comfyui_epub_tts pack - it takes that whole pile of AUDIO segments and concatenates them end-to-end into one track you can actually export and listen to.

It's the yin to AddSilenceToAudioBatch's yang. That node gives each clip a trailing pause; this one stitches them together in order. Run them in sequence - silence on the front, combine on the back - and a book's worth of TTS output becomes a single continuous file.

How it works

The one thing that makes this node work is a flag you never see: INPUT_IS_LIST = True. It tells ComfyUI to pass every audio connection in as a list at once, so you can run a dozen clips from a batch into the single audio input and the node receives them all together. That's the whole design - no loops, no batching tricks, no queue node required.

Internally it flattens whatever arrives (a single dict, a list, nested lists), verifies every item shares a sample rate - mismatched rates throw a ValueError, same as the sibling node - then splits each item's internal batch into its individual [channels, samples] segments and concatenates them along the time axis. The output audio is one [1, channels, total_samples] tensor with the same sample rate and channel count as the input. In other words: order preserved, gaps preserved (whatever silence you added upstream stays), just glued together.

The inputs that matter

There's exactly one input: audio, of type AUDIO, marked as list. You can feed it the whole batch of TTS output directly, or chain it after AddSilenceToAudioBatch. The single audio output is ready for a save/export node - note the pack stops here, at AUDIO; the final step of writing an actual .mp3/.wav to disk is done by whatever audio export node you already have (the core SaveAudio-style nodes or a TTS/audio suite will do).

Install

Identical to the rest of the pack - it ships in the same repo, so ComfyUI Manager (search comfyui_epub_tts) or:

cd ComfyUI/custom_nodes
git clone https://github.com/kallama/comfyui_epub_tts

then restart. Nothing extra to download: the pack's only dependencies are ebooklib, bs4, and trafilatura, and this node in particular doesn't even touch them. Realistically the only thing that trips people up is feeding it clips at different sample rates - if the TTS model or a post-processing node changed the rate partway through, combine refuses rather than producing a garbled file, and you should resample upstream. That's a feature, honestly.

CategoryEPUB TTS

Inputs (1)

NameTypeDefaultDescription
audioAUDIO

Outputs (1)

NameTypeDescription
audioAUDIO