subject_ref + /scenes API automates it, and the same
mechanism threads through book-to-game chapters.
subject_ref is the pixel counterpart of a world’s prose subject lock.
Canonical references work best as rear or three-quarter views — the rear-chase
camera hides faces, so identity rides on hair, build and clothing.Define the character once
Create a world with asubject_ref — either an inline image (image_b64) or an
already-hosted image_url, plus an optional prose descriptor. The opening seed
is painted from the character, and the reference is stored on the world as
subjectRef { imageUrl, descriptor } for every later scene to reuse.
image_b64 is hosted to a durable URL before the world is stored, so no inline
blob is ever persisted. image_url must be an already-hosted URL: a data:
URI is rejected 400 (host it first, or send the bytes as image_b64), and if a
supplied image_b64 cannot be hosted the request fails closed with 502 — no
world is created rather than one that silently dropped the reference you paid for.
Pin a specific seed frame
subject_ref locks who is in the scene; frame_url locks what the opening
frame is. Pass an already-hosted image as frame_url (or inline bytes as
frame_b64) on POST /v1/worlds and the world boots from that exact frame
instead of one the model paints from the premise. Combine the two — a pinned
opening frame plus a subject_ref — and the character rides in coherent from the
very first frame and stays that way scene-to-scene. This is the trick the
hand-authored Stormcaller world pulls off by hand: a deliberately chosen
entrance frame with the same knight, reused so nothing drifts.
frame_url as an already-hosted, fetchable image URL — it becomes the
world’s opening seed, so the model must be able to load it. To send raw bytes
instead, use frame_b64.
Don’t have a frame yet?
POST /v1/seed-frame paints one from a prompt and
returns a hosted url you can hand straight back as frame_url — the supported
way to author a deliberate opening frame without leaving the API.Generate the next scene with the same character
POST /v1/worlds/{id}/scenes reads the stored subjectRef and paints a new seed
from it plus your scene prose. The result is a hosted image; with pin:true
it also becomes the world’s entrance seed (a versioned set_entrance write that
keeps the current entrance state).
descriptor reinforces identity in words and defaults to
the world’s subject when the reference has none. /scenes is metered image
(reserve-before-spend, fail-closed); a pin failure still returns the generated
image so a paid render is never lost. A world with no stored subject_ref returns
404 — attach one first (below).
Attach or rotate a character later
Already have a world without a character, or want to swap it? Use theset_subject_ref batch op —
metadata-only, no re-generation:
POST /v1/worlds/{id}/scenes works on that world. The create-time
subject_ref field and the set_subject_ref op are the two write surfaces for the
reference, and they agree: both take a hosted imageUrl/image_url and both reject
data: URIs.

