image-gen.v1
Status: v1. A published shape is frozen by spec.md section 20.1.
Capability key: image-gen
Route: POST /image/generate
Parts in
| kind | role | required | meaning |
|---|---|---|---|
| text | prompt | yes, one or more | a description of the image to make. |
| image | reference | no | an image whose content guides the job. |
Parameters
The plugin validates these. A parameter that is not in this table is ignored,
not an error (R26). A default of catalogue means the model entry in the
catalogue gives the value. A default of none means the plugin chooses.
| name | type | default | meaning |
|---|---|---|---|
size | string | catalogue | the image size, as <width>x<height> |
steps | uint | catalogue | the number of denoise steps |
guidance | float | catalogue | how closely the job follows the prompt |
seed | uint | none | a fixed seed for a repeatable job |
Channels out
| channel | mime | payload |
|---|---|---|
| image | image/png | one whole image |
| progress | application/json | {stage, pct} during generation |
Terminal metadata
done.meta is vocabulary-defined. The core stores it and never reads it.
done without meta means {}.
| key | type | meaning |
|---|---|---|
model | string | the served name that ran the job |
width | uint | the width of the produced image, in pixels |
height | uint | the height of the produced image, in pixels |
These keys are present when outcome is completed. They are absent when the
outcome is cancelled or expired.
Request
POST /image/generate
{
"model": "<served-name>",
"input": [
{"kind": "text", "role": "prompt", "text": "a cold machine room at night"},
{"kind": "image", "role": "reference", "mime": "image/png", "inline": "<png bytes>"}
],
"params": {"size": "1024x1024", "steps": 28, "guidance": 4.5, "seed": 7},
"stream": true
}
Response, no stream
{"job": "019...", "outcome": "completed",
"image": {"mime": "image/png", "inline": "<png bytes>"},
"usage": {"images": 1, "pixels": 1048576},
"meta": {"model": "<served-name>", "width": 1024, "height": 1024}}
Stream
Image bytes travel in the done frame. The stream carries progress only.
event ch=progress {"stage": "denoise", "pct": 0.4}
event ch=progress {"stage": "denoise", "pct": 0.9}
done outcome=completed usage={"images":1,"pixels":1048576}
artifacts=[{"channel":"image","mime":"image/png","inline":"<png bytes>"}]
meta={"model":"<served-name>","width":1024,"height":1024}
Rules
- At least one
textpart with rolepromptis required. A request with no such part isinvalid_part. - A
textpart with a role other thanpromptisinvalid_part. - An
imagepart must carry rolereference. Animagepart with another role isinvalid_part. - An
audio,video,tokens, orjsonpart isinvalid_part. - One job produces exactly one image. A job with zero or two image artifacts is
failed. - The mime of the image artifact is always
image/png. It is a constant, not a parameter. - An
eventframe never carries image bytes. The image is one artifact indone. meta.widthandmeta.heightare the pixel size of the produced image.sizenames a size that the plugin declares. An undeclared value gives a refusal that namessize.- The image size equals the
sizevalue that the job used. usage.imagesis 1 when the outcome iscompleted. It counts one image.usage.pixelsequalsmeta.widthmultiplied bymeta.height.- A
progressevent carries{stage, pct}.pctstays between 0 and 1 and never decreases. - Two jobs with the same
seedand the same input make the same image bytes. seedis absent from the terminal metadata. The plugin never reports it.- No event follows a
cancel. The terminal frame isdonewithoutcome = cancelled. - The plugin emits
imageandprogress. It emits no other channel for this job.