20 ad variations from one product image with an image API
Make 20 static ad variations from one product photo: five headline prompts times n=4, async jobs, and a model whose catalog allows n=4.

To make 20 ad variations from one product image with the Sume Image API, send five prompts that each change one element, such as the headline, with n: 4 and the same product photo in input_references. That is five calls and 20 images. Check the model's n range in the catalog first: the docs example for Seedream 4.5 lists 1 to 4, while the generic request table allows up to 10.
Higgsfield's changelog says its Ads Studio produces up to 20 ads per product; this is a way to reach the same count through an API. The request fields come from Sume's Image API docs and Jobs and results.
What does one request look like?
POST /v1/images takes model, prompt, input_references, aspect_ratio, n, and mode. With mode: "async" Sume returns 202 and a job envelope; you read the images from GET /v1/jobs/{id}/result. Without it, the call blocks up to 30 seconds and returns 200 with the images, but large n is one of the cases the docs say can degrade to 202. Branch on the status code.
import os
import requests
URL = "https://api.sume.com/v1/images"
HEAD = {"Authorization": f"Bearer {os.environ['SUME_API_KEY']}"}
PRODUCT = "https://example.com/product.jpg"
HOOKS = ["Gift idea", "Everyday carry", "Small price, big use",
"New in", "Back in stock"]
for hook in HOOKS:
body = {
"model": "bytedance-seed/seedream-4.5",
"prompt": f"Square static ad for the product, headline '{hook}'",
"input_references": [{"type": "image_url",
"image_url": {"url": PRODUCT}}],
"aspect_ratio": "1:1",
"n": 4,
"mode": "async",
}
r = requests.post(URL, headers=HEAD, json=body, timeout=60)
print(hook, r.status_code, r.json()["data"]["job"]["id"])Why change only one element per prompt?
If every prompt differs in headline, color, and layout, you cannot tell which change drove a result. Keep the product photo, ratio, and style words fixed and vary one field. Ad variations: how to make many versions of one video ad covers planning the matrix.
What does the batch cost?
Image billing is all-or-nothing per generation: a completed generation is billed, a failed one is not. The endpoint pricing in the catalog is the amount charged, and the docs say cost_usd × n is what you pay. Read the model's pricing line from GET /v1/images/models/{model_id}/endpoints before you run 20 images, and do not assume the number from this post.
Store each job id with the headline that produced it in a small file, so a result can be traced back. If a call returns an error for n: 4, lower n to the model's listed maximum and add calls, rather than dropping variations. Keep the idempotency habit from the other Sume surfaces in mind: a retry after a timeout should not silently pay for the same batch twice, so log before you resend.
| Field | Value in the script | Why |
|---|---|---|
n | 4 | Matches the 1-4 range shown for the example model |
mode | async | Avoids the 30-second blocking wait |
aspect_ratio | 1:1 | One ratio keeps the 20 images comparable |
input_references | One public HTTPS URL | Keeps the same product in every image |
Sources
Related posts
More in Developers
- Check GET /v1/balance before a Sume bulk run: failures land per item
A bulk create returns 202 even if the wallet cannot fund every child; unfunded items fail one by one. Compare GET /v1/balance with your spend caps first.
- Smoke-test a new Sume API key with GET /v1/me before revoking the old
GET /v1/me returns the key's id, prefix and scopes. A TypeScript script fails the deploy if the new key lacks formats:write, so you revoke the old key after.
- GitHub wants a 2xx in 10 seconds: Sume times out at 10 too
GitHub says respond 2XX within 10 seconds. Sume also gives each delivery attempt 10 seconds, so store the event first and do the work after you answer.
- GPT Image 2.5 complex prompts take up to 2 minutes: use a webhook
OpenAI says complex GPT Image prompts may take up to 2 minutes. Sume waits 30 seconds, then returns a job. Send mode webhook and read the result from the job.
Written by Sume