AI-powered product photography tool that transforms a single product photo into professional marketing images automatically.
Kingfisher automatically transforms a single product photo into multiple professional marketing images ready for e-commerce, social media, and advertising. Simply upload your product image and let AI handle the creative work - from background removal to generating compelling marketing scenes tailored to your product's characteristics.
- One-Click Operation: Upload one photo, get multiple marketing images
- AI-Powered: Uses Google Gemini 2.5 Flash for intelligent image generation
- Smart Background Removal: Automatic product isolation with transparency
- Intelligent Analysis: AI analyzes your product and creates targeted marketing strategies
- Multiple Scenes: Generate 1-5 different marketing scenarios
- Organized Output: Timestamped folders with all assets
- Python 3.8 or higher
- OpenRouter API key (Get one here)
- Clone the repository:
git clone https://github.com/yourusername/kingfisher.git
cd kingfisher- Install dependencies:
pip install -r requirements.txt- Set up your API key:
cp .env.example .env
# Edit .env and add your OpenRouter API key- Run Kingfisher:
python kingfisher.py your-product.jpgGenerate a single marketing image (default):
python kingfisher.py product.jpgCreate multiple marketing variations:
python kingfisher.py product.jpg --count 3
python kingfisher.py product.jpg -c 5| Option | Short | Description | Default |
|---|---|---|---|
--count |
-c |
Number of images to generate (1-5) | 1 |
# Test with included examples
python kingfisher.py examples/book.jpeg --count 2Kingfisher follows a four-step AI workflow:
- Upload: Process your product image
- Background Removal: AI removes background, creates transparent cutout
- Analysis: AI analyzes product and generates creative marketing strategy
- Generation: AI creates professional marketing images based on analysis
output/
└── 2024-01-15_143022/
├── original.jpg # Your original image
├── cutout.png # Product with transparent background
├── analysis.json # AI analysis and creative strategy
├── scene1.jpg # Marketing image 1
├── scene2.jpg # Marketing image 2
└── scene3.jpg # Marketing image 3
Kingfisher leverages OpenRouter to access:
- Product Analysis:
google/gemini-2.5-flash - Image Generation:
google/gemini-2.5-flash-image-preview
- Each run uses OpenRouter API credits
- Approximate cost: $0.01-0.05 per image generated
- Monitor your usage at OpenRouter Dashboard
- OpenRouter has rate limits based on your plan
- The tool includes automatic retry logic with 15-second delays
- For heavy usage, consider upgrading your OpenRouter plan
"OPENROUTER_API_KEY not found"
- Ensure your
.envfile exists and contains your API key - Check that you've copied
.env.exampleto.env
Rate limit errors
- The tool automatically retries after 15 seconds
- Consider spacing out requests or upgrading your plan
Image generation fallbacks
- If generation fails, the tool copies the cutout as a fallback
- Check your internet connection and API status
We welcome contributions! Please see CONTRIBUTING.md for guidelines.
This project is licensed under the MIT License - see the LICENSE file for details.
- Built with OpenRouter
- Powered by Google's Gemini models
- Inspired by the need for accessible product photography
Made with care by the Kingfisher team