<!-- BusyBot node reference — https://busybot.net/tools/gemini-music-gen/ -->

> Node: Gemini Music Gen (`gemini_music_gen`) · Action (binary) · v1
> Category: AI · Credentials: Google AI (`googleAi`)
> Updated: 2026-08-16

# Gemini Music Gen

> Generate music using Google Lyria models via Gemini.

## Overview

Gemini Music Gen uses the Google Gemini API with Lyria models to generate music audio from a text prompt. It sends a music description with an audio response modality, receives the generated audio inline, and stores it as binary data on the output item. Results come back as WAV or MP3 files, referenced by a lightweight metadata pointer so large audio never travels through the item JSON.

**Category:** AI  
**Tool Name:** `gemini_music_gen`  
**Version:** 1

**Appearance:** Icon: `gemini` | Color: `#ffffff`

## Node Type

**Action (Binary)** — handles file/binary data operations

## Input / Output

| Direction | Port(s) |
|-----------|--------|
| Input | `Input` |
| Output | `Output`, `Error` |

## Credentials

This tool requires **Google AI** credentials.
See the [Credentials Guide](https://busybot.net/credentials/google-ai/) for setup instructions.

### Parameters

| Parameter | Type | Required | Default | Description |
|-----------|------|----------|---------|-------------|
| Model | `options` | No | — | The Lyria model to use for music generation. The dropdown lists the models currently available for this node; leave it unset to use the default. |
| Prompt | `string` | Yes | — | Text description of the music to generate. Describe genre, mood, instruments, tempo, etc. If empty, falls back to the input item's "prompt" field. Supports expressions. |
| Options | `collection` | No | `{}` | Optional generation settings. |
| — Binary Property Name | `string` | No | `data` | The name of the binary property where the generated audio file will be stored. Names are case-sensitive — see the upstream node's Binary Data panel for the exact names to use. |
| Include Input | `boolean` | No | `false` | Whether to include the original input item fields in the output alongside the generated audio. |
| Max Concurrency | `number` | No | `5` | Maximum number of items to process concurrently. |

## Output Data

One output item per input item. The audio file is written to the binary property named by **Binary Property Name** (default `data`) as `music.wav`, `music.mp3` or `music.ogg` depending on what the model returns. Binary data arriving from upstream is preserved.

The output item's JSON contains only the fields below. The input item's JSON is merged in **only** when Include Input is on:

| Field | Description |
|-------|-------------|
| `model` | The model that generated the audio. |
| `prompt` | The prompt actually used, after expressions were resolved and any fallback to the item's own `prompt` field. |
| `mimeType` | Media type of the stored audio. |
| `fileSize` | Size of the stored audio in bytes. |
| `finishReason` | Why generation stopped, when the model reports one. |

A request that comes back without audio is treated as an item error rather than a silent empty result.

Reference the result downstream by expression, e.g. `{{ $json.fileSize }}`, and the audio itself through the binary property name you configured.

## Usage Examples

- Generate a calm lo-fi hip hop beat
- Create an upbeat electronic dance track
- Compose ambient background music for a video
- Produce a jazz piano piece with brush drums
- Generate a cinematic orchestral score

## Example Configuration

Generate a clip with the defaults:

```json
{
  "type": "gemini_music_gen",
  "parameters": {
    "prompt": "Relaxing acoustic guitar fingerpicking, slow tempo, warm tone"
  }
}
```

A cinematic clip stored under its own binary property:

```json
{
  "type": "gemini_music_gen",
  "parameters": {
    "prompt": "Epic cinematic orchestral music with dramatic brass, sweeping strings, and powerful percussion",
    "includeInput": true,
    "maxConcurrency": 3,
    "options": {
      "binaryPropertyName": "audioClip"
    }
  }
}
```

Take the description from each item — leave Prompt empty and the node reads the item's own `prompt` field:

```json
{
  "type": "gemini_music_gen",
  "parameters": {
    "prompt": "",
    "includeInput": true,
    "maxConcurrency": 2,
    "options": {
      "binaryPropertyName": "backgroundMusic"
    }
  }
}
```

### Error Handling

| Mode | Behavior |
|------|----------|
| **stop** | Halts workflow on first error |
| **continue** | Skips failed items, passes successful ones through |
| **errorPort** | Routes failed items to Error output port |

## Tips

Gemini Music Gen generates original music audio from text prompts by calling the Google Gemini API with Lyria models using the audio output modality. Use this tool when a workflow needs to produce scored audio, background music, or soundscapes derived from a natural-language description. It outputs a lightweight metadata pointer referencing base64-decoded WAV or MP3 binary audio data stored in the binary store. Clip length is not configurable — the Lyria request carries no duration field, so length is whatever the model returns for the prompt.