User supplied tracks
Count the real number of talk tracks across two speakers
- totalTracks
If you've got a two-speaker video and you're generating it chunk by chunk, there's a number you'll need a hundred times: how many segments are there total, so your loop knows when to stop and your progress bar knows what "done" means. TKTotalTracksInAudio answers that from the two track lists the pack's speaker extraction produces - no manual counting, no off-by-one errors when the conversation jumps around.
The display name is "User supplied tracks," and the description says it plainly: "Get the total talk tracks between the 2 Speakers." It's the accounting node of the speaker pipeline, and it's a genuinely thin one - which is fine, because its whole job is to be right.
How it works
It takes two strings - combinedTrackInfo1 (tooltip: "Speaker 1 defined track times") and combinedTrackInfo2 - each a comma-separated list of start,end times in seconds, one pair per talk track. It feeds both into the pack's own extractor logic, which merges them, sorts by start time, drops empty 0,0 padding pairs, and then counts the resulting tracks.
Two behaviors are worth knowing because they're deliberate. First, the count stops at the first 0,0 pair - the extractor treats that as "data ends here," so a trailing pad won't inflate your count. Second, it validates the timings strictly: if any pair has start >= end or a negative value, it prints CRITICAL ERROR to the console and returns 0, deliberately blocking downstream processing rather than silently generating garbage. That's the kind of fail-fast you want in a long loop, even if it reads scary the first time it fires.
The inputs that matter
Just the two. Both are forceInput strings, meaning you can't type them - you have to wire them in from wherever your track data lives. That's the author making sure you feed it the real track lists and not a hand-typed guess. Wire speaker 1's list into combinedTrackInfo1 and speaker 2's into combinedTrackInfo2.
Outputs
One integer: totalTracks. That's it. Feed it into your loop's for range or a counter node so every chunk knows where it sits in the sequence - which is exactly what lets TKSpeakerDataFromTrack pick the right prompt and start image per track downstream.
Install
Standard for the pack: ComfyUI Manager, search "Handy Nodes", install, restart.
cd ComfyUI/custom_nodes
git clone https://github.com/trashkollector/TKNodes
Restart ComfyUI. Like the other speaker-side nodes, it shares the pack's heavier dependencies (sherpa-onnx, plus FFmpeg on PATH for audio files), and the first speaker-detection run triggers a one-time download of the ONNX diarization models into ComfyUI/models/onnx/. But this specific node is pure string math - it needs nothing of its own. If you get 0 back unexpectedly, it's not the node being broken; it's almost always invalid timings in your track data, and the console message will tell you exactly which pair it hates.
Inputs (2)
| Name | Type | Default | Description |
|---|---|---|---|
| combinedTrackInfo1 | STRING | Speaker 1 defined track times | |
| combinedTrackInfo2 | STRING | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| totalTracks | INT | — |