Skip to content

avanigupta06/AI-Image-Generator

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

4 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

๐Ÿ“ธ AI Image Generator using Gemini API

A simple React-based web app that generates images from text prompts using Google's Gemini 2.0 Flash Preview Image Generation API. Includes modern UI and the ability to download generated images.


๐Ÿš€ Features

  • ๐Ÿง  Text-to-Image Generation via Gemini 2.0 Flash API
  • ๐Ÿ“ฅ Download Generated Images in PNG format
  • ๐ŸŽจ Clean, Responsive UI using Flexbox
  • โŒ Graceful handling of empty input and API errors
  • ๐Ÿ–ผ๏ธ Default placeholder image before generation
  • ๐Ÿ“ฑ Mobile-friendly

๐Ÿงฐ Tech Stack

  • Frontend: React
  • API: Google Gemini API (gemini-2.0-flash-preview-image-generation)
  • Environment: Node.js

๐Ÿ–ผ๏ธ Demo

1


๐Ÿงช How It Works

  • User enters a prompt in the input box.
  • The app calls Gemini API and receives a base64 image.
  • Image is rendered in the UI with a download button.

โš™๏ธ Gemini API Setup

  1. Go to Google AI Studio
  2. Create a Google Cloud Project.
  3. Enable Generative Language API from the Cloud Console.
  4. Generate an API key.
  5. Add your key to a .env file:
    REACT_APP_GEMINI_API_KEY=your-key-here
    

โœ… The free tier includes 1500 requests/day.


๐Ÿ”ฎ Future Features

  • Voice Prompt Input (Speech-to-Text)
  • Image Gallery for history
  • Prompt History and Regenerate option
  • Multiple image resolutions (256px, 512px, 1024px)
  • Dark Mode Toggle ๐ŸŒ™

Releases

No releases published

Packages

No packages published