In this article, we will see how to Build an AI Text to image Web App using Stable Diffusion API.
Stable Diffusion is an Open Source Text Image AI model. People have been creating all kinds of applications with it since its launch.
Let’s see how to create a Stable Diffusion application using NextJS and Replicate API.
Table of Contents
Build an AI Text to image Web App – Requirements
- Open the command line program on your computer.
- Check if you have the latest version of the node installed by running this command: node -v
- If not, install the latest version of node or upgrade it.
Download the code
- Get the sample code from here
- From your command line program, change the directory to the downloaded code’s directory
- Run these commands to install the necessary modules: npm install
Get your Stable Diffusion API Key
We will be using the Stable Diffusion API available from Replicate.
Go ahead and create an account and get your API key.
Setup Replicate Key
Add an environment variable REPLICATE_API_TOKEN} and set it to your Replicate API key.
Start your Application
From the code folder, run this command to start the application on your local machine
npm run dev