Metadata-Version: 2.4
Name: bulkimg
Version: 1.0.0
Summary: Bulk AI product image generator powered by Google Gemini. Generate 1000s of e-commerce product photos with different backgrounds, angles, and lighting — from a single reference image.
Author: Dakshal Jethava
License: MIT
Project-URL: Homepage, https://github.com/jethavadakshal/bulkimg
Project-URL: Issues, https://github.com/jethavadakshal/bulkimg/issues
Keywords: ai,image-generation,e-commerce,product-photos,gemini,bulk,meesho,amazon,shopify
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: End Users/Desktop
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Topic :: Multimedia :: Graphics
Requires-Python: >=3.9
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: google-genai>=1.0.0
Requires-Dist: Pillow>=9.0.0
Dynamic: license-file

# 🖼️ BulkImg

**Generate 1000s of e-commerce product photos with AI — from a single reference image.**

BulkImg uses Google's Gemini API to automatically create professional product photos with different backgrounds, angles, placements, and lighting. Perfect for sellers on Meesho, Amazon, Shopify, Etsy, and more.

![Python](https://img.shields.io/badge/python-3.9+-blue)
![License](https://img.shields.io/badge/license-MIT-green)

## ✨ Features

- 🎯 **One image in, hundreds out** — Upload one product photo, get hundreds of variations
- 🎨 **Custom backgrounds** — White studio, marble, wood, pastel colors, kitchen scenes, etc.
- 📐 **Multiple angles** — Front view, top-down, 45°, close-up
- 💡 **Lighting variations** — Studio, natural daylight, dramatic, high-key
- 🔄 **Auto-resume** — Interrupted? Just run again, it picks up where it left off
- 💾 **Save & reuse configs** — Set up once, generate forever
- 📦 **Quality control** — Choose PNG/JPEG, resize, set compression
- ⏰ **Rate limit handling** — Automatically waits and retries when hitting API limits

## 🚀 Quick Start

### Install

```bash
pip install bulkimg
```

### Get a Gemini API Key

1. Go to [aistudio.google.com/apikey](https://aistudio.google.com/apikey)
2. Create a new API key
3. **Important:** Set up billing on the project (free tier gives 500 images/day)

### Run

```bash
bulkimg
```

That's it! The interactive wizard walks you through everything:

```
    ____        _ _    ___
   | __ ) _   _| | | _|_ _|_ __ ___   __ _
   |  _ \| | | | | |/ /| || '_ ` _ \ / _` |
   | |_) | |_| | |   < | || | | | | | (_| |
   |____/ \__,_|_|_|\_\___|_| |_| |_|\__, |
                                      |___/

  📋 SETUP — Answer a few questions to get started

── Step 1: Gemini API Key ──
  API Key: AIzaSy...

── Step 2: Product Image ──
  Path to your product image [product.jpg]: my_product.png

── Step 3: Describe Your Product ──
  Product description: a manual food chopper with mint green handle

── Step 4: Output Settings ──
  How many images to generate? [100]: 500

── Step 7: Backgrounds ──
  Enter comma-separated values, or one per line.
  > white marble, wooden table, pastel pink, kitchen counter
  ...
```

### Run with a saved config

```bash
# First run saves a config file
bulkimg

# Reuse it later
bulkimg bulkimg_config.json
```

### Run as a cron job (daily generation)

```bash
# Generate 400 images per day until target is reached
crontab -e

# Add this line (runs at 2 AM daily):
0 2 * * * cd /path/to/project && /path/to/venv/bin/bulkimg bulkimg_config.json >> cron_log.txt 2>&1
```

## 📋 Config File

After the first run, your config is saved as `bulkimg_config.json`. You can edit it directly:

```json
{
  "api_key": "YOUR_KEY",
  "product_image": "product.jpg",
  "product_description": "a manual food chopper with mint green handle",
  "output_folder": "generated_images",
  "total_images": 1000,
  "delay_seconds": 10,
  "output_format": "JPEG",
  "output_size": 800,
  "jpeg_quality": 70,
  "model": "gemini-2.5-flash-image",
  "backgrounds": [
    "clean white studio background",
    "white marble countertop",
    "wooden kitchen table"
  ],
  "placements": [
    "product standing upright",
    "product held in a hand"
  ],
  "angles": [
    "front view, eye level",
    "45-degree angle"
  ],
  "lighting": [
    "soft studio lighting",
    "warm natural daylight"
  ]
}
```

## 💰 Cost

| Method | Cost | Images/Day |
|--------|------|-----------|
| Free tier (with billing enabled) | $0 | ~500 |
| Paid (gemini-2.5-flash-image) | ~$0.039/image | Unlimited |
| Paid (gemini-3-pro-image-preview) | ~$0.134/image | Unlimited |

**Tip:** With the free tier, you can generate ~500 images/day. Set up a cron job and get 1000 images in 2 days for $0.

## 🛠️ Requirements

- Python 3.9+
- Google Gemini API key ([get one here](https://aistudio.google.com/apikey))
- Billing enabled on Google Cloud project (free tier is fine)

## 📄 License

MIT — use it however you want.

## 🤝 Contributing

PRs welcome! Ideas for improvement:

- [ ] Support for multiple reference images
- [ ] Web UI
- [ ] Batch API support (50% cheaper, 24h processing)
- [ ] Template presets (food products, electronics, fashion, etc.)
- [ ] Auto-upload to marketplace (Meesho, Amazon, Shopify)
