1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
const axios = require('axios');
const api_key = "YOUR API-KEY";
const url = "https://api.segmind.com/v1/lyria-2";
const data = {
"prompt": "Melodious guitar with gentle rain background.",
"negative_prompt": "No loud drums, no vocals."
};
(async function() {
try {
const response = await axios.post(url, data, { headers: { 'x-api-key': api_key } });
console.log(response.data);
} catch (error) {
console.error('Error:', error.response.data);
}
})();
Directs audio creation with a detailed theme; guides tone and mood. Example: 'Melodious guitar with gentle rain background.'
Ensures audio consistency across generations. Use '123' for repeated serene outputs, or omit for surprise variations.
Excludes specific unwanted elements from the audio. Use 'No loud drums' for softer compositions, 'No vocals' for instrumentals.
To keep track of your credit usage, you can inspect the response headers of each API call. The x-remaining-credits property will indicate the number of remaining credits in your account. Ensure you monitor this value to avoid any disruptions in your API usage.
Lyria 2, Google DeepMind's latest AI music generation model, offers a groundbreaking approach to producing high-quality instrumental music using text prompts. This model serves as an exceptional resource for developers, creators, and executives aiming to embed AI-generated music into their projects and businesses.
Lyria 2's capabilities are tailored for generating instrumental music at a professional 48kHz stereo audio sample rate, making it ideal for diverse applications such as music production, app development, and creative collaboration. By utilizing real-time music creation via Lyria RealTime, the model supports interactive features through WebSocket connections, facilitating on-the-fly musical composition and adjustments.
The model also allows for customization through negative prompting, BPM control, and seed parameter settings, enabling users to fine-tune outputs to meet specific creative needs. It also implements SynthID for audio watermarking, ensuring traceable and secure content.
Current known limitations include:
For creators, Lyria 2 provides tools for swift musical ideation, crafting background tracks for content, and developing prototypes. Developers can harness its power for interactive music applications, dynamic game soundtracks, and user-personalized musical experiences. Executives will appreciate its capacity to drive innovation in music-filled wellness applications and engage audiences through dynamic audio content.
To maximize Lyria 2's potential, focus on detailed prompt engineering with specific expressions of mood, genre, and instrumentation. Leveraging Google Cloud's Vertex AI or the Gemini API grants access to Lyria 2's robust features, making integration straightforward for developers.
By understanding the model's strengths and constraints, users can effectively exploit its offerings, ensuring seamless incorporation into both creative and technical workflows. This positions Lyria 2 as a pivotal tool for advancing audio content innovation across various sectors.