Use when the user asks to generate multiple AI images in bulk (patient avatars, product photos, demo assets, dataset seeds, etc.) or mentions generating photos for seeders. Triggers on "generate N images", "bulk generate", "need photos for", "populate avatars/lesions/products", "image dataset". Drives a local Python script that calls Pollinations.ai sequentially, saves to disk, and serves a live HTML dashboard via file:// URL.
How this skill is triggered — by the user, by Claude, or both
Slash command
/bulk-image-generation:bulk-image-generationThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
Orchestrate bulk image generation via Pollinations.ai (free public API, no key required). A Python helper does the actual requests, saves images to disk, and writes a self-refreshing HTML dashboard the user can open in their browser. Claude gathers the prompt, then monitors the generation live via the `Monitor` tool.
Orchestrate bulk image generation via Pollinations.ai (free public API, no key required). A Python helper does the actual requests, saves images to disk, and writes a self-refreshing HTML dashboard the user can open in their browser. Claude gathers the prompt, then monitors the generation live via the Monitor tool.
bulk-image-generator.html tool.Don't use for single image generation (too much overhead), for images requiring paid models (DALL-E 3, Midjourney — this helper only uses Pollinations), or for anything the provider's content policy would reject (nudity, gore, real people, medical imagery beyond benign skin texture).
digraph flow {
"User asks for images" [shape=box];
"Has explicit prompt?" [shape=diamond];
"Use prompt directly" [shape=box];
"Ask description + build prompt" [shape=box];
"Confirm with user" [shape=box];
"Collect parameters" [shape=box];
"Bash run_in_background + Monitor" [shape=box];
"Report dashboard URL" [shape=box];
"Summarize final" [shape=box];
"User asks for images" -> "Has explicit prompt?";
"Has explicit prompt?" -> "Use prompt directly" [label="yes"];
"Has explicit prompt?" -> "Ask description + build prompt" [label="no"];
"Use prompt directly" -> "Confirm with user";
"Ask description + build prompt" -> "Confirm with user";
"Confirm with user" -> "Collect parameters";
"Collect parameters" -> "Bash run_in_background + Monitor";
"Bash run_in_background + Monitor" -> "Report dashboard URL";
"Bash run_in_background + Monitor" -> "Summarize final";
}
Two paths, always offer both:
Show the generated prompt and ask for approval before spending time/API calls.
Ask the user (or use defaults when obviously implied):
| Param | Default | Notes |
|---|---|---|
| count | 10 | Clamped 1-50 |
| model | flux | Alternatives: turbo (faster), gptimage (DALL-E style), seedream |
| width, height | 768 | 512 / 768 / 1024 recommended |
| output dir | ask | Absolute path; subfolder per category (e.g. storage/app/demo/avatars/male) |
| delay | 5 | Seconds between images to avoid rate limit |
| enhance | false | Let the server rewrite the prompt (quality up, control down) |
| seed | random | Pass an int to reproduce a run |
Always ask the user before launching a run:
¿Usar la API pública de Pollinations (free, rate-limit compartido) o tu propia key (más capacidad, cola prioritaria)?
Then:
--auth. Done.python generate.py --show-config to check if a token is already saved. The script emits a config event with has_token: true|false.--auth directly or run --set-token first.python generate.py --set-token as a background task via Bash(run_in_background=true). The script will emit token-server-ready with a local URL like http://127.0.0.1:54321/. Show that URL to the user and ask them to open it, paste their token, and click Save. Use Monitor on the background task to wait for the token-saved event, then proceed.--auth added to the normal args.Do NOT ask Claude to paste tokens directly in chat — the web form is the only way to get the token into ~/.bulk-image-generation/config.json without leaking it into the conversation history.
Use Bash with run_in_background: true:
python ~/.claude/skills/bulk-image-generation/generate.py \
--prompt "THE PROMPT" \
--count 10 \
--model flux \
--width 768 --height 768 \
--output "/absolute/path/to/output" \
--delay 5 \
[--auth] # only if the user opted in to their own key
The script emits JSON-line events to stdout, one per fetch/poll/done/error. It writes a live dashboard.html in the output directory that auto-refreshes every 2 seconds while running.
Immediately after launching, tell the user:
Dashboard:
file:///absolute/path/to/output/dashboard.html
They open that in their browser to see the grid fill up live.
Start a Monitor task that tails the background process and forwards noteworthy events. Target filter: done|failed|rate-limited|complete. Let the user see progress in the dashboard; Claude Code sees structured events via Monitor.
Do NOT poll with repeated tail commands. The Monitor tool is the intended channel.
When the complete event arrives (or Monitor stream ends), summarize:
--seed <failed_seed> and --count 1 per failure, or let user re-run manually).Every run writes run.json next to dashboard.html with the full parameters + per-seed status. That file is the source of truth for recovery.
Pollinations caches every generated image by the full URL hash: prompt + model + seed + width + height. Requesting the same URL again returns the cached bytes in ~1 second without burning a generation slot. Two ways to exploit this:
A. User remembers the seed base — the simplest case. They generated 20 images with base seed 12345 in the old HTML tool or a previous script run. They tell you the seed, you pull the same images:
python ~/.claude/skills/bulk-image-generation/generate.py \
--recover \
--prompt "THE ORIGINAL PROMPT" \
--seed 12345 \
--count 20 \
--model flux \
--width 768 --height 768 \
--output "/absolute/output/dir"
B. Previous run wrote run.json — point --from at it and everything fills in:
python ~/.claude/skills/bulk-image-generation/generate.py \
--from /path/to/previous/run.json \
--output /new/output/dir
The prompt, model, dimensions, seed base and count are loaded from the JSON. --from implies --recover.
In recovery mode the script overrides timeouts/delays internally:
fetch_timeout = 15s (cache hits return fast; anything slower is a miss)poll_wait = 0, max_polls = 0 (don't wait on the server to re-generate)delay = 2s between requests (just enough to dodge rate limits)Missing-from-cache images emit failed events with a short error, which you can re-request in normal mode with the same seed(s) if you actually want them regenerated.
run_in_background: true so the Monitor tool can read the task output.--seed bases.file:// URL right after launch.generate.py — the stdlib-only Python helper. See the script for CLI reference. Reads no env vars. No network dependencies other than Pollinations.
Provides CDSS development patterns for drug interaction checking, dose validation, clinical scoring (NEWS2, qSOFA), and alert classification integrated into EMR workflows.
npx claudepluginhub christianpasinrey/bulk-image-generation-skill --plugin bulk-image-generation