A TypeScript CLI tool for bulk thumbnail generation using Google Gemini and OpenAI image generation APIs.
Generated with OpenAI GPT Image 1.5 | 1024x1024 | quality: high
- Dual API Support: Generate images using Gemini (Nano Banana) or OpenAI (GPT Image 1.5) including their latest models as of December 2025
- Flexible Input: Text prompts, reference images, or both
- Batch Processing: Process multiple jobs from a single JSON file
- Parallel Generation: Configurable concurrency for faster processing
- Progress Tracking: Real-time progress bar and summary
| Provider | Model | ID | Notes |
|---|---|---|---|
| Gemini | Flash (2.5) | flash |
Fast, cost-effective (~$0.04/image) |
| Gemini | Pro (3 Pro) | pro |
Nano Banana Pro - highest quality, 2K/4K support |
| OpenAI | GPT Image 1.5 | - | Latest model, best quality (~$0.19/image) |
git clone https://github.com/daveonkels/nano-cli-image-gen.git
cd nano-cli-image-gen
npm installCopy the example environment file and add your API keys:
cp .env.example .envEdit .env:
GOOGLE_AI_API_KEY=your-gemini-api-key
OPENAI_API_KEY=your-openai-api-key
Get your API keys:
npm run start -- -i prompts.json -o ./thumbnails| Option | Alias | Description | Default |
|---|---|---|---|
--input |
-i |
Input JSON file (required) | - |
--output |
-o |
Output directory | ./output |
--provider |
-p |
Default provider (gemini or openai) |
From input file |
--gemini-model |
-m |
Gemini model: flash (2.5) or pro (3 Pro) |
flash |
--parallel |
-n |
Concurrent generations | 3 |
--dry-run |
- | Validate without generating | false |
# Generate using Gemini Flash (default)
npm run start -- -i examples/prompts.json
# Use Gemini Pro (Nano Banana Pro) for higher quality
npm run start -- -i prompts.json -m pro
# Force all jobs to use OpenAI
npm run start -- -i prompts.json -p openai
# High concurrency
npm run start -- -i prompts.json -n 5
# Validate input file
npm run start -- -i prompts.json --dry-runCreate a JSON file with your generation jobs:
{
"defaults": {
"provider": "gemini",
"geminiModel": "flash",
"size": "1024x1024",
"quality": "high"
},
"jobs": [
{
"prompt": "A vibrant sunset over mountains"
},
{
"prompt": "High-quality product photo",
"geminiModel": "pro"
},
{
"prompt": "Style this image:",
"image": "./reference.jpg"
},
{
"prompt": "Cyberpunk city at night",
"provider": "openai",
"outputName": "cyberpunk-city"
}
]
}| Property | Type | Description |
|---|---|---|
prompt |
string | Text prompt for generation |
image |
string | Path to reference/source image |
edit |
string | Edit instruction (for image-to-image) |
provider |
string | Override provider (gemini or openai) |
geminiModel |
string | Gemini model: flash or pro |
size |
string | Image size (e.g., 1024x1024, 1536x1024) |
quality |
string | Quality level (low, medium, high) |
outputName |
string | Custom output filename |
# Build TypeScript
npm run build
# Run with tsx (development)
npm run start -- -i examples/prompts.json
# Watch mode
npm run devMIT