NanoBanana - Music Generation (Lyria)
Prompt a song out of Google's Lyria 3
- audio
Text-to-audio in ComfyUI, via Google's Lyria 3 music models. Describe the track - genre, mood, instruments, tempo - and the node returns an actual AUDIO tensor you can play, save, or feed into a video workflow as a soundtrack. It's one of the least-hyped nodes in this pack and also one of the more fun ones, because ComfyUI's audio story has historically been "load, trim, maybe do something to a voice," not "make a song from a sentence."
Two models, two trades: lyria-3-clip-preview produces ~30-second clips (the default, and the sensible starting point), and lyria-3-pro-preview is the higher-quality tier. Neither is cheap enough to spam blindly, but for "I need a 30-second ambient pad and I don't want to scour a stock library," it's remarkable.
How it works
This node doesn't use the standard Gemini SDK call - Lyria's predict endpoint is different, so the pack hits https://generativelanguage.googleapis.com/v1beta/models/{model}:predict directly with your key passed as a header (deliberately not a query parameter, so it can't leak into access logs). The response is base64 audio, which the node decodes and converts to a ComfyUI AUDIO dict - waveform tensor plus sample_rate. Output is typically 48 kHz stereo.
Inputs:
- prompt - describe the music: genre, mood, instruments, tempo. This does most of the work; be specific.
- negative_prompt - things to avoid. Lyria honors it, so "no vocals" or "no heavy bass" actually lands.
- sample_count - how many clips (1–4). Multiple samples come back as a batch.
- seed - 0 is a valid seed in this node (older versions silently dropped 0; current release honors it).
Output: audio - a standard ComfyUI AUDIO object, so it plugs into audio save/playback nodes and anything that consumes AUDIO.
Installation
Part of the NanoBanana2 pack - install once, this node's included:
cd ComfyUI/custom_nodes
git clone https://github.com/IxMxAMAR/ComfyUI-NanoBanana2
pip install google-genai
ComfyUI Manager: search NanoBanana2. Needs a Gemini API key from aistudio.google.com. Note it pulls in a small optional dependency (soundfile) for WAV decoding if available, with a raw-PCM fallback if not - nothing heavy.
Gotchas
Generation is synchronous and can take a while - the node's timeout is generous, so a 30-second clip might feel slow; that's Lyria thinking, not a hang. Your mileage on quality varies a lot with prompt detail: "upbeat" gets you elevator music, "downtempo lo-fi, warm Rhodes piano, vinyl crackle, 80 BPM" gets you something you'd actually use. And it's a paid API call per clip - sample_count multiplies the cost, so dial it down for experiments. If you get an error string that looks garbled, remember the pack redacts API keys out of error messages, which can make long responses look odd.
Inputs (7)
| Name | Type | Default | Description |
|---|---|---|---|
| api_key | STRING | — | |
| model | COMBO | lyria-3-clip-preview | 2 options: lyria-3-pro-preview, lyria-3-clip-preview |
| prompt | STRING | Describe the music (genre, mood, instruments, tempo). | |
| custom_modelopt | STRING | — | |
| negative_promptopt | STRING | — | |
| seedopt | INT | 00–2147483647 | — |
| sample_countopt | INT | 11–4 | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| audio | AUDIO | — |