haoheliu
/
audio-ldm
Text-to-audio generation with latent diffusion models
Run haoheliu/audio-ldm with an API
Use one of our client libraries to get started quickly.
Set the REPLICATE_API_TOKEN
environment variable
export REPLICATE_API_TOKEN=<paste-your-token-here>
Learn more about authentication
Install Replicate’s Node.js client library
npm install replicate
Run haoheliu/audio-ldm using Replicate’s API. Check out the model's schema for an overview of inputs and outputs.
import Replicate from "replicate";
const replicate = new Replicate();
const input = {
text: "two starships are fighting in space with laser cannons"
};
const output = await replicate.run("haoheliu/audio-ldm:b61392adecdd660326fc9cfc5398182437dbe5e97b5decfb36e1a36de68b5b95", { input });
import { writeFile } from "node:fs/promises";
await writeFile("output.wav", output);
//=> output.wav written to disk