Tools
Inpaint tool
Paint a mask over the area you want to change and describe the edit. Optionally attach a reference image (Image3) for the model to integrate.
Category: Image · inpaint
How to use & limits
- Post-production tool: image edit driven entirely by the prompt (the mask you paint in the app just marks the region; the result comes from the prompt).
- Edits or replaces a region of the image while preserving the rest.
- image_urls is required: send the base image (and, optionally, a reference to integrate).
- In the prompt you declare what to change in the area (e.g. 'replace the jacket with a black leather one').
- Output: an image. resolution 1K/2K/4K and size shape the result.
Parameters
Fields accepted in params (or first-class, where applicable) for POST /generations.
| Name | Label | Type | Required | Default | Options | Min / Max | Description |
|---|---|---|---|---|---|---|---|
resolution | Resolution | select | Optional | 1K | 1K · 2K · 4K | — | Output resolution: 1K, 2K or 4K (default 1K). |
size | Size | select | Optional | 1:1 | 1:1 · 2:3 · 3:2 · 3:4 · 4:3 · 9:16 · 16:9 · 21:9 | — | Output aspect ratio: 1:1, 2:3, 3:2, 3:4, 4:3, 9:16, 16:9 or 21:9 (default 1:1). |
image_urls | Optional references | multi_select | Optional | — | — | — – 14 | Base image plus optional references, up to 14 — required. |
prompt | Prompt | textarea | Required | — | — | — | Edit instruction for the marked region. |
Example request
curl -X POST https://caranguejo.art/api/v1/dev/generations \
-H "Authorization: Bearer $CK" \
-H "Content-Type: application/json" \
-d '{
"model": "inpaint",
"prompt": "Replace the subject's jacket with a black leather jacket, keeping the pose, face and background.",
"params": {
"resolution": "1K",
"size": "3:4",
"image_urls": [
"https://media.caranguejo.art/inputs/example.png"
]
}
}'
const res = await fetch("https://caranguejo.art/api/v1/dev/generations", {
method: "POST",
headers: {
"Authorization": "Bearer " + process.env.CK,
"Content-Type": "application/json",
},
body: JSON.stringify({
"model": "inpaint",
"prompt": "Replace the subject's jacket with a black leather jacket, keeping the pose, face and background.",
"params": {
"resolution": "1K",
"size": "3:4",
"image_urls": [
"https://media.caranguejo.art/inputs/example.png"
]
}
}),
});
const { data } = await res.json();
Example response
{
"id": "9f0c1a7e-…",
"object": "generation",
"model": "inpaint",
"type": "tool",
"status": "completed",
"output": {
"assets": [
{
"url": "https://media.caranguejo.art/outputs/example.png",
"type": "image"
}
],
"images": [
{
"url": "https://media.caranguejo.art/outputs/example.png"
}
]
}
}
The job's real cost is returned as credits_charged on the completed response — check GET /balance for the account balance.
Common errors for this job type:
insufficient_credits | Account balance can't cover the job cost. |
content_policy_violation | Prompt or media rejected by content policy. |
generation_timeout | The job exceeded the maximum processing time. |
rate_limited | Too many requests per minute. |
invalid_input | A required parameter is missing or outside the model's schema. |
generation_failed | Generic processing failure. |