Imagine is an API that generates predictions based on given prompts. This document provides guidance on how to use the Imagine API.
To use the Imagine API, you'll need Node.js installed on your system.
- Install Node.js from nodejs.org.
- Create a new directory for your project and navigate into it using the terminal.
- Initialize a new Node.js project using
npm init -y
. - Install Imagine API package using
npm install git+https://github.com/shuddho11288/imagine-api.git
.
Follow these steps to use the Imagine API:
- Import the Imagine API package into your project.
- Initialize the
imagine
function by calling it with your desired prompt. - The function returns a promise with the predictions generated by Imagine.
Here's an example code snippet:
const { imagine } = require('@shuddho11288/sdxl-imagine');
// Example usage
imagine('among us impostor but in good mood!').then(data=>{
console.log(data)
})