Tip
We value contributions to the project! If you'd like to try out the application but don't have a license, you can generate 200 songs for free by opening a PR. Check this out for more information.
Welcome to the Suno Music Generator! This application allows users to generate music based on text prompts using Suno's chirp-v3-5
model from Turbo AI from turboai.io. It includes a frontend interface for inputting prompts and playing generated songs, as well as an admin dashboard for managing licenses.
- Create lyrics using
gpt-4o-mini
model. - Generate music based on lyrics and the text prompt using
chirp-v3-5
model. - Play generated songs and view lyrics.
- Admin dashboard for managing licenses.
- License-based usage limits.
- Caching and displaying previously generated songs.
A live demo of the application can be found here.
To get a local copy up and running, follow these steps:
- Python 3.8+
- Flask
- SQLAlchemy
- dotenv
-
Clone the repository:
git clone https://github.com/ZigaoWang/suno-ai-song.git cd suno-ai-song
-
Create a virtual environment and activate it:
python -m venv venv source venv/bin/activate # On Windows use `venv\Scripts\activate`
-
Install the required packages:
pip install -r requirements.txt
-
Create a
.env
file in the root directory of the project and add your API keys and other configurations:touch .env
Add the following content to your
.env
file:API_KEY=your_turbo_api_key SECRET_KEY=your_flask_secret_key ADMIN_USERNAME=admin ADMIN_PASSWORD=admin_password OPENAI_API_KEY=your_openai_api_key OPENAI_BASE_URL=https://api.openai.com/v1
-
Initialize the SQLite database:
flask db init flask db migrate flask db upgrade
-
Run the Flask application:
flask run
The application will be available at http://127.0.0.1:5000
.
Configuration is managed through environment variables. Make sure to set the following variables in your .env
file:
API_KEY
: Your Turbo AI API key.SECRET_KEY
: A secret key for Flask session management.ADMIN_USERNAME
: The username for the admin dashboard.ADMIN_PASSWORD
: The password for the admin dashboard.OPENAI_API_KEY
: Your OpenAI API key.OPENAI_BASE_URL
: The base URL for OpenAI API requests.
- Enter your license key in the input field and click "Activate".
- Once activated, enter a text prompt and click "Generate".
- The application will generate a song based on the prompt and display it in the playlist.
- Click on a song in the playlist to play it.
- The song's video and lyrics will be displayed in the "Now Playing" section.
The admin dashboard allows you to manage licenses for the application.
- Navigate to
/login
and log in with the admin username and password. - Once logged in, you can add, edit, and delete licenses.
- Enter the maximum number of songs and optional remarks in the form.
- Click "Add License" to generate a new license key.
- Click "Edit" next to the license you want to modify.
- Update the maximum number of songs and/or remarks.
- Click "Update" to save changes.
- Click "Delete" next to the license you want to remove.
- Confirm the deletion in the popup dialog.
This project is licensed under the MIT License. See the LICENSE file for more details.