AI share image for blog posts via API: 16:9 art, crop to size
Generate a text-free 16:9 hero per post on Sume from $0.025, crop it to your site's share-card size, and set the headline in code. Cost for 100 posts.

A share image (the card a link shows on social sites) is a wide picture with a headline. With the Sume image API, generate the picture at aspect_ratio: "16:9", which every catalog row lists (read 2026-10-03), then crop to the exact size your site uses and draw the headline yourself. At $0.025 per image on Qwen Image, a hundred posts cost $2.50 for one draw each, $10 if you generate four options per post and pick one.
Sume does not accept explicit pixel sizes on /v1/images, and share-card sizes differ between sites and change over time, so crop to whatever your site's metadata requires instead of trusting a number from this post.
Keep it text-free and legible
- Ask for "empty area on the left third" so a headline fits.
- Avoid detail where the headline will sit; a flat gradient or dark region reads best.
- Use one visual idea per post, derived from the post's subject, not its full text.
Generate and crop in one script
The script asks for a 16:9 image per title, downloads it and crops it to 1200x630 as an example size. A call that is still running after the 30-second wait returns 202 with a job envelope instead of 200, so check the status code before reading data; see Jobs and results.
import io
import os
import requests
from PIL import Image, ImageOps
headers = {"Authorization": f"Bearer {os.environ['SUME_API_KEY']}"}
topic = "a lighthouse in fog"
r = requests.post("https://api.sume.com/v1/images", headers=headers, timeout=60, json={
"model": "qwen/qwen-image",
"prompt": f"editorial illustration of {topic}, empty area on the left third, no text",
"aspect_ratio": "16:9",
})
r.raise_for_status()
url = r.json()["data"][0]["url"]
img = Image.open(io.BytesIO(requests.get(url, timeout=60).content)).convert("RGB")
ImageOps.fit(img, (1200, 630)).save("share.png")Cost at scale
Save the files you keep. Do not rely on a hosted URL as your site's permanent image source; copy the image to your own storage.
| Model | Per image | 100 posts x 1 | 100 posts x 4 options |
|---|---|---|---|
| Qwen Image | $0.025 | $2.50 | $10.00 |
| Seedream 4.0 | $0.0325 | $3.25 | $13.00 |
| Flux 2 Pro | $0.0375 | $3.75 | $15.00 |
| Seedream 4.5 | $0.05 | $5.00 | $20.00 |
Sources
Related posts
More in Use cases
- AI sneaker product photo on a colored backdrop, from one packshot
Keep the sneaker, change the set: a prompt, a preserve list and a reference photo give colored-backdrop product stills. Request, ratio and checks on Sume.
- AI sonic logo generator: a short audio sting by prompt, then trim
Make a 2 to 4 second sonic logo with AI: write the sting into the prompt, then cut it with Timeline audio. Sume has no duration field and no fade on the cut.
- AI tabletop RPG portraits via API: keep one art style on Sume
A party of RPG portraits in one art style: make an anchor portrait, then pass its URL as an input reference per character. $0.0375 each on Flux 2 Pro.
- AI tarot deck via API: 78 cards at 2:3, cost and consistency on Sume
A 78-card deck at 2:3 costs $2.93 on Flux 2 Pro and $3.90 on Seedream 4.5 at Sume list prices. How to keep the style consistent with one anchor reference.
Written by Sume