Pro API: generate and retouch images

One image costs 1 credit, whatever the mode. Generation from a prompt and retouching of an image you supply both go through the same route.

Submit an image

POST /images

{ "prompt": "portrait of a woman in a rainy street at night, neon reflections, cinematic",
  "width": 832, "height": 1216 }
FieldTypeDefaultWhat it does
promptstringrequiredThe scene. English gives the most precise results.
width, heightint1024 x 1024Pixel size. Good shapes: 1024 x 1024 (square), 832 x 1216 (portrait), 1216 x 832 (landscape).
modestringgenerationedit, img2img or inpaint, see below. Absent means generate from the prompt.
image_b64stringSource image in base64 (PNG or JPEG), required by all three retouching modes. 12 MB decoded at most.
mask_b64stringMask in base64: required by inpaint, optional for edit. Paint the areas to retouch in red, at the source image's size.
lorastringA trained character on the account: the name returned by GET /loras. Put its trigger in the prompt.
lora2, lora2_strengthstring, numberA second character and its strength (0 to 1, default 1) for a two-person scene.
stepsintengineLeave empty. The engine knows its own value.

The answer:

{ "jobId": "test-79634842-4586-46d4-ad52-d9ea236ae00d", "seed": 178078967, "cost": 1 }

The seed is drawn by the engine and returned for information. It cannot be fixed on input in this version.

The three retouching modes

All three run on the same instruction-driven editing engine, which preserves the look of the source image. When you supply a source image, width and height are read from the image itself and do not need to be sent.

modeInputsWhat the engine does
editimage_b64 + prompt (+ optional mask_b64)Applies the instruction to the whole image ("add sunglasses", "make it snow"). With a mask, the change concentrates inside the red area.
inpaintimage_b64 + mask_b64 + promptRegenerates only the red area of the mask, following the instruction. The rest is recomposed pixel for pixel.
img2imgimage_b64 + promptReworks the whole image along the prompt while keeping its composition and look: a variation.
IMG=$(base64 -w0 photo.png)
curl -s $B/images -H "Authorization: Bearer $KEY" -H "Content-Type: application/json" \
  -d "{\"mode\":\"edit\",\"prompt\":\"add a red scarf, keep everything else identical\",\"image_b64\":\"$IMG\"}"

Poll

GET /images/{jobId}

AnswerMeaning
{ "status": "pending", "phase": "IN_QUEUE" }Queued
{ "status": "pending", "phase": "IN_PROGRESS" }Rendering
{ "status": "completed", "cost": 1, "file_url": "/pro/v1/images/{jobId}/file", ... }Done, file ready
{ "status": "failed", "detail": "..." }Failed, and nothing is charged

Poll every 3 seconds, no faster: the queue is shared.

Download

GET /images/{jobId}/file

The PNG itself, as the response body (Content-Type: image/png). Available as soon as the status is completed, and 404 media_indisponible once the render is gone. Download it straight away, it is not archived.

Cancel

POST /images/{jobId}/cancel

Cancels a queued or running render. Answers { "ok": true }. Nothing is charged, and the cost reserved against the key's daily cap is given back.

Windows · Cloud or NVIDIA

Generate privately. Tonight.

Download tendre.AI, activate once, and run it forever, fully offline, on your own GPU.

Download for WindowsDownload for Android (.apk)
Download for MacMac version coming soon!
OS Windows 10/11GPU NVIDIA 8GB+VRAM 12GB recommendedDisk 20GB

No NVIDIA GPU? Start 100% in the cloud: 10 free images every day, then 1 credit per image. An NVIDIA card (8GB+) unlocks unlimited local generation.