SHOOT_SCHEMA =
JSON.parse("{\n \"type\":\"object\",\n \"required\":[\"prompt\"],\n \"description\":\"
Draw a picture with the named camera.
If a reference image is supplied the subject is carried into a
NEW pose rather than reproduced — that is what the reference is for.
Returns base64 unless output_path is given; bus services do not share a filesystem, so base64 is the portable answer.\",\n \"properties\":{\n \"camera\":{\"type\":\"string\",\"description\":\"
Camera id — call `cameras` for the list.
Default 'klein' (cheapest that holds a character).\"},\n \"prompt\":{\"type\":\"string\",\"description\":\"
What to draw.
If you pass a reference, say 'in the same style' rather than describing the style: an over-specified style fights the reference image.\"},\n \"reference_base64\":{\"type\":\"string\",\"description\":\"
One reference image as base64.
The subject to carry into the new picture.\"},\n \"references_base64\":{\"type\":\"array\",\"items\":{\"type\":\"string\"},\"description\":\"
SEVERAL references, base64.
Order is preserved exactly as given; whether providers weight the first most heavily is
NOT verified here, so do not rely on it.
Use for a recurring character plus the scene to edit, or a room plus its neighbours.
Measured: klein, kontext, dflare, dnano and dlite all accept at least 4.\"},\n \"reference_url\":{\"type\":\"string\",\"description\":\"
One reference fetched by
URL (http/https) — keeps image bytes off the bus entirely.
A loopback
URL like http://127.0.0.1:
PORT/media/
KEY works because the service fetches it here; it is
NOT handed to the provider, which could not reach it.\"},\n \"references_url\":{\"type\":\"array\",\"items\":{\"type\":\"string\"},\"description\":\"
SEVERAL references by
URL, order preserved.
Same fetching as reference_url.
Max 32
MB each, http/https only, up to 2 redirects.\"},\n \"width\":{\"type\":\"integer\",\"description\":\"
Desired width; snapped to the camera's nearest supported aspect.
Default 1024.\"},\n \"height\":{\"type\":\"integer\",\"description\":\"
Desired height; snapped.
Default 1024.\"},\n \"format\":{\"type\":\"string\",\"enum\":[\"webp\",\"png\",\"jpg\",\"xcf\"],\"description\":\"
Default webp: ~26x smaller on the wire than png for the same picture, and unlike jpg it keeps hard ink edges clean.
Note Runware returns
LOSSY webp with
NO alpha channel (verified: a
VP8 chunk, no
VP8X) — it is the right default for serve-and-display, but do not plan on transparency or re-key a webp.
Use png for lossless and for anything with an alpha channel; jpg only for photographic subjects (its ringing lands on the black outlines comic art is made of). xcf is
GIMP's
TILED format — far bigger, but two revisions of the same picture share ~98% of their chunks under content-defined chunking, so it is the right choice for art that will be edited repeatedly and stored in a deduplicating store.
Adds ~1.4s for the
GIMP conversion.\"},\n \"view\":{\"description\":\"
Where the camera stands, as a unit vector {x,y,z}, or the readable form {side:'front'|'back',yaw:-1..1,pitch:-1..1} (quarter turns).
Rendered into prompt words — these models take a prompt, not a camera matrix, so this is
AS ASKED and not exact.
Echoed back.\"},\n \"view_roll\":{\"type\":\"number\",\"description\":\"
Image turned in its own plane, quarter turns, -2..2.\"},\n \"light\":{\"description\":\"
Where the light comes
FROM, in the picture's frame, same shapes as `view`.
Also as-asked.\"},\n \"output_path\":{\"type\":\"string\",\"description\":\"
Write the image here instead of returning base64: a new file inside ~/.local/share/mj/out (a bare name goes there).
Never overwrites.\"},\n \"wait_seconds\":{\"type\":\"number\",\"description\":\"
How long you will wait for the picture.
A shot whose turn comes with less than the camera's typical time left comes back expired, unmade and unbilled, and no retry starts that couldn't finish in time.
Without it, a shot waits as long as it takes.\"}\n }\n }")