Theme
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
| Parameter | Type | Required | Description | Example |
|---|---|---|---|---|
Authorization | string | Optional | Bearer {{YOUR_API_KEY}} |
Body Parameters (application/json)
| Parameter | Type | Required | Description |
|---|---|---|---|
input | object | Optional | |
└ mask | string | Optional | A 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. |
└ image | string | Required | The 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 |
└ prompt | string | Required | |
└ guidance | integer | Optional | Guidance information for image generation. Default value: 30. Minimum: 0, Maximum: 100. |
└ lora_scale | integer | Optional | Determines 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. |
└ megapixels | string | Optional | Approximate number of pixels for the generated image. Use match_input to match the input size (capped at 1440x1440 pixels), default value: "1". |
└ num_outputs | integer | Optional | Number of outputs to generate. Default value: 1. Minimum: 1, Maximum: 4. |
└ output_format | string | Optional | Format of the output image. Default value: "webp". |
└ output_quality | integer | Optional | Quality 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_steps | integer | Optional | Number 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
| Parameter | Type | Required | Description |
|---|---|---|---|
id | string | Required | |
model | string | Required | |
version | string | Required | |
input | object | Required | |
└ aspect_ratio | string | Required | |
└ input_image | string | Required | |
└ output_format | string | Required | |
└ prompt | string | Required | |
└ prompt_upsampling | boolean | Required | |
└ safety_tolerance | integer | Required | |
logs | string | Required | |
output | null | Required | |
data_removed | boolean | Required | |
error | null | Required | |
status | string | Required | |
created_at | string | Required | |
urls | object | Required | |
└ cancel | string | Required | |
└ get | string | Required | |
└ stream | string | Required | |
└ web | string | Required |
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"
}
}