Graduation announcement card art at 4:5, name and year added in code
Generate graduation card art on Sume at 4:5 with a clear middle, then add the graduate's name and year in code so the details are exact and easy to change.

For graduation announcement card art, generate the decoration on Sume at 4:5 with a clear middle and no text, then add the graduate's name and year in code. A name is the one word on the card that must be right, and drawing it with a real font guarantees the spelling and lets you reuse the same art for every graduate.
GPT Image 2.5 can make the art; fal lists it as OpenAI's default image model, with natural lighting and rich textures (read 2026-10-06, fal). On Sume, aspect_ratio accepts values such as 4:5, and the Image API docs list the ratios each model allows. Ask for a decorative border with an empty center so the overlay has room.
Art and text are separate jobs
Decide which parts are fixed and which change per card. The fixed part is the art, generated once or a few times. The variable part is the name, school and year, which come from a list. Splitting them keeps the number of billed images low.
| Element | Where it comes from | Changes per card |
|---|---|---|
| Border and motif | Generated image | No |
| Graduate's name | Code, from a list | Yes |
| School and year | Code, from a list | Sometimes |
| Colors | Prompt | No |
Generate once, stamp many
The script generates the art once and stamps three names onto copies. Replace the list with your own, and use a TrueType font for good results.
import io
import os
import requests
from PIL import Image, ImageDraw
r = requests.post(
"https://api.sume.com/v1/images",
headers={"Authorization": f"Bearer {os.environ['SUME_API_KEY']}"},
json={
"model": "openai/gpt-image-2.5",
"prompt": "Elegant graduation card background in navy and gold with "
"a thin decorative border and a small cap-and-diploma motif at the "
"top. The center is empty. No text.",
"aspect_ratio": "4:5",
"quality": "medium",
},
timeout=60,
)
r.raise_for_status()
raw = requests.get(r.json()["data"][0]["url"], timeout=60).content
for name in ["Maya Chen", "Luis Ortega", "Aisha Khan"]:
img = Image.open(io.BytesIO(raw)).convert("RGB")
w, h = img.size
d = ImageDraw.Draw(img)
d.text((w // 4, h // 2), name, fill="white")
d.text((w // 4, h // 2 + 40), "Class of 2027", fill="white")
img.save(name.replace(" ", "-").lower() + ".png")Details that make a card feel finished
A few small choices separate a card that looks designed from one that looks generated. Pick them before you generate, and put them in the prompt.
- Two or three colors, taken from the school or the family.
- One motif, such as a cap, a diploma or a ribbon, and nothing else.
- A calm background with a frame or border that leaves the middle clear.
- Plenty of margin, so a home printer does not cut into the art.
- A matching envelope or back-of-card image generated from the same prompt style.
Printing
Check your printer's size and margin rules before you choose the output size. A 4:5 image maps to an 8 by 10 inch print and to a 4 by 5 inch card; at either size, view the file at full resolution to see if the edges are clean. If you plan to print a lot of cards, order a single proof first. Screen colors and paper colors differ, and a proof costs less than a box of misprints.
Matching card, envelope and thank-you note
Families often want a set: the announcement, a thank-you card and a label for the envelope. Generate the three pieces with the same color words and motif, and keep the same border style. Because the text is added in code, the thank-you card needs only a new line of text on the same art, which costs nothing extra to produce.
Keep the prompts in one file. When the next graduate in the family comes along, you can reuse the entire set with a different year, which turns a design project into a few minutes of work.
Name spelling and fonts
Names often have letters outside the basic alphabet. Use a font file that covers the characters you need, and test the rendering with the hardest name on your list first. If a glyph is missing, Pillow draws a placeholder box, which you will see right away on screen. That is another reason to keep names out of the generated art, where the same fault would be harder to catch.
Proof the names against your list, not from memory. Check the file at full size, and print one test card. For other card shapes, Image API aspect ratios and custom sizes explains what each model accepts, and AI certificate backgrounds shows a similar flow for landscape pages.
Sources
Related posts
More in Use cases
- Homebrew beer label art with an API: the name and ABV added in code
Generate square label art on Sume with no text, then draw the beer name, style and ABV in code so every batch gets exact numbers on the same artwork.
- Insert a sponsor read into a podcast: TTS plus one audio concat
Generate the ad read with Sume TTS, then join it into the episode at the second you choose with one Timeline audio concat: sample-exact, $0.01 per join.
- Instagram Live ad clip: burn an offer line with caption cues
Add a timed offer line to a Live replay clip with POST /v1/video-captions and cues, no speech needed. Sume bills $0.20 per clip up to 60 seconds.
- Instagram Live Ads promo: make a 9:16 teaser clip with Sume
Instagram Live Ads started a general rollout on 2026-09-29. Make the 9:16 teaser that sends people to the stream with POST /v1/videos, 3 to 10 seconds.
Written by Sume