# YuE: Lyrics to Song

> YuE is a groundbreaking series of open-source foundation models designed for music generation, specifically for transforming lyrics into full songs.


## Overview

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



## Pricing

Your request will cost **$0.05** per second of generated audio. For **$1** you can run generate **20s 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 an image from. Must have two sections. Sections start with either [chorus] or a [verse].
  - Examples: "[verse]\nStaring at the sunset, colors paint the sky\nThoughts of you keep swirling, can't deny\nI know I let you down, I made mistakes\nBut I'm here to mend the heart I didn't break\n\n[chorus]\nEvery road you take, I'll be one step behind\nEvery dream you chase, I'm reaching for the light\nYou can't fight this feeling now\nI won't back down\nYou know you can't deny it now\nI won't back down\n"

- **`genres`** (`string`, _required_):
  The genres (separated by a space ' ') to guide the music generation.
  - Examples: "inspiring female uplifting pop airy vocal electronic bright vocal vocal", "R&B male hiphop pop 80s vocal electronic dark vocal vocal"



**Required Parameters Example**:

```json
{
  "lyrics": "[verse]\nStaring at the sunset, colors paint the sky\nThoughts of you keep swirling, can't deny\nI know I let you down, I made mistakes\nBut I'm here to mend the heart I didn't break\n\n[chorus]\nEvery road you take, I'll be one step behind\nEvery dream you chase, I'm reaching for the light\nYou can't fight this feeling now\nI won't back down\nYou know you can't deny it now\nI won't back down\n",
  "genres": "inspiring female uplifting pop airy vocal electronic bright vocal vocal"
}
```


### Output Schema

The API returns the following output format:

- **`audio`** (`File`, _required_):
  Generated music file.
  - Examples: {"file_size":480462,"content_type":"application/octet-stream","file_name":"cot_inspiring-female-uplifting-pop-airy-vocal-electronic-bright-vocal-vocal_tp0@93_T1@0_rp1@2_maxtk3000_mixed_8179e8da-5452-4cf6-9d6b-f69280feb7e8.mp3","url":"https://v3.fal.media/files/tiger/iAXHU3LtbJGeqPYWKkYMr_cot_inspiring-female-uplifting-pop-airy-vocal-electronic-bright-vocal-vocal_tp0%4093_T1%400_rp1%402_maxtk3000_mixed_74bcf408-eb99-4b88-b7bf-7d7212200cf1.mp3"}



**Example Response**:

```json
{
  "audio": {
    "file_size": 480462,
    "content_type": "application/octet-stream",
    "file_name": "cot_inspiring-female-uplifting-pop-airy-vocal-electronic-bright-vocal-vocal_tp0@93_T1@0_rp1@2_maxtk3000_mixed_8179e8da-5452-4cf6-9d6b-f69280feb7e8.mp3",
    "url": "https://v3.fal.media/files/tiger/iAXHU3LtbJGeqPYWKkYMr_cot_inspiring-female-uplifting-pop-airy-vocal-electronic-bright-vocal-vocal_tp0%4093_T1%400_rp1%402_maxtk3000_mixed_74bcf408-eb99-4b88-b7bf-7d7212200cf1.mp3"
  }
}
```


## Usage Examples

### cURL

```bash
curl --request POST \
  --url https://fal.run/fal-ai/yue \
  --header "Authorization: Key $FAL_KEY" \
  --header "Content-Type: application/json" \
  --data '{
     "lyrics": "[verse]\nStaring at the sunset, colors paint the sky\nThoughts of you keep swirling, can't deny\nI know I let you down, I made mistakes\nBut I'm here to mend the heart I didn't break\n\n[chorus]\nEvery road you take, I'll be one step behind\nEvery dream you chase, I'm reaching for the light\nYou can't fight this feeling now\nI won't back down\nYou know you can't deny it now\nI won't back down\n",
     "genres": "inspiring female uplifting pop airy vocal electronic bright vocal vocal"
   }'
```

### 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/yue",
    arguments={
        "lyrics": "[verse]
    Staring at the sunset, colors paint the sky
    Thoughts of you keep swirling, can't deny
    I know I let you down, I made mistakes
    But I'm here to mend the heart I didn't break

    [chorus]
    Every road you take, I'll be one step behind
    Every dream you chase, I'm reaching for the light
    You can't fight this feeling now
    I won't back down
    You know you can't deny it now
    I won't back down
    ",
        "genres": "inspiring female uplifting pop airy vocal electronic bright vocal vocal"
    },
    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/yue", {
  input: {
    lyrics: "[verse]
  Staring at the sunset, colors paint the sky
  Thoughts of you keep swirling, can't deny
  I know I let you down, I made mistakes
  But I'm here to mend the heart I didn't break

  [chorus]
  Every road you take, I'll be one step behind
  Every dream you chase, I'm reaching for the light
  You can't fight this feeling now
  I won't back down
  You know you can't deny it now
  I won't back down
  ",
    genres: "inspiring female uplifting pop airy vocal electronic bright vocal vocal"
  },
  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/yue)
- [API Documentation](https://fal.ai/models/fal-ai/yue/api)
- [OpenAPI Schema](https://fal.ai/api/openapi/queue/openapi.json?endpoint_id=fal-ai/yue)

### 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`
