POST /v1/images/generations creates images on the server's own GPU. The basic request and response match OpenAI's; extra fields cover editing operations that OpenAI exposes elsewhere or not at all.
import base64
result = client.images.generate(model="<image-model-id>", prompt="A lighthouse at dawn, watercolour",
size="1024x1024", n=1)
open("lighthouse.png", "wb").write(base64.b64decode(result.data[0].b64_json))
Find image model ids in GET /v1/models/catalog (their modalities include image generation) and install one with POST /v1/models/pull.
Parameters
| Parameter | Notes |
|---|---|
model, prompt | Required. |
size | WIDTHxHEIGHT, 64 to 4096 pixels per side. Default 1024x1024. Models have preferred sizes; others may be rounded. |
n | 1 to 4. |
seed | Repeat a result. |
response_format | Images are always returned as base64 (b64_json); URLs are not supported. |
safety_check | Run the on-device safety filter and drop flagged images. |
image, strength | Base64 source image for image-to-image; strength 0–1 (default 0.75) sets how much changes. |
mask | Base64 mask with image for inpainting: white areas are repainted. |
operation | img2img, inpaint, outpaint, variations, upscale, remove-background, edit, layers. |
upscale_factor | 2 or 4, for upscale. |
outpaint_percent | How far to extend each side, for outpaint. |
control_type, control_image, control_scale | ControlNet guidance (canny or depth) on models that support it. |
reference_images, layer_count | For edit with several reference images and layers on models that support them. |
Which operations a model supports depends on the model; an unsupported one answers 400 with the reason.
Response
{ "created": 1759650000, "data": [ { "b64_json": "iVBORw0KGgo…" } ] }
Describe an image
POST /v1/images/describe turns an image into an editable text prompt — useful for "make more like this".
{ "model": "<model-id>", "image": "<base64>", "detail": "detailed" }
detail is caption, detailed or more. To ask questions about an image, or read text in it, use chat with an image instead.
Good to know
- Generation is GPU-heavy. Image requests run one or a few at a time; others wait or get 503 with
Retry-Afterwhen the server is busy. - The first request after loading a model is slower while the model warms up.
- Generated images are returned, not stored on the server.
Questions
Does AI Server support DALL·E or other cloud image models? +
Only if an operator adds a cloud provider that offers them. The local image models run on the server.
Can I edit an image with a text instruction? +
Yes, with operation: "edit" on a model that supports instruction editing; send the image as image and the instruction as prompt.