
Kandinsky 2 2 Inpaint
Kandinsky 2.2 inpainting: paints the masked part of a photo from a text prompt and leaves the rest untouched.
LAMARemoves objects, text, watermarks and blemishes from a photo: paint what to remove white on a black mask, and it fills that area in to match its surroundings.

| Name | Type | Required | Default | Details |
|---|---|---|---|---|
mask | file | Yes | — | A black-and-white picture of the photo's size: white marks the area to fill (an object, text or a watermark to remove), black what to keep. 1–2048 characters · image/png, jpeg, webp |
image | file | Yes | — | The photo: PNG, JPEG or WebP, at most 50 MB and 16.8 megapixels, at least 16 pixels a side. 1–2048 characters · image/png, jpeg, webp |
Output. Returns PNG image: The photo with the masked area filled in, as a PNG of the same size.
Send your API key in the X-API-Key header. The run is asynchronous: submit it, then poll it until it finishes. Create an API key.
curl -X POST "https://api.kainguru.com/api/v1/executions?mlFlowId=LAMA" \
-H "X-API-Key: kg_your_api_key" \
-H "Content-Type: application/json" \
-d '{
"input": {
"image": "https://example.com/input.png",
"mask": "https://example.com/input.png"
},
"outputFormat": "json"
}'
# Poll until the execution reaches a terminal state
curl "https://api.kainguru.com/api/v1/executions/{executionId}" \
-H "X-API-Key: kg_your_api_key"from kainguru import KainguruClient
with KainguruClient(api_key="kg_your_api_key", base_url="https://api.kainguru.com/api") as client:
submitted = client.executions.execute(
"LAMA",
{
"image": "https://example.com/input.png",
"mask": "https://example.com/input.png"
},
output_format="json",
)
result = client.executions.await_completion(submitted.id)
print(result.execution.output)You can fine-tune LaMa on your own data and run the tuned model through the same API. Dataset: One ZIP (at most 4 GB, no password) with 4 to 1000 examples of a photo, its mask and the target (the photo filled in, or the photo itself), the same size, and manifest.jsonl with one {"input", "mask", "target"} line each.
The steps are in the docs.
Price per image: 0.0209 credits ($0.000209). The price is shown again before every run; all prices are on the pricing page.

Kandinsky 2.2 inpainting: paints the masked part of a photo from a text prompt and leaves the rest untouched.

Kandinsky 2.2 restyles a photo from a text prompt and keeps its layout; the strength sets how far the result moves…

Edit a picture from a written instruction, changing objects, people, text or style while keeping the rest consistent.
Fine-tunable
Colourises black-and-white and faded photos: it keeps each photo's own light and shade and adds natural colours.
Fine-tunable
Enlarges a small picture 4 times with latent diffusion, drawing in new plausible detail. A creative upscale: richer…
Fine-tunable
Edits a picture from an instruction in English or Chinese with LongCat-Image-Edit (6B, Apache-2.0): local and global…
Fine-tunable