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.

Image
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.

ParameterTypeRequiredDescriptionDefault
request_bodyobjectYesNo parameter description.—
request_body.seedinteger | unknownNo The same seed and the same prompt given to the same version of the model will output the same image every time. —
request_body.lorasarrayNo 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[].pathstringYesURL or the path to the LoRA weights.—
request_body.loras[].scalenumberNo The scale of the LoRA weight. This is used to scale the LoRA weight before merging it with the base model. 1
request_body.promptstringYesThe prompt for the image to image task.—
request_body.mask_urlstringYesThe URL of the mask for inpainting.—
request_body.strengthnumberNoThe strength of the initial image. Higher strength values are better for this model.0.88
request_body.image_urlstringYesThe URL of the image to be inpainted.—
request_body.sync_modebooleanNoIf `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_imagesintegerNoThe number of images to generate.1
request_body.accelerationenum (none | regular | high)NoThe speed of the generation. The higher the speed, the faster the generation.none
request_body.output_formatenum (jpeg | png)NoThe format of the generated image.png
request_body.guidance_scalenumberNo 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_stepsintegerNoThe number of inference steps to perform.30
request_body.reference_image_urlstringYesThe URL of the reference image for inpainting.—
request_body.enable_safety_checkerbooleanNoIf 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-Key

Submit 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
JSONPartial content
{
  "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.