An AI-powered tool that generates realistic selfies between fans and celebrities using Google's Gemini AI model.
- Generate authentic-looking selfies with celebrities
- Uses advanced AI image generation with style transfer
- Automatic verification system to ensure quality
- Supports JPEG input images
- High-quality output with realistic lighting and perspective
- Python 3.7+
- Google Gemini API key
- Required Python packages:
google-genaiPillow (PIL)
- Clone this repository:
git clone <repository-url>
cd AI-Selfie-with-Celebrities-Generator- Install required packages:
pip install google-genai Pillow- Set up your Gemini API key:
export GEMINI_API_KEY="your-api-key-here"- Place your celebrity photo as
kamal.jpeg - Place your fan photo as
fan.jpeg - Run the script:
python main.pyThe generated celebrity selfie will be saved as celebrity_selfie.png.
- Image Loading: Loads the celebrity photo (kamal.jpeg) and fan photo (fan.jpeg)
- AI Generation: Uses Gemini 2.5 Flash model to create a realistic selfie
- Quality Check: Compares input and output to ensure transformation occurred
- Verification: AI analyzes the generated image for authenticity and realism
- Output: Saves the final celebrity selfie
The system includes automatic verification that rates:
- Visibility and recognition of both individuals (1-10)
- Natural perspective and realism (1-10)
- Consistent lighting and shadows (1-10)
- Appropriate expressions (1-10)
Typical output scores 9.5/10 for overall authenticity.
AI-Selfie-with-Celebrities-Generator/
├── main.py # Main application script
├── kamal.jpeg # Celebrity photo
├── fan.jpeg # Fan photo
├── celebrity_selfie.png # Generated output
└── README.md # This file
The script uses Google's Gemini 2.5 Flash Image Preview model with:
- Seed: 42 (for consistent results)
- MIME type: image/jpeg for inputs
- Output format: PNG
- Ensure your
GEMINI_API_KEYenvironment variable is set correctly - Check that input images are in JPEG format
- Verify both
kamal.jpegandfan.jpegexist in the project directory
This project is open source and available under the MIT License.