Skip to main content
Use count on POST /image/generate (or mynth.image.generate() / generateAsync()) when you want several images from the same prompt and model in one task. Default is 1. Maximum is 20. For different prompts or models, create separate tasks in parallel. There is no multi-prompt bulk endpoint. For a single image, see Generate Images. For waiting on results, see Async and polling.

Pricing

Mynth reserves the full cost up front: per-image price × count (plus magic prompt once, if enabled). You are charged only for images that succeed. Reserved balance for failed images is released. If your balance cannot cover the full reservation, task creation fails with 422 INSUFFICIENT_BALANCE.

Generate several images in one task

Set count to request multiple variants of one prompt:
count greater than 20 is rejected with HTTP 400 and code: "VALIDATION_ERROR".

Handle partial success

Each requested image is generated independently. The task can complete with a mix of successful and failed images. The task status is still completed when any images settle; inspect per-image status. Success item:
Failed item:
Per-image error codes: INVALID_INPUT, INVALID_PROMPT, RESTRICTED_CONTENT, UNKNOWN_ERROR.
task.urls and task.getImages() return only successful images. Use getImages({ includeFailed: true }) when you need failures.

Fan out across prompts or models

One request has a single prompt and model. For independent combinations, create one task per combination. Mynth does not enforce API concurrency limits.
Across models:
Use generateAsync when you want task IDs immediately and will poll or use webhooks later. Use generate when you can wait for each task in place. See Async and polling. Size your own parallelism for budget, downstream capacity, and client UX. Each task reserves cost at creation.

REST example

Creating a task does not return images immediately. Poll task endpoints or use webhooks — see Async and polling and Use Webhooks.

Choose count vs parallel tasks

How batch generation works

  1. Mynth validates the request (count 1–20) and reserves cost for all requested images.
  2. The worker runs the count generations in parallel for that task.
  3. Each image is finalized independently (upload, optional rating, destination).
  4. The task completes with result.images — one entry per requested image, success or failed.
  5. You are charged only for successful images; unused reservation is released.
For field-level request details, see Image Generation Request. For limits, see Errors and Limits.