PiAPI MMAudio icon

PiAPI MMAudio

Generate audio for videos using PiAPI MMAudio

Overview

This node generates audio from video files using the PiAPI MMAudio service. It accepts an MP4 video input and produces an audio output based on a text prompt that guides the audio generation process. The node supports two methods for providing the video: via a URL or as binary data within the workflow.

Common scenarios where this node is beneficial include:

  • Creating custom audio soundtracks or effects for short video clips.
  • Generating audio descriptions or ambiance sounds from video content.
  • Enhancing multimedia workflows by automatically extracting or generating audio from videos.

For example, a user might input a 20-second MP4 video URL along with a descriptive prompt like "calm ocean waves" to generate matching ambient audio for the video.

Properties

Name Meaning
Video Input Method Method to input the video data. Options: URL (provide a video URL), Binary Data (upload video in binary form).
Video Binary Property Name of the binary property containing the video data (used only if Video Input Method is Binary Data). Default: data.
Video URL URL of the video in MP4 format (used only if Video Input Method is URL).
Video Requirements Notice indicating video must be MP4 format and maximum length is 30 seconds.
Prompt Text prompt guiding the audio generation process.
Negative Prompt Text prompt specifying what should be avoided in the generated audio.
Steps Number of steps for audio generation; controls quality/detail (range 20-50). Default: 20.
Seed Seed value for randomization in audio generation; 0 means random seed.
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 (only shown if waiting for completion). Default: 20.
Retry Interval Interval between retries in milliseconds (only shown if waiting for completion). Default: 3000 ms.

Output

The node outputs JSON data representing the status or result of the audio generation task:

  • When not waiting for completion, it returns the task ID and current status (e.g., "pending").
  • When waiting for completion, it returns detailed task results once finished.
  • If an error occurs, the output JSON contains an error field with a descriptive message.

No direct binary audio data is output by this node; instead, it manages asynchronous task creation and status retrieval through the API.

Dependencies

  • Requires an API key credential for the PiAPI MMAudio service.
  • Depends on the external PiAPI endpoint /api/v1/task to submit video-to-audio generation tasks.
  • Uses internal helper functions to handle binary data extraction and API requests.
  • The video input must be accessible and in MP4 format, with a maximum length of 30 seconds.

Troubleshooting

  • Invalid Video Format: If the provided binary data is not an MP4 video, the node throws an error. Ensure the video is MP4 format.
  • Video Accessibility: For URL input, the video must be publicly accessible. Private or protected URLs may cause failures.
  • Video Length Limit: Videos longer than 30 seconds may be rejected by the API.
  • Task ID Missing: If the API response does not contain a valid task ID, the node will throw an error indicating failure to start the task.
  • Timeouts Waiting for Completion: If waiting for task completion, ensure maxRetries and retryInterval are set appropriately to allow enough time for processing.
  • Error Handling: If the node is configured to continue on failure, errors are returned in the output JSON under an error field instead of stopping execution.

Links and References

Discussion