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.

5 min readSume
All posts

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.

Request fields from Sume's Image API docs, read 2026-10-02.
FieldValue in the scriptWhy
n4Matches the 1-4 range shown for the example model
modeasyncAvoids the 30-second blocking wait
aspect_ratio1:1One ratio keeps the 20 images comparable
input_referencesOne public HTTPS URLKeeps the same product in every image

Sources

Related posts

More in Developers

All Developers posts

Written by Sume