(Un-official Package)
🚀 A Node.js package that integrates Replicate AI for free. 🚀
The @justskydev/replicateai
package provides a TypeScript library for interacting with Replicate AI models. It supports a variety of models for image, text, music, and speech generation. Easily integrate advanced AI capabilities into your Node.js applications!
- Image Generation: Generate images using models like Stable Diffusion and Playground V2.5.
- Text Generation: Create text with models like Llama3 and Mixtral.
- Music Generation: Compose music with models like Musicgen and Riffusion.
- Speech Generation: Synthesize speech with models like Styletts2 and Xtts_v2.
- Single Input: The current implementation supports only a single input field "prompt" due to the free nature of the service. This means you can only provide the prompt for generation and cannot specify additional parameters.
To install the package, use npm:
npm install @justskydev/replicateai
ES Modules (ESM)
import Replicate, {
ImageGenerationModel,
TextGenerationModel,
MusicGenerationModel,
SpeechGenerationModel,
} from "@justskydev/replicateai";
const replicate = new Replicate(ImageGenerationModel.Stable_Diffusion_3);
const result = await replicate.run({
prompt:
"Generate an image of a brave knight in shining armor, standing on a hilltop with a dramatic sunset in the background.",
});
console.log(result);
CJS:
const {
Replicate,
ImageGenerationModel,
TextGenerationModel,
MusicGenerationModel,
SpeechGenerationModel,
} = require("@justskydev/replicateai");
const replicate = new Replicate(ImageGenerationModel.Stable_Diffusion_3);
replicate
.run({
prompt:
"Generate an image of a brave knight in shining armor, standing on a hilltop with a dramatic sunset in the background.",
})
.then((result) => {
console.log(result);
})
.catch((error) => {
console.error(error);
});
For support or questions, please open an issue on GitHub.
This package is licensed under the MIT License. See the LICENSE file for details.