Parler TTS API Example
This guide demonstrates how to set up and run the Parler TTS text-to-speech model as a serverless API on Beam.
View the Code
See the code for this example on Github.
Introduction
Parler-TTS Mini is a lightweight text-to-speech (TTS) model, trained on 45K hours of audio data, that can generate high-quality, natural sounding speech with features that can be controlled using a simple text prompt. This guide explains how to deploy and use it on Beam.
Deployment Setup
Define the model and its dependencies using the parlertts_image
:
Inference Function
The generate_speech
function processes text and generates speech audio:
Deployment
Deploy the API to Beam:
API Usage
Send a POST
request with the following JSON payload:
Example Request
Example Response
A generated audio file will be returned:
Audio Example
Here’s an example of the generated audio output:
Summary
You’ve successfully deployed a Parler TTS text-to-speech API using Beam.
Was this page helpful?