One product in five settings: image references and 4:5 for ad variants

Make five distinct scene variants of one product photo with Sume's Image API input_references at 4:5 for a Meta ad set. Request shape, limits and a Python loop.

4 min readSume
All posts

To get five distinct variants of one product for a Meta ad set, call Sume's Image API five times with the same product photo in input_references and a different setting in each prompt, at aspect_ratio: "4:5". The docs describe 4:5 as Instagram portrait, 1080 by 1350. Whether five variants raise a Creative Diversity Score is something Meta decides, not this script.

Common Thread reports a Low, Medium or High Creative Diversity Score introduced 2026-08-26. The Sume facts come from the Image API docs, read 2026-10-02.

What does the request look like?

The docs show input_references as a list of {type: image_url, image_url: {url}} objects with public HTTPS URLs. Models whose descriptor is {min: 0, max: 0} reject references, so read the model's descriptor first. This loop uses a model id from the docs example.

import os
import requests

PRODUCT = os.environ["PRODUCT_URL"]  # public https image
settings = ["a sunlit kitchen counter", "a gym bag", "a desk by a window",
            "a picnic blanket", "a bathroom shelf"]
for i, setting in enumerate(settings, 1):
    r = requests.post(
        "https://api.sume.com/v1/images",
        headers={"Authorization": f"Bearer {os.environ['SUME_API_KEY']}",
                 "Idempotency-Key": f"variants-v1-{i}"},
        json={"model": "openai/gpt-image-2",
              "prompt": f"The same product on {setting}, natural light",
              "aspect_ratio": "4:5",
              "input_references": [{"type": "image_url",
                                    "image_url": {"url": PRODUCT}}]},
        timeout=120)
    print(i, r.status_code)

What should change between the five?

Change the setting, not the product. A different crop of the same scene is not a new concept.

Variant plan for one product, 4:5, read 2026-10-02
VariantSettingKeep identical
1Kitchen counterProduct, 4:5
2Gym bagProduct, 4:5
3Desk by a windowProduct, 4:5
4Picnic blanketProduct, 4:5
5Bathroom shelfProduct, 4:5

Do I have to check the output?

Yes. Look at every image for label text, product shape and hands before it goes in an ad. A reference guides the model; it does not guarantee a faithful product.

What is the endpoint if I use a router id?

The docs list POST /v1/images as the create route and GET /v1/images/models as the catalog. Read the model descriptor there for input_references and aspect_ratio before running a loop.

Sources

Related posts

More in Use cases

All Use cases posts

Written by Sume