Bulk-generate images from a list of prompts with one API call (FLUX, no API key)
Description and use
The recipe enables bulk image generation from a list of prompts with a single API call, removing per‑image key handling and retries.
Problem
Generating hundreds of images from a list of prompts in a pipeline is cumbersome when each prompt requires a separate API call, key management, and bookkeeping.
Outcome
The recipe enables bulk image generation with a single API call, eliminating per-image key management, retry logic, and manual storage, while returning a structured dataset with URLs and status for each image.
Workflow
- 1. Create a free Apify account and copy the API token from Settings → Integrations.
- 2. Prepare a JSON input with fields such as prompts, imageSize, quality, imagesPerPrompt, seed, maxPrompts.
- 3. Call the Actor via curl, Python, or JavaScript to run the batch generation synchronously.
- 4. Retrieve the dataset items directly from the API response or via the Apify client.
- 5. Process each item: if status is "ok" use outputUrl; otherwise handle error.
Evidence
The pattern that removes all of this: one call that takes the whole list, runs the model, stores the files, and returns one record per image with its URL.
Create a free Apify account and copy your API token from Settings → Integrations.
curl -s -X POST \
"https://api.apify.com/v2/actors/sherwood~image-generator-batch/run-sync-get-dataset-items?token=$APIFY_TOKEN" \
-H "Content-Type: application/json" \
-d '{"prompts": ["A ceramic coffee mug on a wooden table, product photography"]}'
- Record date: 2026-10-19T18:56:25.962Z