Overview
This node generates audio based on user-provided style prompts and optionally timestamped lyrics or reference audio. It leverages an external API to create musical audio clips, supporting different task types that determine the maximum length of the generated audio (up to 1.35 or 4.45 minutes). Users can customize the style of the audio, include lyrics with timestamps for synchronization, and provide a reference audio sample to influence the style.
Common scenarios where this node is beneficial include:
- Creating background music tracks in a specified style.
- Generating audio renditions of song lyrics with timing information.
- Producing stylistically consistent audio samples by referencing existing audio clips.
Practical example: A user wants to generate a pop-style audio clip up to 1.35 minutes long, including timestamped lyrics for karaoke applications, optionally waiting for the generation process to complete before continuing workflow execution.
Properties
| Name | Meaning |
|---|---|
| Task Type | Type of audio generation task; options: "Base (1.35 min)" or "Full (4.45 min)" |
| Style Prompt | Description of the desired audio style (e.g., "pop", "jazz") |
| Include Lyrics | Whether to include timestamped lyrics in the audio generation (boolean) |
| Lyrics | Timestamped lyrics text formatted like [00:10.00] First line [00:17.00] Second line (shown if Include Lyrics is true) |
| Lyrics Format | Notice explaining the required format for lyrics timestamps (shown if Include Lyrics is true) |
| Include Reference Audio | Whether to include a reference audio sample to guide style (boolean) |
| Reference Audio Input Method | Method to input reference audio: "URL" or "Binary Data" (shown if Include Reference Audio is true) |
| Reference Audio Binary Property | Name of the binary property containing the reference audio data (required if input method is Binary Data) |
| Reference Audio URL | URL of the reference audio file (required if input method is URL) |
| Wait For Completion | Whether to wait for the audio generation task to complete before continuing (boolean) |
| Max Retries | Maximum number of retries to check task status when waiting for completion (shown if Wait For Completion is true) |
| Retry Interval | Interval in milliseconds between retries when waiting for completion (shown if Wait For Completion is true) |
Output
The node outputs JSON data containing the status and identifiers related to the audio generation task:
task_id: Unique identifier of the submitted audio generation task.status: Current status of the task (e.g., "pending", "completed").- If waiting for completion is enabled, the output reflects the final task status after polling.
- In case of errors, the output JSON contains an
errorfield with the error message.
The node does not directly output the generated audio binary data but provides task metadata to retrieve or handle the audio externally.
Dependencies
- Requires an API key credential for authenticating requests to the external PiAPI DiffRhythm audio generation service.
- The node calls the
/api/v1/taskendpoint of the external API to submit audio generation tasks. - If using reference audio as binary data, the node expects valid audio MIME types in the binary input.
- No additional environment variables are explicitly required beyond the API credential.
Troubleshooting
Error: "The provided binary data is not an audio file"
Occurs if the binary data supplied as reference audio is not recognized as an audio MIME type.
Resolution: Ensure the binary input contains valid audio data with correct MIME type.Failure to get a valid task ID from the API
Indicates the API response did not include a task identifier.
Resolution: Verify API credentials and request parameters; check API service availability.Timeout or prolonged waiting when "Wait For Completion" is enabled
Audio generation may take longer than expected. AdjustMax RetriesandRetry Intervalaccordingly.Invalid or improperly formatted lyrics
Lyrics must be timestamped correctly as per the notice format. Incorrect formatting may cause unexpected results.
Links and References
- PiAPI DiffRhythm Documentation (hypothetical link for reference)
- n8n Custom Node Development
- Audio Timestamp Formatting Guide