Skip to content

Create Task black-forest-labs/flux-fill-dev

POST https://www.kkiai.com/replicate/v1/models/black-forest-labs/flux-fill-dev/predictions

Official documentation: https://replicate.com/black-forest-labs/flux-fill-dev

Request Parameters

Authorization

Add the Authorization parameter to the Header, with the value being the Token concatenated after Bearer

Example: Authorization: Bearer ********************

Header Parameters

ParameterTypeRequiredDescriptionExample
AuthorizationstringOptionalBearer {{YOUR_API_KEY}}

Body Parameters (application/json)

ParameterTypeRequiredDescription
inputobjectOptional
  └ maskstringOptionalA black and white image describing the parts of the image that need to be repaired. Black areas will be preserved, white areas will be repaired.
  └ imagestringRequiredThe image to be repaired. May contain an Alpha mask. If the image width or height is not a multiple of 32, it will be scaled to the nearest multiple of 32. If the image dimensions exceed 1440x1440, it will be scaled down to fit within 1440x1440
  └ promptstringRequired
  └ guidanceintegerOptionalGuidance information for image generation. Default value: 30. Minimum: 0, Maximum: 100.
  └ lora_scaleintegerOptionalDetermines the applicable strength of the main LoRA. For base inference, reasonable results are between 0 and 1. For go_fast, we apply a 1.5x multiplier to this value; typically, scaling the base value by this multiplier performs well. You may still need to experiment to find the optimal value for your specific LoRA. Default value: 1. Minimum: -1, Maximum: 3.
  └ megapixelsstringOptionalApproximate number of pixels for the generated image. Use match_input to match the input size (capped at 1440x1440 pixels), default value: "1".
  └ num_outputsintegerOptionalNumber of outputs to generate. Default value: 1. Minimum: 1, Maximum: 4.
  └ output_formatstringOptionalFormat of the output image. Default value: "webp".
  └ output_qualityintegerOptionalQuality when saving the output image, ranging from 0 to 100. 100 is the best quality, 0 is the lowest quality. Not applicable to .png output. Default value: 80
  └ num_inference_stepsintegerOptionalNumber of denoising steps. Recommended range is 28-50. Fewer steps result in lower output quality but faster speed. Default value: 28. Minimum: 1, Maximum: 50.

Request Example

json
{
    "input": {
      "mask": "https://replicate.delivery/pbxt/M0hxLu8a1YBcybWuumSsfoEec8ooer6JZ2fR28vuM1U0CN9m/74b40bb1-364a-461a-bec5-200a38c7bc87.png",
      "image": "https://replicate.delivery/pbxt/M0hxMJeO7wFCMr7QYNZsjRxzHhz6ntlLllMteRQNsRD7f3Nf/flux-fill-dev.webp",
      "prompt": "a spaceship",
      "guidance": 30,
      "lora_scale": 1,
      "megapixels": "1",
      "num_outputs": 2,
      "output_format": "webp",
      "output_quality": 80,
      "num_inference_steps": 28
    }
  }

cURL Example

bash
curl --location --request POST 'https://www.kkiai.com/replicate/v1/models/black-forest-labs/flux-fill-dev/predictions' \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data-raw '{
    "input": {
      "mask": "https://replicate.delivery/pbxt/M0hxLu8a1YBcybWuumSsfoEec8ooer6JZ2fR28vuM1U0CN9m/74b40bb1-364a-461a-bec5-200a38c7bc87.png",
      "image": "https://replicate.delivery/pbxt/M0hxMJeO7wFCMr7QYNZsjRxzHhz6ntlLllMteRQNsRD7f3Nf/flux-fill-dev.webp",
      "prompt": "a spaceship",
      "guidance": 30,
      "lora_scale": 1,
      "megapixels": "1",
      "num_outputs": 2,
      "output_format": "webp",
      "output_quality": 80,
      "num_inference_steps": 28
    }
  }'

Response

🟢 200 Success

Response Body

ParameterTypeRequiredDescription
idstringRequired
modelstringRequired
versionstringRequired
inputobjectRequired
  └ aspect_ratiostringRequired
  └ input_imagestringRequired
  └ output_formatstringRequired
  └ promptstringRequired
  └ prompt_upsamplingbooleanRequired
  └ safety_toleranceintegerRequired
logsstringRequired
outputnullRequired
data_removedbooleanRequired
errornullRequired
statusstringRequired
created_atstringRequired
urlsobjectRequired
  └ cancelstringRequired
  └ getstringRequired
  └ streamstringRequired
  └ webstringRequired

Response Example

json
{
    "id": "tv3jnp73n1rmc0crb54b3srz94",
    "model": "black-forest-labs/flux-fill-dev",
    "version": "hidden",
    "input": {
        "guidance": 30,
        "image": "https://replicate.delivery/pbxt/M0hxMJeO7wFCMr7QYNZsjRxzHhz6ntlLllMteRQNsRD7f3Nf/flux-fill-dev.webp",
        "lora_scale": 1,
        "mask": "https://replicate.delivery/pbxt/M0hxLu8a1YBcybWuumSsfoEec8ooer6JZ2fR28vuM1U0CN9m/74b40bb1-364a-461a-bec5-200a38c7bc87.png",
        "megapixels": "1",
        "num_inference_steps": 28,
        "num_outputs": 1,
        "output_format": "webp",
        "output_quality": 80,
        "prompt": "a spaceship"
    },
    "logs": "",
    "output": null,
    "data_removed": false,
    "error": null,
    "status": "starting",
    "created_at": "2025-07-30T03:03:25.864Z",
    "urls": {
        "cancel": "https://api.replicate.com/v1/predictions/tv3jnp73n1rmc0crb54b3srz94/cancel",
        "get": "https://api.replicate.com/v1/predictions/tv3jnp73n1rmc0crb54b3srz94",
        "stream": "https://stream.replicate.com/v1/files/bcwr-epcf2nmmvkvxq7trerel6zuoiwzyoji3ifhkuu3lf7rtdzh3i6ca",
        "web": "https://replicate.com/p/tv3jnp73n1rmc0crb54b3srz94"
    }
}