Skip to content

Divyanshu227/ImaGen

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 

Repository files navigation

ImaGen

ImaGen is a web application that generates images from text prompts using the Google Gemini AI model. It features a React frontend and an Express/Node.js backend.

Architecture

  • Frontend: React (powered by Vite)
  • Backend: Node.js with Express.js
  • AI Model: Google Gemini API (gemini-2.0-flash)

Model Used and Pricing

This project uses the Google Gemini gemini-2.0-flash model for image generation.

As of the current Gemini API pricing structure, the pricing for using gemini-2.0-flash is heavily dependent on whether you use the Free Tier or the Pay-as-you-go Tier.

Free Tier (Rate Limits Apply)

You can use the Gemini API for free, subject to the following limits:

  • RPM (Requests Per Minute): 15
  • RPD (Requests Per Day): 1,500
  • Tokens Per Minute: 1 million

Note: When using the free tier, your input and output data may be used by Google to improve their products.

Pay-as-you-go Tier

If you exceed free tier limits or disable data sharing, you will transition to Pay-as-you-go pricing:

  • Prompts up to 128K tokens:
    • Input: $0.10 per 1 million tokens
    • Output: $0.40 per 1 million tokens
    • Images: $0.000131 per image
  • Prompts longer than 128K tokens:
    • Input: $0.20 per 1 million tokens
    • Output: $0.80 per 1 million tokens
    • Images: $0.000262 per image

(Note: Pricing is subject to change. Always refer to the official Google Gemini API pricing page for the latest information).

Getting Started

Prerequisites

  • Node.js installed on your machine.
  • A Google Gemini API key.

Setup Backend

  1. Navigate to the backend directory:
    cd imagen-backend
  2. Install dependencies:
    npm install
  3. Create a .env file in the imagen-backend directory and add your API key:
    GEMINI_API_KEY=your_api_key_here
  4. Start the backend server:
    node server.js
    The backend will run on http://localhost:5000.

Setup Frontend

  1. Open a new terminal and navigate to the frontend directory:
    cd imagen-frontend
  2. Install dependencies:
    npm install
  3. Start the development server:
    npm run dev
  4. Open the displayed local URL (usually http://localhost:5173) in your browser.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors