Extract nTh Audio track
Pull one speaker's dialogue out of the full mix, LTX-ready
- fullaudio
- audioTrack
- totalTracks
- numFrames
- speakerNum
- front_pad_ms
- end_pad_ms
The speaker workflow in this pack is a loop: figure out who talks when, then generate each speaker's video segment separately with its own prompt and reference image. Extract nTh Audio track is the loop's audio body - given the full mixed audio, the track timings, and an index, it slices out exactly that one speaker's dialogue, pads it the way LTX wants, and hands back both the audio and the frame count you should generate for that segment. It's the node that turns "diarization data" into "an actual generation pass."
How it works
It needs the full audio plus the timing strings that the rest of the pack produces - combinedTrackInfo1 and combinedTrackInfo2 (the comma-separated start,end lists from TKAudioSpeakerTalkTime or TKLocateSpeakersUsingSilenceBreaks). Internally it merges and sorts both speakers' tracks by start time into one combined timeline, then index (1-based) picks which track to extract. It slices the waveform for that track's window and, when padAudioForLtx is on (default), appends 500ms of silence to the end - the tooltip explains it's to help lip sync, giving the mouth-movement a moment to settle. The optional addBreathNoise flag prepends a real human-breath sample (a bundled breather.wav asset) and a bit more padding, which the author says increases the odds of lip sync working.
It's opinionated about the target: it assumes 25 fps for the video (the numFrames calc uses ×25), and the padding/breath logic is explicitly LTX-oriented.
The inputs that matter
fullaudio- the masterAUDIO.combinedTrackInfo1/combinedTrackInfo2- the timing strings for speaker 1 and 2.index- which track (1-based) to pull this pass, from your loop.padAudioForLtx- keep it on for LTX; turn off if you want raw, unpadded audio.addBreathNoise- the lip-sync booster, off by default.
Outputs
Six sockets, three of which matter: audioTrack (the extracted, padded audio - wire into your video/audio generation), numFrames (the frame count to generate for this segment), and speakerNum (1 or 2, which is how downstream nodes pick the right prompt/reference image - see TKSpeakerDataFromTrack in the pack). totalTracks, front_pad_ms, and end_pad_ms are bookkeeping (totals and pad amounts for trimming later).
Common issues
The timing strings are unforgiving - get a start/end out of order or beyond the audio's length and the node throws explicit errors like "your timings exceeds the Audio Length" rather than silently clipping. That's a feature: fix the timings, don't fight it. Second: it merges and sorts both speakers into one timeline, so the index is across all tracks, not per-speaker - index 2 might be speaker 1's second line if speaker 2's first line sorts earlier. And if you enable addBreathNoise, the extra padding changes numFrames and adds front_pad_ms you're expected to trim later - it's not free.
Installing it
Part of trashkollector/TKNodes ("ComfyUI Handy Nodes"). Install via ComfyUI Manager (search "Handy Nodes") or:
cd ComfyUI/custom_nodes
git clone https://github.com/trashkollector/TKNodes
Restart. Uses torchaudio + the bundled breath asset - no model downloads; pydub/FFmpeg apply if you feed compressed audio.
Inputs (6)
| Name | Type | Default | Description |
|---|---|---|---|
| fullaudio | AUDIO | — | |
| combinedTrackInfo1 | STRING | Speaker 1 track info. | |
| combinedTrackInfo2 | STRING | Speaker 2 track info. | |
| padAudioForLtx | BOOLEAN | true | pad audio track with silence..helps lip sync. |
| index | INT | 11–10 | the track number from ALL tracks |
| addBreathNoiseopt | BOOLEAN | false | This will add human breath to start of audio, turn this ON increases chances of lip sync working. |
Outputs (6)
| Name | Type | Description |
|---|---|---|
| audioTrack | AUDIO | — |
| totalTracks | INT | — |
| numFrames | INT | — |
| speakerNum | INT | — |
| front_pad_ms | INT | — |
| end_pad_ms | INT | — |