Nodes/ComfyUI-SongLRC/Save Matching LRC
ComfyUI Node

Save Matching LRC

Naming the lyrics file after the audio that already exists

By TheAwaken1·Created 22 days ago·Updated 17 days ago· 6
Save Matching LRC
  • audio
  • audio
◄lrc—►
◄filename_prefix—►

Save Matching LRC writes the lyric file next to the song and gives it the song's name, including the same five-digit counter. Not a similar name. The identical one:

output/audio/songs/Hold The Line Tonight_00007.mp3
output/audio/songs/Hold The Line Tonight_00007.lrc

That's the whole value of this node. Any other saver can write an .lrc; only this one guarantees the two files pair up, which is what every player on earth requires to find lyrics automatically.

How it works

It doesn't write a file with a counter of its own. It goes hunting. Given a filename_prefix like audio/songs/Hold The Line Tonight, it lists the target output folder for files matching <name>_NNNNN.flac, .mp3 or .opus (case-insensitive), picks the one with the highest counter, and writes the LRC with that exact stem. So the audio file decides the name, and the LRC follows it.

Three inputs, all wired rather than typed:

  • audio - the song, straight from your audio saver.
  • lrc - the timed text, from Lyrics to LRC.
  • filename_prefix - the same string going into Save Audio (Advanced), from Song Filename.

One output: audio, passed straight through. That passthrough is the useful part - it lets this node sit in the chain rather than at the end, so you can go Save Audio (Advanced) → Save Matching LRC → Music Player (SongLRC) and play the result in the same run.

Wire it after the audio is saved, not just before it

ComfyUI executes a graph in dependency order, and this node has one job that only works if the MP3 already exists on disk. If you feed audio from the saver's AUDIO output, you get that ordering for free and it can't go wrong. If you feed it the raw audio from your decoder or from a Preview node, there's no dependency edge to the saver at all, and the LRC node may run first - at which point it finds no matching file and raises:

FileNotFoundError: No saved FLAC, MP3, or Opus found for filename prefix 'audio/songs/Hold The Line Tonight'

That error means one of three things, and it's worth checking them in this order: the audio saver ran after (re-wire audio from the saver), the prefix doesn't match what the saver actually used (both should come off the same Song Filename output), or the format isn't one it looks for.

That last one is a genuine limitation, not a bug: the match is .flac, .mp3, .opus. Save a .wav and this node can't find it. Use Save LRC (auto) instead in that case.

What it tells you

Two things, on every run. The node body shows the finished lyrics - title, then the timed lines - so you can sanity-check at a glance that the right words got timed. And the console prints the path it wrote:

[SongLRC] Saved matching LRC: audio/songs/Hold The Line Tonight_00007.lrc

The [ti:], [ar:], [length:] and [by:] header tags stay in the file where players read them rather than cluttering the node.

One saver or the other, not both

The README is blunt about this and it's worth repeating: Save Matching LRC and Save LRC (auto) do different jobs and you normally want one. Use this one whenever you're saving the song. Use the other when there's no local audio file to match, or when the audio went somewhere else. Wire both and every render writes your lyrics twice, under two names, with two counters - and the stray lyrics_00001.lrc files pile up next to your songs until you notice.

Install

Manager → search ComfyUI-SongLRC, or:

cd ComfyUI/custom_nodes
git clone https://github.com/TheAwaken1/ComfyUI-SongLRC
pip install -r ComfyUI-SongLRC/requirements.txt

numpy and soundfile only - no WhisperX needed here, since the timing happened upstream. Move your old ComfyUI-MiniMaxLRC folder out of the way if you had it, and note that this class also answers to the old name MiniMaxSaveMatchingLRC so pre-rename workflows keep loading.

Categoryaudio/SongLRC

Inputs (3)

NameTypeDefaultDescription
audioAUDIO—
lrcSTRING—
filename_prefixSTRING—

Outputs (1)

NameTypeDescription
audioAUDIO—