Song Generator

text-to-song

You can generate songs from text prompts and integrate your application with Eachlabs API.

Fast Inference
REST API

Model Information

Response Time~84 sec
StatusActive
Version
0.0.1
Updated8 days ago

Prerequisites

  • Create an API Key from the Eachlabs Console
  • Install the required dependencies for your chosen language (e.g., requests for Python)

API Integration Steps

1. Create a Prediction

Send a POST request to create a new prediction. This will return a prediction ID that you'll use to check the result. The request should include your model inputs and API key.

import requests
import time
API_KEY = "YOUR_API_KEY" # Replace with your API key
HEADERS = {
"X-API-Key": API_KEY,
"Content-Type": "application/json"
}
def create_prediction():
response = requests.post(
"https://api.eachlabs.ai/v1/prediction/",
headers=HEADERS,
json={
"model": "text-to-song",
"version": "0.0.1",
"input": {
"prompt": "your prompt here"
}
}
)
prediction = response.json()
if prediction["status"] != "success":
raise Exception(f"Prediction failed: {prediction}")
return prediction["predictionID"]

2. Get Prediction Result

Poll the prediction endpoint with the prediction ID until the result is ready. The API uses long-polling, so you'll need to repeatedly check until you receive a success status.

def get_prediction(prediction_id):
while True:
result = requests.get(
f"https://api.eachlabs.ai/v1/prediction/{prediction_id}",
headers=HEADERS
).json()
if result["status"] == "success":
return result
elif result["status"] == "error":
raise Exception(f"Prediction failed: {result}")
time.sleep(1) # Wait before polling again

3. Complete Example

Here's a complete example that puts it all together, including error handling and result processing. This shows how to create a prediction and wait for the result in a production environment.

try:
# Create prediction
prediction_id = create_prediction()
print(f"Prediction created: {prediction_id}")
# Get result
result = get_prediction(prediction_id)
print(f"Output URL: {result['output']}")
print(f"Processing time: {result['metrics']['predict_time']}s")
except Exception as e:
print(f"Error: {e}")

Additional Information

  • The API uses a two-step process: create prediction and poll for results
  • Response time: ~84 seconds
  • Rate limit: 60 requests/minute
  • Concurrent requests: 10 maximum
  • Use long-polling to check prediction status until completion

Overview

This AI-powered music creation model leverages advanced artificial intelligence to enable users to effortlessly generate and customize original music across various genres. It caters to both novices and professionals, offering features such as style reference generation, vocal integration.

Technical Specifications

AI Engine: Uses advanced algorithms for precise style and mood generation.

Customization Options

  • Instruments: Use prompts to adjust the type, tone, and intensity of instruments to suit your needs.
  • Vocals: Specify the desired gender, pitch, and tone for vocals directly in the prompt.
  • Tempo: Control the speed by including your intended mood in the prompt.
  • Supported Genres: Explore genres like Pop, Jazz, Hip-Hop, Classical, EDM, and more by mentioning them in the prompt.

Processing Speed: Generate high-quality tracks within seconds, customized based on your detailed prompts.

Key Considerations

Input Quality Matters:Clear and specific inputs lead to better outputs.

Tips & Tricks

Maximize Creativity:

  • Try unexpected genre combinations for fresh, innovative tracks.

Test Boundaries:

  • Explore extreme tempos or unusual instrument combinations to discover the AI's limits.

Capabilities

Rapid Music Generation:

  • Create tracks in seconds, perfect for tight deadlines.

Custom Instrumentation:

  • Adjust every element of a track to suit your vision.

Diverse Applications:

  • Use outputs for personal projects, content creation, or professional production.

What can I use for?

Background Music: Ideal for podcasts, videos, or social media content.

Songwriting: Quickly prototype melodies and arrangements.

Educational Use: Learn music theory by analyzing AI-generated compositions.

Things to be aware of

Mood-Based Tracks:

  • Specify emotions (e.g., relaxing, intense) to tailor the music’s vibe.

Genre Blending:

  • Combine elements of multiple genres for innovative compositions.

Limitations

Niche genres or highly experimental styles may have limited support.

Output quality heavily relies on the specificity of user inputs.

Max Prompt Lenght: 300

Output Format: MP3

Related AI Models

kokoro-82m

Kokoro 82M

kokoro-82m

Text to Voice
text-to-song-advanced

Song Generator Advanced

text-to-song-advanced

Text to Voice