Mask-based inpainting: insert new content or remove regions from an image.
Authenticate with the X-API-Key request header.
List price. Volume / bulk customers get a discounted rate — contact us for account pricing.
| Name | Type | Required | Description | Default / options |
|---|---|---|---|---|
| image_url | string | required | Source image to edit. | — |
| mask_url | string | required | Mask image marking the edit region. | — |
| mode | string | optional | Edit mode. | default: insertinsertremove |
| prompt | string | optional | Prompt for inserted content (required when mode=insert). | — |
| mask_dilation | number | optional | Mask dilation 0-1 (grow the masked region). | — |
| sample_count | number | optional | Number of images to generate (1-4). | default: 1 |
| negative_prompt | string | optional | Things to avoid in the output. | — |
| guidance_scale | number | optional | Prompt-adherence strength. | — |
| base_steps | number | optional | Sampling steps for the base model (1-100). | — |
| seed | number | optional | RNG seed (0-4294967295) for deterministic output. Forces add_watermark off when set. | — |
| add_watermark | boolean | optional | Add SynthID watermark. Cannot be combined with seed. | default: true |
| person_generation | string | optional | Allow people in output: dont_allow | allow_adult | allow_all. | default: allow_adult |
| safety_setting | string | optional | Safety filter: block_low_and_above | block_medium_and_above | block_only_high | block_none. | — |
curl -X POST https://brahmand-api.bulletshorts.co/v1/image/imagen-edit \
-H "X-API-Key: $TRINETRA_API_KEY" \
-H "Content-Type: application/json" \
-d '{"image_url":"https://example.com/room.jpg","mask_url":"https://example.com/room-mask.png","mode":"insert","prompt":"a potted monstera plant"}'{
"image_url": "https://example.com/room.jpg",
"mask_url": "https://example.com/room-mask.png",
"mode": "insert",
"prompt": "a potted monstera plant"
}Submitting a job returns 202 Accepted with a job id. Poll GET /v1/jobs/{id} until the job reaches a terminal state, or register a webhook to be notified.
{
"job_id": "job_imagenedit_a1b2c3",
"status": "queued"
}{
"id": "job_imagenedit_a1b2c3",
"model": "imagen-edit",
"status": "succeeded",
"output": {
"outputs": [
{
"url": "https://cdn.trinetra.ai/out/imagen-edit/a1b2c3.png",
"type": "image"
}
]
},
"credits_charged": 10
}Webhook: set a webhook_url on your API key to receive a POST with the terminal job document instead of polling.