Lyrics Video Generator
Karaoke for your AI songs, without ever opening a video editor
- image
- audio
Karaoke for your own AI songs. Feed Lyrics Video Generator a track, a background image, and the words, and it hands you back an MP4 where the lyrics scroll up over the image, timed to end exactly when the audio does. No video editor, no keyframing, no babysitting - it's a single node from the ComfyUI Audio Expo pack, and it does one thing cleanly.
Why you'd want it: video generation got good enough to want a soundtrack, and music generation (ACE-Step and friends, native in ComfyUI) got good enough to supply one - but nobody had a graceful way to put the two together into something you'd actually post. This is that glue. Render a song, feed it a nice still or a frame from a video model, paste the lyrics, and out comes a scrolling-lyrics clip that matches the music's duration. It's the "infinite karaoke" half of the pack's pitch.
How it works
It's smarter than a naive "draw text on every frame" node. First it pre-renders your whole lyrics block once into a single transparent "text strip" image with Pillow - measuring every line, applying the outline stroke - then per frame it just alpha-composites that strip over the background at a moving offset. Pre-multiplied alpha, precomputed weights, no per-frame font rendering. It even reports render progress back into the ComfyUI UI via proglog. MoviePy writes the result as MP4 (libx264 + aac, 24fps, ultrafast preset, using all your cores).
The timing logic is the nice part. With auto_speed on (the default), it works out how far the text has to travel to scroll from the bottom of the frame to fully off the top, divides by the audio duration, and sets the pixel-per-second speed so the last line exits right as the music ends. Turn auto_speed off and scroll_speed takes over as a manual pixels-per-second value.
The inputs that matter
image- the background, first image of the batch.audio- theAUDIOtensor; the video's duration comes from this.lyrics- multiline text. Required. Leaving the placeholder raises aValueError.font_size(10–200),font_color,outline_size(0–20),outline_color- the look. Colors take hex codes or names.auto_speed/scroll_speed- timing, as above.filename_prefix- defaultvideo/LyricsVideo→output/video/LyricsVideo_00001_.mp4.play_in_player/player- optional, off by default; opens the MP4 in your player when the render finishes.
No outputs - it's a terminal node. The MP4 is the output.
Installing it
Same pack as the other two Audio Expo nodes:
cd ComfyUI/custom_nodes
git clone https://github.com/mattjohnpowell/comfyui-audio-expo
cd comfyui-audio-expo
pip install -r requirements.txt
Use the Python environment ComfyUI runs (portable: python_embeded). MoviePy is the heavy dependency here - it's what pulls in imageio-ffmpeg for the encode. ComfyUI Manager → "Install via Git URL" with the repo URL also works; restart after.
Where people get burned
Two gotchas, both visible in the source. First, the font: it tries arial.ttf and falls back to Pillow's built-in bitmap font if Arial isn't on the system. On Linux and most containers, Arial isn't there - so you set font_size to 80 and get the tiny default font back, and it looks broken. Install a real TTF (or point your system at one) before blaming the node. Second, the placeholder text: lyrics defaults to "Enter lyrics here...", and the node refuses to run if that's what you send it - an easy "why is this erroring" moment on first try. Fill in actual lyrics and it just works.
Inputs (12)
| Name | Type | Default | Description |
|---|---|---|---|
| image | IMAGE | — | |
| audio | AUDIO | — | |
| lyrics | STRING | Enter lyrics here... | — |
| font_size | INT | 4010–200 | — |
| font_color | STRING | white | — |
| outline_size | INT | 20–20 | — |
| outline_color | STRING | black | — |
| scroll_speed | INT | 501–500 | — |
| auto_speed | BOOLEAN | true | — |
| filename_prefix | STRING | video/LyricsVideo | — |
| play_in_playeropt | BOOLEAN | false | — |
| playeropt | COMBO | Auto | 4 options: Auto, VLC, mpv, System Default |
Outputs (0)
No outputs