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.

5 min readSume
All 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.

Hero images at list price, read 2026-10-03.
ModelPer image100 posts x 1100 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

All Use cases posts

Written by Sume