SunoAI icon

SunoAI

Generate songs using Suno

Overview

This node integrates with the SunoAI service to generate songs based on user-provided prompts. It is designed to create musical content by leveraging AI models, making it useful for musicians, content creators, or developers who want to automate music generation within their workflows. Typical use cases include generating instrumental tracks, creating song lyrics, or producing complete songs from descriptive prompts.

For example, a user can input a creative description like "Wizards cooking in KFC kitchen, drum and base" to inspire the AI model to generate a unique song matching that theme. The node supports toggling between instrumental-only tracks or songs with lyrics.

Properties

Name Meaning
Cookie An authorization cookie from SunoAI required to authenticate API requests.
GPT Description Prompt A descriptive prompt guiding the AI model on the style or theme of the song to generate. Example: "Wizards cooking in KFC kitchen, drum and base".
Prompt Additional prompt text specifically for the song generator AI model to refine output.
Make Instrumental Boolean flag indicating whether the generated song should be instrumental (true) or include lyrics (false).

Output

The node outputs a JSON array containing an object with a songs field. This field holds the generated song data returned from the SunoAI service. The exact structure of each song item is not detailed in the source but typically would include audio data references, metadata, or URLs to the generated content.

If the node supports binary data (e.g., audio files), this is not explicitly shown in the code snippet, so the output focuses on JSON-formatted song information.

Example output structure:

[
  {
    "songs": [
      {
        // Song data such as title, audio URL, duration, etc.
      }
    ]
  }
]

Dependencies

  • Requires an active authorization cookie from SunoAI to authenticate requests.
  • Depends on an external helper function generateSong imported from a local helper module (../../helpers/songgen), which handles communication with the SunoAI API and song generation logic.
  • No other external services or environment variables are explicitly mentioned.

Troubleshooting

  • Invalid or missing cookie: If the authorization cookie is incorrect or expired, the node will likely fail to authenticate with SunoAI. Ensure the cookie is valid and up to date.
  • Empty or unclear prompts: Providing vague or empty prompts may result in unsatisfactory or no song output. Use clear, descriptive prompts to guide the AI effectively.
  • API errors from SunoAI: Network issues or API rate limits could cause failures. Check network connectivity and SunoAI service status.
  • Missing dependencies: The helper function generateSong must be present and correctly implemented; otherwise, the node will throw errors during execution.

Links and References

  • SunoAI official website (for obtaining authorization cookies and understanding service capabilities)
  • Documentation or README for the helper module songgen if available, to understand how generateSong works internally.

Discussion