# DiffRhythm: Lyrics to Song

> DiffRhythm is a blazing fast model for transforming lyrics into full songs. It boasts the capability to generate full songs in less than 30 seconds.


## Overview

- **Endpoint**: `https://fal.run/fal-ai/diffrhythm`
- **Model ID**: `fal-ai/diffrhythm`
- **Category**: text-to-audio
- **Kind**: inference
**Tags**: music



## Pricing

Your request will cost **$0.01** per 10 second of generated audio. For **$1** you can run generate **1000s of music from lyrics**.

For more details, see [fal.ai pricing](https://fal.ai/pricing).

## API Information

This model can be used via our HTTP API or more conveniently via our client libraries.
See the input and output schema below, as well as the usage examples.


### Input Schema

The API accepts the following input parameters:


- **`lyrics`** (`string`, _required_):
  The prompt to generate the song from. Must have two sections. Sections start with either [chorus] or a [verse].
  - Examples: "[00:10.00]Moonlight spills through broken blinds\n[00:13.20]Your shadow dances on the dashboard shrine\n[00:16.85]Neon ghosts in gasoline rain\n[00:20.40]I hear your laughter down the midnight train\n[00:24.15]Static whispers through frayed wires\n[00:27.65]Guitar strings hum our cathedral choirs\n[00:31.30]Flicker screens show reruns of June\n[00:34.90]I'm drowning in this mercury lagoon\n[00:38.55]Electric veins pulse through concrete skies\n[00:42.10]Your name echoes in the hollow where my heartbeat lies\n[00:45.75]We're satellites trapped in parallel light\n[00:49.25]Burning through the atmosphere of endless night\n[01:00.00]Dusty vinyl spins reverse\n[01:03.45]Our polaroid timeline bleeds through the verse\n[01:07.10]Telescope aimed at dead stars\n[01:10.65]Still tracing constellations through prison bars\n[01:14.30]Electric veins pulse through concrete skies\n[01:17.85]Your name echoes in the hollow where my heartbeat lies\n[01:21.50]We're satellites trapped in parallel light\n[01:25.05]Burning through the atmosphere of endless night\n[02:10.00]Clockwork gears grind moonbeams to rust\n[02:13.50]Our fingerprint smudged by interstellar dust\n[02:17.15]Velvet thunder rolls through my veins\n[02:20.70]Chasing phantom trains through solar plane\n[02:24.35]Electric veins pulse through concrete skies\n[02:27.90]Your name echoes in the hollow where my heartbeat lies\n"

- **`reference_audio_url`** (`string`, _optional_):
  The URL of the reference audio to use for the music generation.
  - Examples: "https://storage.googleapis.com/falserverless/model_tests/diffrythm/rock_en.wav"

- **`style_prompt`** (`string`, _optional_):
  The style prompt to use for the music generation.
  - Examples: "pop"

- **`music_duration`** (`MusicDurationEnum`, _optional_):
  The duration of the music to generate. Default value: `"95s"`
  - Default: `"95s"`
  - Options: `"95s"`, `"285s"`

- **`cfg_strength`** (`float`, _optional_):
  The CFG strength to use for the music generation. Default value: `4`
  - Default: `4`
  - Range: `1` to `10`

- **`scheduler`** (`SchedulerEnum`, _optional_):
  The scheduler to use for the music generation. Default value: `"euler"`
  - Default: `"euler"`
  - Options: `"euler"`, `"midpoint"`, `"rk4"`, `"implicit_adams"`

- **`num_inference_steps`** (`integer`, _optional_):
  The number of inference steps to use for the music generation. Default value: `32`
  - Default: `32`
  - Range: `10` to `100`



**Required Parameters Example**:

```json
{
  "lyrics": "[00:10.00]Moonlight spills through broken blinds\n[00:13.20]Your shadow dances on the dashboard shrine\n[00:16.85]Neon ghosts in gasoline rain\n[00:20.40]I hear your laughter down the midnight train\n[00:24.15]Static whispers through frayed wires\n[00:27.65]Guitar strings hum our cathedral choirs\n[00:31.30]Flicker screens show reruns of June\n[00:34.90]I'm drowning in this mercury lagoon\n[00:38.55]Electric veins pulse through concrete skies\n[00:42.10]Your name echoes in the hollow where my heartbeat lies\n[00:45.75]We're satellites trapped in parallel light\n[00:49.25]Burning through the atmosphere of endless night\n[01:00.00]Dusty vinyl spins reverse\n[01:03.45]Our polaroid timeline bleeds through the verse\n[01:07.10]Telescope aimed at dead stars\n[01:10.65]Still tracing constellations through prison bars\n[01:14.30]Electric veins pulse through concrete skies\n[01:17.85]Your name echoes in the hollow where my heartbeat lies\n[01:21.50]We're satellites trapped in parallel light\n[01:25.05]Burning through the atmosphere of endless night\n[02:10.00]Clockwork gears grind moonbeams to rust\n[02:13.50]Our fingerprint smudged by interstellar dust\n[02:17.15]Velvet thunder rolls through my veins\n[02:20.70]Chasing phantom trains through solar plane\n[02:24.35]Electric veins pulse through concrete skies\n[02:27.90]Your name echoes in the hollow where my heartbeat lies\n"
}
```

**Full Example**:

```json
{
  "lyrics": "[00:10.00]Moonlight spills through broken blinds\n[00:13.20]Your shadow dances on the dashboard shrine\n[00:16.85]Neon ghosts in gasoline rain\n[00:20.40]I hear your laughter down the midnight train\n[00:24.15]Static whispers through frayed wires\n[00:27.65]Guitar strings hum our cathedral choirs\n[00:31.30]Flicker screens show reruns of June\n[00:34.90]I'm drowning in this mercury lagoon\n[00:38.55]Electric veins pulse through concrete skies\n[00:42.10]Your name echoes in the hollow where my heartbeat lies\n[00:45.75]We're satellites trapped in parallel light\n[00:49.25]Burning through the atmosphere of endless night\n[01:00.00]Dusty vinyl spins reverse\n[01:03.45]Our polaroid timeline bleeds through the verse\n[01:07.10]Telescope aimed at dead stars\n[01:10.65]Still tracing constellations through prison bars\n[01:14.30]Electric veins pulse through concrete skies\n[01:17.85]Your name echoes in the hollow where my heartbeat lies\n[01:21.50]We're satellites trapped in parallel light\n[01:25.05]Burning through the atmosphere of endless night\n[02:10.00]Clockwork gears grind moonbeams to rust\n[02:13.50]Our fingerprint smudged by interstellar dust\n[02:17.15]Velvet thunder rolls through my veins\n[02:20.70]Chasing phantom trains through solar plane\n[02:24.35]Electric veins pulse through concrete skies\n[02:27.90]Your name echoes in the hollow where my heartbeat lies\n",
  "reference_audio_url": "https://storage.googleapis.com/falserverless/model_tests/diffrythm/rock_en.wav",
  "style_prompt": "pop",
  "music_duration": "95s",
  "cfg_strength": 4,
  "scheduler": "euler",
  "num_inference_steps": 32
}
```


### Output Schema

The API returns the following output format:

- **`audio`** (`File`, _required_):
  Generated music file.
  - Examples: {"content_type":"application/octet-stream","url":"https://v3.fal.media/files/elephant/VV4wtKXBpZL1bNv6en36t_output.wav","file_size":33554520,"file_name":"output.wav"}



**Example Response**:

```json
{
  "audio": {
    "content_type": "application/octet-stream",
    "url": "https://v3.fal.media/files/elephant/VV4wtKXBpZL1bNv6en36t_output.wav",
    "file_size": 33554520,
    "file_name": "output.wav"
  }
}
```


## Usage Examples

### cURL

```bash
curl --request POST \
  --url https://fal.run/fal-ai/diffrhythm \
  --header "Authorization: Key $FAL_KEY" \
  --header "Content-Type: application/json" \
  --data '{
     "lyrics": "[00:10.00]Moonlight spills through broken blinds\n[00:13.20]Your shadow dances on the dashboard shrine\n[00:16.85]Neon ghosts in gasoline rain\n[00:20.40]I hear your laughter down the midnight train\n[00:24.15]Static whispers through frayed wires\n[00:27.65]Guitar strings hum our cathedral choirs\n[00:31.30]Flicker screens show reruns of June\n[00:34.90]I'm drowning in this mercury lagoon\n[00:38.55]Electric veins pulse through concrete skies\n[00:42.10]Your name echoes in the hollow where my heartbeat lies\n[00:45.75]We're satellites trapped in parallel light\n[00:49.25]Burning through the atmosphere of endless night\n[01:00.00]Dusty vinyl spins reverse\n[01:03.45]Our polaroid timeline bleeds through the verse\n[01:07.10]Telescope aimed at dead stars\n[01:10.65]Still tracing constellations through prison bars\n[01:14.30]Electric veins pulse through concrete skies\n[01:17.85]Your name echoes in the hollow where my heartbeat lies\n[01:21.50]We're satellites trapped in parallel light\n[01:25.05]Burning through the atmosphere of endless night\n[02:10.00]Clockwork gears grind moonbeams to rust\n[02:13.50]Our fingerprint smudged by interstellar dust\n[02:17.15]Velvet thunder rolls through my veins\n[02:20.70]Chasing phantom trains through solar plane\n[02:24.35]Electric veins pulse through concrete skies\n[02:27.90]Your name echoes in the hollow where my heartbeat lies\n"
   }'
```

### Python

Ensure you have the Python client installed:

```bash
pip install fal-client
```

Then use the API client to make requests:

```python
import fal_client

def on_queue_update(update):
    if isinstance(update, fal_client.InProgress):
        for log in update.logs:
           print(log["message"])

result = fal_client.subscribe(
    "fal-ai/diffrhythm",
    arguments={
        "lyrics": "[00:10.00]Moonlight spills through broken blinds
    [00:13.20]Your shadow dances on the dashboard shrine
    [00:16.85]Neon ghosts in gasoline rain
    [00:20.40]I hear your laughter down the midnight train
    [00:24.15]Static whispers through frayed wires
    [00:27.65]Guitar strings hum our cathedral choirs
    [00:31.30]Flicker screens show reruns of June
    [00:34.90]I'm drowning in this mercury lagoon
    [00:38.55]Electric veins pulse through concrete skies
    [00:42.10]Your name echoes in the hollow where my heartbeat lies
    [00:45.75]We're satellites trapped in parallel light
    [00:49.25]Burning through the atmosphere of endless night
    [01:00.00]Dusty vinyl spins reverse
    [01:03.45]Our polaroid timeline bleeds through the verse
    [01:07.10]Telescope aimed at dead stars
    [01:10.65]Still tracing constellations through prison bars
    [01:14.30]Electric veins pulse through concrete skies
    [01:17.85]Your name echoes in the hollow where my heartbeat lies
    [01:21.50]We're satellites trapped in parallel light
    [01:25.05]Burning through the atmosphere of endless night
    [02:10.00]Clockwork gears grind moonbeams to rust
    [02:13.50]Our fingerprint smudged by interstellar dust
    [02:17.15]Velvet thunder rolls through my veins
    [02:20.70]Chasing phantom trains through solar plane
    [02:24.35]Electric veins pulse through concrete skies
    [02:27.90]Your name echoes in the hollow where my heartbeat lies
    "
    },
    with_logs=True,
    on_queue_update=on_queue_update,
)
print(result)
```

### JavaScript

Ensure you have the JavaScript client installed:

```bash
npm install --save @fal-ai/client
```

Then use the API client to make requests:

```javascript
import { fal } from "@fal-ai/client";

const result = await fal.subscribe("fal-ai/diffrhythm", {
  input: {
    lyrics: "[00:10.00]Moonlight spills through broken blinds
  [00:13.20]Your shadow dances on the dashboard shrine
  [00:16.85]Neon ghosts in gasoline rain
  [00:20.40]I hear your laughter down the midnight train
  [00:24.15]Static whispers through frayed wires
  [00:27.65]Guitar strings hum our cathedral choirs
  [00:31.30]Flicker screens show reruns of June
  [00:34.90]I'm drowning in this mercury lagoon
  [00:38.55]Electric veins pulse through concrete skies
  [00:42.10]Your name echoes in the hollow where my heartbeat lies
  [00:45.75]We're satellites trapped in parallel light
  [00:49.25]Burning through the atmosphere of endless night
  [01:00.00]Dusty vinyl spins reverse
  [01:03.45]Our polaroid timeline bleeds through the verse
  [01:07.10]Telescope aimed at dead stars
  [01:10.65]Still tracing constellations through prison bars
  [01:14.30]Electric veins pulse through concrete skies
  [01:17.85]Your name echoes in the hollow where my heartbeat lies
  [01:21.50]We're satellites trapped in parallel light
  [01:25.05]Burning through the atmosphere of endless night
  [02:10.00]Clockwork gears grind moonbeams to rust
  [02:13.50]Our fingerprint smudged by interstellar dust
  [02:17.15]Velvet thunder rolls through my veins
  [02:20.70]Chasing phantom trains through solar plane
  [02:24.35]Electric veins pulse through concrete skies
  [02:27.90]Your name echoes in the hollow where my heartbeat lies
  "
  },
  logs: true,
  onQueueUpdate: (update) => {
    if (update.status === "IN_PROGRESS") {
      update.logs.map((log) => log.message).forEach(console.log);
    }
  },
});
console.log(result.data);
console.log(result.requestId);
```


## Additional Resources

### Documentation

- [Model Playground](https://fal.ai/models/fal-ai/diffrhythm)
- [API Documentation](https://fal.ai/models/fal-ai/diffrhythm/api)
- [OpenAPI Schema](https://fal.ai/api/openapi/queue/openapi.json?endpoint_id=fal-ai/diffrhythm)

### fal.ai Platform

- [Platform Documentation](https://fal.ai/docs/documentation)
- [Python Client](https://fal.ai/docs/api-reference/client-libraries/python)
- [JavaScript Client](https://fal.ai/docs/api-reference/client-libraries/javascript)

### Other agent-readable surfaces

This file covers one model. To find anything else:

- [Platform overview](https://fal.ai/llms.txt): Entry points and representative endpoint IDs
- [Documentation index](https://fal.ai/docs/llms.txt): Every documentation page
- [Full documentation text](https://fal.ai/docs/llms-full.txt): The whole documentation inlined
- Any other model: `https://fal.ai/models/<endpoint-id>/llms.txt`
