Skip to content

Latest commit

 

History

6 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

AI Meme Poster Creator - Setup Guide

🚀 Quick Start Guide

This guide will help you set up and run the AI Meme Poster Creator project locally on your machine.

Prerequisites

  • Python 3.8 or higher installed on your system
  • A Gemini API key from Google AI Studio
  • Basic knowledge of command line/terminal

📋 Step-by-Step Installation

Step 1: Download Project Files

  1. Create a new folder for your project (e.g., ai-meme-creator)
  2. Download and place these files in the folder:
    • app.py (main application file)
    • requirements.txt (dependencies)
    • README.md (this file)

Step 2: Set Up Python Environment

Open terminal/command prompt and navigate to your project folder:

cd path/to/ai-meme-creator

Option A: Using Virtual Environment (Recommended)

# Create virtual environment
python -m venv venv

# Activate virtual environment
# On Windows:
venv\Scripts\activate
# On macOS/Linux:
source venv/bin/activate

Option B: Using System Python Skip virtual environment setup (not recommended for production)

Step 3: Install Dependencies

pip install -r requirements.txt

Step 4: Configure API Key

  1. Open app.py in a text editor
  2. Find line 24: self.api_key = "YOUR_GEMINI_API_KEY_HERE"
  3. Replace "YOUR_GEMINI_API_KEY_HERE" with your actual Gemini API key
  4. Save the file

How to get Gemini API Key:

  1. Go to Google AI Studio
  2. Sign in with your Google account
  3. Click "Create API Key"
  4. Copy the generated key

Step 5: Run the Application

streamlit run app.py

The app will open in your default browser at http://localhost:8501


🎯 How to Use the App

Creating Your First Meme:

  1. Choose Image Source:

    • Select "Use Template" to pick from built-in templates
    • Select "Upload Image" to use your own image
  2. Add Caption:

    • Custom Caption: Type your own text
    • AI Caption: Enter a theme (e.g., "college exams") and click "Generate Caption"
  3. Customize:

    • Choose text position (top, center, or bottom)
    • Preview your meme in real-time
  4. Download:

    • Click "Create Meme" to generate
    • Click "Download Meme" to save the image

🔧 Troubleshooting

Common Issues:

1. ModuleNotFoundError

Solution: Make sure you installed all requirements
pip install -r requirements.txt

2. API Key Error

Solution: Check that your Gemini API key is correctly added to app.py

3. Font Issues on Some Systems

The app will automatically fall back to default fonts if system fonts are not available

4. Streamlit Not Found

pip install streamlit
streamlit --version

🚀 Deployment Options

Deploy to Streamlit Community Cloud:

  1. Create a GitHub repository with your project files
  2. Go to Streamlit Community Cloud
  3. Connect your GitHub repository
  4. Add your API key as a secret in the app settings
  5. Deploy!

Note: For production deployment, store API keys as environment variables instead of hardcoding them.

Deploy Locally for Others:

# Run on network (accessible to other devices on same network)
streamlit run app.py --server.address 0.0.0.0

📁 Project Structure

ai-meme-creator/
│
├── app.py                 # Main Streamlit application
├── requirements.txt       # Python dependencies
└── README.md             # This setup guide

🎨 Features

  • Template Selection: 5 built-in gradient templates
  • Custom Upload: Use your own images
  • AI Caption Generation: Powered by Google Gemini
  • Custom Captions: Write your own text
  • Text Positioning: Top, center, or bottom placement
  • Real-time Preview: See changes instantly
  • Download Function: Save memes as PNG files
  • Responsive Design: Works on desktop and mobile

🔒 Security Notes

  • Keep your API key secure and never share it publicly
  • For production use, consider using environment variables for API keys
  • The app runs locally by default - your images are processed on your machine

📞 Support

If you encounter any issues:

  1. Check that all dependencies are installed correctly
  2. Verify your API key is valid and correctly placed
  3. Ensure you have a stable internet connection for AI features
  4. Try refreshing the browser page

🎉 Ready to Create!

Your AI Meme Poster Creator is now ready to use! Start creating amazing memes and posters with AI-powered captions.

Happy Meme Making! 🎭

About

This is my ai meme and poster creator using gemini.

Resources

Stars

6 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages