bulk-image-generation — Claude Code skill
Orchestrated bulk AI image generation for Claude Code via Pollinations.ai. Built for seeding demo datasets (patient avatars, product photos, dermatology references, etc.) without juggling manual downloads, URLs, or browser tabs.
Claude asks you for a prompt (or drafts a professional one from your description), confirms the parameters, then runs a Python helper that:
- hits Pollinations sequentially with polling on transient errors
- writes every image to a user-specified output directory
- serves a live HTML dashboard you open via
file:// that auto-refreshes every 2s while the run is in progress
- emits JSON-lines events to stdout so Claude Code's
Monitor tool can stream progress in chat
- persists a
run.json next to the images with all the parameters, for later recovery
- optionally uses your own Pollinations API key (stored locally, entered via a one-shot local web form — never pasted into chat)
Stdlib-only Python. No pip install anything.
Install
Via Claude Code plugin marketplace
/plugin marketplace add christianpasinrey/bulk-image-generation-skill
/plugin install bulk-image-generation@bulk-image-generation-marketplace
Manual (drop-in)
- Clone or download the repo.
- Copy the entire
skills/bulk-image-generation/ directory to ~/.claude/skills/:
cp -r skills/bulk-image-generation ~/.claude/skills/
Windows:
xcopy /E /I skills\bulk-image-generation %USERPROFILE%\.claude\skills\bulk-image-generation
- Make sure Python 3.10+ is on your PATH.
- Open a fresh Claude Code session. The skill is auto-detected.
Prerequisites
- Claude Code (any recent version with skill support)
- Python 3.10+ (
python --version)
- No pip dependencies — everything uses stdlib (
urllib, http.server, json, pathlib, …)
Usage
From Claude Code (natural)
"Necesito 20 retratos de pacientes masculinos para el seeder demo en storage/app/demo/avatars/male"
Claude detects the trigger, asks whether to use the public API or your own key, confirms the prompt, launches the Python helper in the background, gives you the dashboard URL to open in your browser, and reports the final count when it finishes.
Direct CLI usage
The Python helper works standalone too — no Claude Code needed.
# Fresh generation run
python ~/.claude/skills/bulk-image-generation/generate.py \
--prompt "simple red apple on plain white background, product photography" \
--count 10 \
--model flux \
--width 768 --height 768 \
--output ~/bulk-test
Output layout:
~/bulk-test/
├── 001_flux_12345.jpg # generated image
├── 002_flux_12346.jpg
├── …
├── dashboard.html # open with your browser (auto-refreshes during the run)
└── run.json # full run metadata + per-seed status
Recovery mode
Pollinations caches every image by URL hash (prompt + model + seed + width + height). Requesting the same URL again returns the cached bytes in ~1 second without re-generating. Two ways to tap the cache:
A. Known seed base
python ~/.claude/skills/bulk-image-generation/generate.py \
--recover \
--prompt "THE ORIGINAL PROMPT" \
--seed 12345 \
--count 20 \
--model flux \
--width 1024 --height 1024 \
--output /new/destination
The prompt must be byte-identical to the original run. The script's URL encoder matches JavaScript's encodeURIComponent() exactly so runs seeded from other tools (web-based bulk generators, etc.) hit the same cache entries.
B. From a previous run.json
python ~/.claude/skills/bulk-image-generation/generate.py \
--from /path/to/previous/run.json \
--output /new/destination
--from pulls prompt, model, dimensions, seed base and count from the JSON and implies --recover.
Using your own Pollinations API key
The public API is free but rate-limited and shared across every anonymous caller. If you have a Pollinations token (free tier available at auth.pollinations.ai) you can use it for higher limits and priority queue.
Setup once:
python ~/.claude/skills/bulk-image-generation/generate.py --set-token
The script starts a tiny HTTP server on 127.0.0.1, picks a free port, and emits a token-server-ready event with the URL. Open it in your browser, paste your token, click Save. The token lands in ~/.bulk-image-generation/config.json (mode 0600 where supported) and the server shuts itself down.
Use it on runs:
python generate.py --prompt "…" --count 10 --output /out --auth
Check / clear / inspect:
python generate.py --show-config # is a token saved?
python generate.py --clear-token # delete the saved token