The AI Image Generator is a robust Node.js application utilizing the Express.js framework. This application leverages OpenAI's DALL-E 3 model to generate images based on user inputs, creating a seamless and interactive experience.
- Image Generation: Utilizes the DALL-E 3 model to generate images from textual descriptions.
- User Input Handling: Accepts and processes user inputs to create customized image prompts.
- API Integration: Seamlessly integrates with OpenAI's API for advanced image generation capabilities.
- Data Persistence: Stores user details in a CSV file for record-keeping and analytics.
- Node.js
- Express.js
- Multer
- OpenAI's DALL-E 3
- Dotenv for environment management
Ensure you have Node.js and Visual Studio Code installed on your machine. If not, follow these instructions:
- Node.js Installation: Download and install Node.js from here.
- VS Code Installation: Download and install Visual Studio Code from here.
Once the installations are complete, proceed with the following steps:
-
Clone the Repository:
git clone https://github.com/RaheesAhmed/ai-image-generator.git
-
Clone the repository:
git clone https://github.com/RaheesAhmed/ai-image-generator.git
-
Install dependencies: Run
npm install
in the project directory. -
Create a
.env
file in the project directory and add your OpenAI API key:OPENAI_API_KEY=your-api-key
-
Start the server: Run
npm start
in the project directory. -
Access the app: Open your web browser and go to http://localhost:3000/.
To customize the prompt used in the application, follow the steps below:
-
Open the
index.js
file in your project directory. -
Find the following line of code:
app.post("/generate-images", upload.none(), async (req, res) => { const prompt = `Create a cinematic still in 32k resolution and landscape format depicting ${mainScene}, located at ${location}. The main character is ${mainCharacter}. Additional characters include ${additionalCharacters}. ${additionalInfo}`; });
-
Modify the
prompt
variable as needed.
Rahees Ahmed