FLUX Kontext Lora Inpaint
42.00 credits/MP
ae_flux_kontext_lora_inpaint
Edit selected areas of an image using a mask, text instructions, and a reference image while preserving the rest.
42.00 credits/MP
Pricing
42.00 AE credits per MP. Charge for successfully returned images. Round each image up to a whole MP, then sum. One MP is 1024 by 1024 pixels.
42.00 credits/MP
Parameters
Optional parameters use the platform defaults when omitted.
| Parameter | Type | Required | Description | Default |
|---|---|---|---|---|
request_body | object | Yes | No parameter description. | — |
request_body.seed | integer | unknown | No | The same seed and the same prompt given to the same version of the model will output the same image every time. | — |
request_body.loras | array | No | The LoRAs to use for the image generation. You can use any number of LoRAs and they will be merged together to generate the final image. | — |
request_body.loras[].path | string | Yes | URL or the path to the LoRA weights. | — |
request_body.loras[].scale | number | No | The scale of the LoRA weight. This is used to scale the LoRA weight before merging it with the base model. | 1 |
request_body.prompt | string | Yes | The prompt for the image to image task. | — |
request_body.mask_url | string | Yes | The URL of the mask for inpainting. | — |
request_body.strength | number | No | The strength of the initial image. Higher strength values are better for this model. | 0.88 |
request_body.image_url | string | Yes | The URL of the image to be inpainted. | — |
request_body.sync_mode | boolean | No | If `True`, the media will be returned as a data URI and the output data won't be available in the request history. | false |
request_body.num_images | integer | No | The number of images to generate. | 1 |
request_body.acceleration | enum (none | regular | high) | No | The speed of the generation. The higher the speed, the faster the generation. | none |
request_body.output_format | enum (jpeg | png) | No | The format of the generated image. | png |
request_body.guidance_scale | number | No | The CFG (Classifier Free Guidance) scale is a measure of how close you want the model to stick to your prompt when looking for a related image to show you. | 2.5 |
request_body.num_inference_steps | integer | No | The number of inference steps to perform. | 30 |
request_body.reference_image_url | string | Yes | The URL of the reference image for inpainting. | — |
request_body.enable_safety_checker | boolean | No | If set to true, the safety checker will be enabled. | true |
Invocation example
Copy the request and explore its response example.
POST
/agent-api/v1/tool/executeX-Api-KeySubmit first, then query with the returned task_id until the task completes.
Request coderequest.sh
curl --request POST \
--url 'https://agentearth.ai/agent-api/v1/tool/execute?tool_name=ae_flux_kontext_lora_inpaint' \
--header "X-Api-Key: $AGENTEARTH_API_KEY" \
--header 'Content-Type: application/json' \
--data-raw '{
"params": {
"request_body": {
"enable_safety_checker": true,
"guidance_scale": 2.5,
"image_url": "https://file.gw.xnetwk.net/file/1ba89224-91c0-40c3-a853-5896f9940e65.jpg",
"loras": [],
"mask_url": "https://file.gw.xnetwk.net/file/debd47a7-ae33-4cd1-94b7-5c8acf833e8e.png",
"num_images": 2,
"num_inference_steps": 30,
"output_format": "png",
"prompt": "Using image 1 as the base image, replace only the face inside the mask with the face of the boy from the reference image, keeping his identity. Keep the base image'\''s original gentle expression: soft natural smile, mouth slightly open with upper teeth showing, calm relaxed eyes. Realistic candid photo skin with visible pores and natural texture, matching the base image lighting, head angle and color grade. No beauty filter, no airbrushing. Everything outside the mask stays unchanged.",
"reference_image_url": "https://file.gw.xnetwk.net/file/16d7a1f9-9800-42e3-ae08-602d124742c7.jpg",
"strength": 0.88
}
}
}'Response exampleresponse.json
{
"description": "task accepted; poll the result via query_tool with this task_id",
"query_tool": "ae_get_result",
"status": "created",
"task_id": "ef80876e-26ff-4e87-a50e-241162e57a76"
}This example shows part of the response. Copied content is valid JSON.

