Gemini Image Generator is a Node.js application that uses Google's Generative AI to generate images based on text prompts.
- Node.js (v14 or higher)
- npm (v6 or higher)
-
Clone the repository:
git clone https://github.com/manthanank/gemini-image-generator.git cd gemini-image-generator
-
Install the dependencies:
npm install
-
Create a
.env
file in the root directory and add your Google Gemini API key and port:GEMINI_API_KEY=your_google_gemini_api_key PORT=5000
-
Start the server:
npm start
-
The server will be running on
http://localhost:5000
.
-
URL:
/api/image/generate
-
Method:
POST
-
Body:
{ "prompt": "your text prompt" }
-
Response:
{ "message": "Image generated successfully", "imagePath": "path/to/generated_image.png" }
gemini-image-generator/
├── .env
├── .example.env
├── app.js
├── package.json
├── README.md
├── server.js
├── config/
│ └── env.js
├── controllers/
│ └── imageController.js
├── routes/
│ └── imageRoutes.js
├── services/
│ └── geminiService.js
└── temp/
└── generated_image.png
This project is licensed under the MIT License. See the LICENSE file for details.