Lyric Slice By Time
The node that finally answers 'what are they singing right here?'
- text
- lrc
- info
The reason you aligned a whole song in the first place is usually this: you have a time window - a clip that starts at 29.5 seconds and runs 7 seconds - and you want the exact lines being sung in it. LyricSliceByTime is that lookup. It takes the alignment JSON from LyricForcedAlign plus a start and a duration, and hands back the ground-truth lines covering that window. Because the answer is chosen by time, a repeated chorus is never ambiguous: the same lyric line at second 29 and at second 48 comes back as two separate, correctly-timed entries.
Inputs that matter
- alignment (STRING): the JSON output of LyricForcedAlign. Nothing else works here - this node doesn't align, it queries an existing alignment.
- start_index (FLOAT, seconds): clip start. Negative counts back from the end, the same convention as TrimAudioDuration -
-30starts 30 seconds before the track ends. - duration (FLOAT, seconds): how long the window is.
- mode:
overlap(default) keeps a line if enough of it falls inside the window;containedkeeps only lines that fit entirely inside. - min_overlap (FLOAT, seconds, default 0.3): the one that saves you. In overlap mode a line counts only if at least this many seconds of it sit in the window. Without it, a line that starts 0.08 s before the window ends is "in" the clip while the audio holds barely a syllable of it. Set 0 to restore bare any-overlap.
- rebase_lrc (BOOLEAN, default on): retimes the LRC so timestamps are relative to the clip start. Leave it on unless you specifically want track-absolute times.
How it works
Plain window math. It computes [start, start + duration], then filters the alignment's lines by overlap or containment. Nothing clever, and that's the point - it's deterministic, instant, and reruns any time you nudge the knobs.
Outputs
- text: the lines for the window, joined. Wire into a caption node, a subtitle pass, SaveText.
- lrc: the same lines as a rebased LRC file starting at 00:00.
- info: a one-liner saying which window you queried and how many of the song's lines landed in it.
Where it fits
It pairs with TrimAudioDuration: slice the alignment for the same window you cut the audio with, and you've got clip-plus-correct-text as one consistent pair. That's the whole workflow for "give me the lyrics for this exact 7-second clip" - a one-wire query instead of a manual scroll through the song.
Install and gotchas
Same pack as LyricForcedAlign - ComfyUI Manager search "comfyui_lyric_align" or git clone https://github.com/bmad4ever/comfyui_lyric_align into custom_nodes, restart, and the shared dependencies (torchaudio + rapidfuzz) cover it. This node itself is pure string math, so it's the cheapest thing in the pack.
If a line you expected is missing, check the mode. contained is strict and drops any line that crosses a boundary - switch to overlap with the default 0.3 s overlap if you want edge lines included.
Inputs (6)
| Name | Type | Default | Description |
|---|---|---|---|
| alignment | STRING | — | |
| start_index | FLOAT | 0.00-100000–100000 | Clip start in seconds. Negative counts back from the end - same convention as TrimAudioDuration. |
| duration | FLOAT | 30.000–100000 | — |
| modeopt | COMBO | overlap | overlap: keep a line if enough of it falls in the window (see min_overlap). contained: only lines that fit entirely inside. |
| min_overlapopt | FLOAT | 0.300–60 | Seconds of a line that must sit inside the window for it to count, in overlap mode. Without this a line starting 0.08 s before the window ends is 'in' the clip while the audio holds barely a syllable of it. 0 restores bare any-overlap. |
| rebase_lrcopt | BOOLEAN | true | Make the LRC timestamps relative to the clip start rather than the full track. |
Outputs (3)
| Name | Type | Description |
|---|---|---|
| text | STRING | — |
| lrc | STRING | — |
| info | STRING | — |