A generation pipeline over kie.ai's image API. The subject comes from the writer, or is derived from the post's title, keyword and opening paragraph for hand-written posts. The prompt is assembled from the current art direction, a composition chosen deterministically from the slug, the subject, and a universal rule set. The finished image is pulled off the temporary CDN into the platform's own public bucket, and the durable URL is written onto the post.
Also called: AI blog images · featured image · blog photos · image generation
- 1heroSubjectFor() uses the writer's supplied subject, or derives one from title, keyword and first paragraph.
- 2heroPrompt() composes style base + rotated composition + subject + universal rules, at 3:2.
- 3generateImage() starts the task, polls to completion, then storeDurably() downloads it and uploads to the blog-media bucket.
- 4The public bucket URL is written to hero_url along with the style that drew it.
- 5The same function serves the panel button and the crons, so a hero made by hand and one made unattended are the same thing.
Two rules were learned the hard way. Durability: "Results are downloaded off kie.ai's temporary CDN and stored durably in Supabase storage — a hero URL must never rot out from under a published post." And reachability: the hero step "was inline in the panel route, which is why nothing automated could reach it — and the publish gate refuses any post without a hero, so that single fact made unattended publishing impossible (Keith 08-24)."
- Blog imagery was stock or absent.
- Generated image URLs expired and broke live posts.
- Image creation was a manual button, which blocked unattended publishing.
See it on your own jobs
Twenty minutes, your numbers, no slide deck. We’ll build one of your real buildings in front of you and send you the estimate link at the end — yours to keep either way.
or keep browsing features →