AI Image Generator is a lightweight web application that takes a natural language description and returns a generated image using OpenAI's DALL·E 2 model. A Node.js + Express REST API handles communication with the OpenAI API and serves the result to a vanilla frontend.
- Text-to-Image Generation — Describe anything in plain English and get a generated image back
- DALL·E 2 Integration — Powered by OpenAI's image generation model
- REST API Backend — Node.js + Express endpoint handles all API communication
- Minimal Frontend — Clean HTML/CSS/JS interface with no framework overhead
| Layer | Tools |
|---|---|
| Backend | Node.js, Express |
| AI | OpenAI DALL·E 2 API |
| Frontend | HTML, CSS, JavaScript |
| Config | dotenv |
- Node.js 14+
- An OpenAI API key
- Terminal (use Git Bash or WSL on Windows)
-
Clone the repository
git clone https://github.com/silentwraith03/ai-image-generator.git cd ai-image-generator -
Install dependencies
npm i express openai dotenv
-
Set up environment variables
Create a
.envfile in the root directory:PORT=5000 OPENAI_API_KEY=your_api_key_here
-
Start the server
npm run dev
-
Open in browser
Navigate to
http://localhost:5000
Distributed under the MIT License. See LICENSE for details.

