Overview
The Weights API provides powerful song generation capabilities that can turn your lyrics into full musical tracks. You provide the lyrics and a style prompt, and the AI creates the melody, instrumentation, and arrangement to bring your words to life.Prerequisites
- A Weights API account with an API key
- Lyrics in English (up to 380 characters)
- A style prompt describing the musical style (up to 590 characters)
Step 1: Set Up Your Environment
First, install the Weights SDK and set up your authentication:Step 2: Prepare Your Lyrics and Prompt
Before generating a song, you need to prepare your lyrics and a style prompt. The API accepts English lyrics up to 600 characters and style prompts up to 300 characters.Lyrics Requirements
- Language: English only
- Length: Maximum 380 characters
- Content: Can include verses, choruses, or complete songs
- Format: Plain text (no special formatting needed)
Prompt Requirements
- Length: Maximum 590 characters
- Content: Describe the musical style, mood, genre, and instrumentation
- Examples: “blues, melancholic, raw, lonely bar, heartbreak” or “upbeat pop, electronic, dance, energetic”
Example Preparation
Step 3: Create Your First Song
Start by creating a song generation job:Request Parameters
- lyrics (required): Your song lyrics in English (max 380 characters)
- prompt (required): Style description for the song (max 590 characters)
Step 4: Monitor Song Generation
Song generation is asynchronous and can take several minutes. Poll the status to track progress:Job Statuses
- QUEUED: Job is waiting in the processing queue
- PENDING_WORKER: Job is assigned to a worker
- PROCESSING: Song is being generated
- SUCCEEDED: Generation completed successfully
- ERRORED: Generation failed
- CANCELED: Job was canceled
Step 5: Retrieve Your Generated Song
Once the status isSUCCEEDED
, your song is ready for download:
Step 6: List All Your Songs
View all your previous song generation jobs:Advanced Song Generation
Different Musical Styles
Experiment with various style prompts for different musical genres:Search Your Songs
You can search through your generated songs:Best Practices
Writing Effective Lyrics
- Rhythm and Flow: Write lyrics with natural rhythm and flow
- Emotional Content: Include emotional themes that work well with music
- Length: Use the full 380 characters for more complete songs
- Structure: Consider verse-chorus structure for better results
- Language: Keep language clear and accessible
Creating Effective Prompts
- Be Specific: Include genre, mood, instruments, and style
- Use Descriptive Words: “melancholic”, “energetic”, “smooth”, “raw”
- Mention Instruments: “acoustic guitar”, “synthesizers”, “piano”, “drums”
- Include Atmosphere: “lonely bar”, “stadium anthem”, “lounge”, “intimate”
- Combine Elements: Mix genre with mood and instrumentation
Error Handling
Complete Example
Here’s a complete example that creates a song and waits for completion:Use Cases
Music Creation
- Original Songs: Create complete original compositions
- Songwriting: Generate melodies for your lyrics
- Demo Creation: Create quick demos for song ideas
- Background Music: Generate instrumental tracks
Content Creation
- Podcasts: Create theme songs and jingles
- Videos: Generate background music for content
- Presentations: Create custom music for slideshows
- Games: Generate dynamic music for interactive content
Creative Projects
- Artistic Expression: Explore new musical ideas
- Collaboration: Combine AI-generated music with human creativity
- Learning: Study different musical styles and arrangements
- Experimentation: Test different lyrical approaches
Performance Considerations
- Processing Time: Song generation typically takes 5-15 minutes
- Queue Position: Jobs are processed in order
- File Size: Generated songs are optimized for web delivery
- URL Expiration: Download URLs have limited availability
Tips for Better Results
Lyrical Content
- Emotional Themes: Love, hope, adventure, reflection work well
- Imagery: Use vivid imagery that translates to musical emotion
- Rhythm: Consider the natural rhythm of your words
- Repetition: Include some repetition for memorable choruses
Prompt Crafting
- Genre + Mood: Combine genre with emotional tone
- Instrumentation: Specify key instruments for the style
- Atmosphere: Describe the setting or feeling
- Tempo: Include tempo indicators like “slow”, “upbeat”, “driving”
- Examples: “folk, acoustic, storytelling, campfire, intimate” or “electronic, ambient, atmospheric, dreamy, ethereal”
Next Steps
- Explore RVC Voice Models to add vocals to your songs
- Learn about Image Generation for album artwork
- Check out Video Generation for music videos