AI event ticket art with a working QR code: add the code after
Generate the ticket art without a code, then draw the QR or barcode on top with a library. A model-drawn code looks real but will not scan.

For AI event ticket art with a working QR code, generate the ticket design with an empty square for the code, then draw the real QR or barcode on top with a library and test-scan it. Image models draw things that look like codes, but a pattern a model invents does not encode your ticket data.
Generate the ticket with a clear space
Ask for the layout: a perforated stub, a color band, a place for event name and a large blank white square for the code. Say that there must be no QR code, no barcode and no small text. Use a wide ratio such as 16:9 or 3:2.
curl -X POST https://api.sume.com/v1/images \
-H "Authorization: Bearer $SUME_API_KEY" \
-H "Content-Type: application/json" \
-d '{"model":"openai/gpt-image-2.5","prompt":"Concert ticket design, dark purple gradient, perforated stub on the right, large empty white square at the bottom left for a code, no text, no QR code, no barcode","quality":"high","aspect_ratio":"16:9"}'Draw the code in code
Download data[0].url, then render a QR for the ticket id with a library such as qrcode and paste it into the white square. Keep a quiet zone of plain white around it, and print or display it large enough for the scanner. Sume's own guidance on this problem is in AI image with a working QR code.
import qrcode
from PIL import Image
ticket = Image.open("ticket.png").convert("RGB")
qr = qrcode.make("https://example.com/t/TICKET-0001").convert("RGB").resize((360, 360))
ticket.paste(qr, (80, ticket.height - 440))
ticket.save("ticket-0001.png")Scan before you send
Scan every code with a phone at the size it will be seen. Test the darkest and busiest ticket in your set, since a code over a textured background can fail even when it is drawn correctly. Keep the white square flat and the contrast high.
Keep the art and the data apart
A ticket system needs one art file and many data rows. Generate the art once, or pick one from n: 4, then loop over your rows. This keeps spend at one image call, and a late change to a date is a re-render, not a new generation.
A checklist
- Empty white square in the art, no code drawn by the model.
- Code rendered from the ticket id with a library.
- Quiet zone around the code, high contrast, tested by scan.
- Event name and date set from data, not typed into the prompt.
- Prompt, model id and job id stored with the template.
Related posts
More in Use cases
- AI eyewear product photos: lens glare and frame edges
Glasses are hard for image models: thin frames and clear lenses. Send a sharp packshot and ask for the lenses and edges to stay unchanged, then inspect them.
- AI backdrops for TikTok Shop: staging must match what you sell
TikTok Shop's page says LIVE backgrounds and staging items must match the products sold. How to review a generated backdrop and use video filter dim or crop.
- AI kitchen counter product photo: scale cues for the right size
Image models often guess size. Give a real dimension in the prompt and include familiar objects of known size next to the product to keep scale believable.
- AI music as the main focus of a Short: YouTube says to disclose it
YouTube lists music that is the main focus of a video as altered or synthetic content to disclose. How that applies to a Short built on a Sume music track.
Written by Sume