This guide will help you set up and run the AI Meme Poster Creator project locally on your machine.
- Python 3.8 or higher installed on your system
- A Gemini API key from Google AI Studio
- Basic knowledge of command line/terminal
- Create a new folder for your project (e.g.,
ai-meme-creator) - Download and place these files in the folder:
app.py(main application file)requirements.txt(dependencies)README.md(this file)
Open terminal/command prompt and navigate to your project folder:
cd path/to/ai-meme-creatorOption 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/activateOption B: Using System Python Skip virtual environment setup (not recommended for production)
pip install -r requirements.txt- Open
app.pyin a text editor - Find line 24:
self.api_key = "YOUR_GEMINI_API_KEY_HERE" - Replace
"YOUR_GEMINI_API_KEY_HERE"with your actual Gemini API key - Save the file
How to get Gemini API Key:
- Go to Google AI Studio
- Sign in with your Google account
- Click "Create API Key"
- Copy the generated key
streamlit run app.pyThe app will open in your default browser at http://localhost:8501
-
Choose Image Source:
- Select "Use Template" to pick from built-in templates
- Select "Upload Image" to use your own image
-
Add Caption:
- Custom Caption: Type your own text
- AI Caption: Enter a theme (e.g., "college exams") and click "Generate Caption"
-
Customize:
- Choose text position (top, center, or bottom)
- Preview your meme in real-time
-
Download:
- Click "Create Meme" to generate
- Click "Download Meme" to save the image
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- Create a GitHub repository with your project files
- Go to Streamlit Community Cloud
- Connect your GitHub repository
- Add your API key as a secret in the app settings
- Deploy!
Note: For production deployment, store API keys as environment variables instead of hardcoding them.
# Run on network (accessible to other devices on same network)
streamlit run app.py --server.address 0.0.0.0ai-meme-creator/
│
├── app.py # Main Streamlit application
├── requirements.txt # Python dependencies
└── README.md # This setup guide
- 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
- 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
If you encounter any issues:
- Check that all dependencies are installed correctly
- Verify your API key is valid and correctly placed
- Ensure you have a stable internet connection for AI features
- Try refreshing the browser page
Your AI Meme Poster Creator is now ready to use! Start creating amazing memes and posters with AI-powered captions.
Happy Meme Making! 🎭