This Node.js web application enables users to create images using the Stable Diffusion model. The project provides a simple and intuitive interface for generating images based on textual descriptions. Whether you're looking to generate art, visualize concepts, or just experiment with AI-driven image creation, this tool offers an accessible gateway into the world of AI image generation.
To get the website running on your local machine, follow the steps outlined below.
-
Before you begin, ensure you have Node.js installed on your machine. If you do not have Node.js installed, follow the instructions on Node.js official website to install it.
-
Create a vitual environment
conda create -n WebUI python=3.11.*- Activate virtual environment
conda activate WebUI- Clone the repository to your local machine:
git clone https://github.com/rohitd09/WebUI.git
cd WebUI- Install the required npm packages
npm install(Optional) If you prefer to use nodemon for automatic reloading during development, install nodemon globally:
npm install nodemon -g- Install python libraries
pip install diffusers torch torchvisionTo start the web application on your localhost, you can use either of the following commands:
- Using node:
node index.js- Using nodemon for automatic restarts upon changes:
nodemon index.jsAfter starting the application, open your web browser and navigate to http://localhost:3000 (or the port specified in your project) to access the web interface.
- The Stable Diffusion Pipiline is set to full precision this is necessary when using systems with NVIDIA GTX series GPUs, but if using RTX series it is efficient to switch to mixed precision by changing torch_dtype to torch.float16 from torch.float32.
- You need to set up a new environmental variable "OPENAI_API_KEY" and set it's value to your API key.