官方文档:https://replicate.com/black-forest-labs/flux-fill-pro
POST
/replicate/v1/models/black-forest-labs/flux-fill-pro/predictions创建任务 black-forest-labs/flux-fill-pro
API Key application/json
请求示例
curl -X POST https://top.qingyuntop.ai/replicate/v1/models/black-forest-labs/flux-fill-pro/predictions \
-H "Authorization: Bearer ${QINGYUN_TOP_API_KEY}" \
-H "Content-Type: application/json" \
-d '{
"input": {
"mask": "https://replicate.delivery/pbxt/M0gpLCYdCLbnhcz95Poy66q30XW9VSCN65DoDQ8IzdzlQonw/kill-bill-mask.png",
"image": "https://replicate.delivery/pbxt/M0gpKVE9wmEtOQFNDOpwz1uGs0u6nK2NcE85IihwlN0ZEnMF/kill-bill-poster.jpg",
"steps": 50,
"prompt": "movie poster says \"FLUX FILL\"",
"guidance": 60,
"outpaint": "None",
"output_format": "jpg",
"safety_tolerance": 2,
"prompt_upsampling": false
}
}'请求参数
| 参数 | 位置 | 类型 | 必填 | 说明 | 示例 |
|---|---|---|---|---|---|
Authorization | Header | string | 否 | - | Bearer {{YOUR_API_KEY}} |
input | JSON body | object | 否 | - | - |
input.mask | JSON body | string | 否 | 一张黑白图片,用于描述图片中需要修复的部分。黑色区域将被保留,白色区域将被修复。必须与图片大小相同。如果您在原始图片中提供了 Alpha 蒙版,则此参数可选。必须为 jpeg、png、gif 或 webp 格式。 | - |
input.image | JSON body | string | 是 | 待修复的图片。可以包含 Alpha 蒙版。必须为 jpeg、png、gif 或 webp 格式。 | - |
input.steps | JSON body | integer | 否 | 扩散步骤数。值越高,细节越精细,但处理时间也越长。默认值:50。最小值:15,最大值:50。 | - |
input.prompt | JSON body | string | 是 | 图像生成的文字提示。 | - |
input.guidance | JSON body | integer | 否 | 控制文本提示的遵循度与图像质量/多样性之间的平衡。值越高,输出结果越接近提示,但可能会降低整体图像质量。值越低,输出结果的创作自由度就越大,但可能与提示的相关性较低。默认值:60。最小值:1.5,最大值:100。 | - |
input.outpaint | JSON body | string | 否 | 用于对输入图像进行快速修复的选项。蒙版将被忽略。默认值:"None" | - |
input.output_format | JSON body | string | 否 | 输出图像的格式。默认值:“jpg”。 | - |
input.safety_tolerance | JSON body | integer | 否 | 安全容差,1 表示最严格,6 表示最宽松。默认值:2。 | - |
input.prompt_upsampling | JSON body | boolean | 否 | 自动修改提示,生成更多创意。默认值:false | - |
返回响应 (200)
| 参数 | 位置 | 类型 | 必填 | 说明 | 示例 |
|---|---|---|---|---|---|
id | 响应 JSON | string | 是 | - | - |
model | 响应 JSON | string | 是 | - | - |
version | 响应 JSON | string | 是 | - | - |
input | 响应 JSON | object | 是 | - | - |
input.aspect_ratio | 响应 JSON | string | 是 | - | - |
input.input_image | 响应 JSON | string | 是 | - | - |
input.output_format | 响应 JSON | string | 是 | - | - |
input.prompt | 响应 JSON | string | 是 | - | - |
input.prompt_upsampling | 响应 JSON | boolean | 是 | - | - |
input.safety_tolerance | 响应 JSON | integer | 是 | - | - |
logs | 响应 JSON | string | 是 | - | - |
output | 响应 JSON | null | 是 | - | - |
data_removed | 响应 JSON | boolean | 是 | - | - |
error | 响应 JSON | null | 是 | - | - |
status | 响应 JSON | string | 是 | - | - |
created_at | 响应 JSON | string | 是 | - | - |
urls | 响应 JSON | object | 是 | - | - |
urls.cancel | 响应 JSON | string | 是 | - | - |
urls.get | 响应 JSON | string | 是 | - | - |
urls.stream | 响应 JSON | string | 是 | - | - |
urls.web | 响应 JSON | string | 是 | - | - |
响应示例
{
"id": "w72vtvbb79rmc0crb57tckqt24",
"model": "black-forest-labs/flux-fill-pro",
"version": "hidden",
"input": {
"guidance": 60,
"image": "https://replicate.delivery/pbxt/M0gpKVE9wmEtOQFNDOpwz1uGs0u6nK2NcE85IihwlN0ZEnMF/kill-bill-poster.jpg",
"mask": "https://replicate.delivery/pbxt/M0gpLCYdCLbnhcz95Poy66q30XW9VSCN65DoDQ8IzdzlQonw/kill-bill-mask.png",
"outpaint": "None",
"output_format": "jpg",
"prompt": "movie poster says \"FLUX FILL\"",
"prompt_upsampling": false,
"safety_tolerance": 2,
"steps": 50
},
"logs": "",
"output": null,
"data_removed": false,
"error": null,
"status": "starting",
"created_at": "2025-07-30T03:10:33.786Z",
"urls": {
"cancel": "https://api.replicate.com/v1/predictions/w72vtvbb79rmc0crb57tckqt24/cancel",
"get": "https://api.replicate.com/v1/predictions/w72vtvbb79rmc0crb57tckqt24",
"stream": "https://stream.replicate.com/v1/files/bcwr-3y7tn6jo35hzo7xvk5kf2dslvdwmggf5zty5vnbfhq4tsggfhesa",
"web": "https://replicate.com/p/w72vtvbb79rmc0crb57tckqt24"
}
}来源原始接口定义(用于追溯)
以下内容来自 Apifox 快照,可能包含兼容层字段或旧示例;公开调用请以本页的协议说明和当前模型列表为准。
{
"id": 495899858,
"name": "创建任务 black-forest-labs/flux-fill-pro",
"type": "http",
"serverId": "",
"preProcessors": [],
"postProcessors": [
{
"type": "customScript",
"data": "// 将接口返回数据,封装成自己需要的结构\r\nvar resp = {\r\n response: pm.response.json().data[0].url\r\n}\r\n\r\n// html 模板字符\r\nvar template = `<html><img src=\"{{response}}\" /></html>`;\r\n\r\n// 设置 visualizer 数据。传模板、解析对象。\r\npm.visualizer.set(template, resp);",
"defaultEnable": true,
"enable": true,
"id": "a7QrNF7Ox2kKxRonRwMVreyNjD8OcIKV"
}
],
"inheritPreProcessors": {},
"inheritPostProcessors": {},
"description": "官方文档:https://replicate.com/black-forest-labs/flux-fill-pro",
"operationId": "",
"sourceUrl": "",
"method": "post",
"path": "/replicate/v1/models/black-forest-labs/flux-fill-pro/predictions",
"tags": [],
"status": 1,
"requestBody": {
"type": "application/json",
"parameters": [],
"jsonSchema": {
"type": "object",
"properties": {
"input": {
"type": "object",
"properties": {
"mask": {
"type": "string",
"description": "一张黑白图片,用于描述图片中需要修复的部分。黑色区域将被保留,白色区域将被修复。必须与图片大小相同。如果您在原始图片中提供了 Alpha 蒙版,则此参数可选。必须为 jpeg、png、gif 或 webp 格式。"
},
"image": {
"type": "string",
"description": "待修复的图片。可以包含 Alpha 蒙版。必须为 jpeg、png、gif 或 webp 格式。"
},
"steps": {
"type": "integer",
"description": "扩散步骤数。值越高,细节越精细,但处理时间也越长。默认值:50。最小值:15,最大值:50。"
},
"prompt": {
"type": "string",
"description": "图像生成的文字提示。"
},
"guidance": {
"type": "integer",
"description": "控制文本提示的遵循度与图像质量/多样性之间的平衡。值越高,输出结果越接近提示,但可能会降低整体图像质量。值越低,输出结果的创作自由度就越大,但可能与提示的相关性较低。默认值:60。最小值:1.5,最大值:100。"
},
"outpaint": {
"type": "string",
"description": "用于对输入图像进行快速修复的选项。蒙版将被忽略。默认值:\"None\""
},
"output_format": {
"type": "string",
"description": "输出图像的格式。默认值:“jpg”。"
},
"safety_tolerance": {
"type": "integer",
"description": "安全容差,1 表示最严格,6 表示最宽松。默认值:2。"
},
"prompt_upsampling": {
"type": "boolean",
"description": "自动修改提示,生成更多创意。默认值:false"
}
},
"required": [
"image",
"prompt"
],
"x-apifox-orders": [
"mask",
"image",
"steps",
"prompt",
"guidance",
"outpaint",
"output_format",
"safety_tolerance",
"prompt_upsampling"
]
}
},
"x-apifox-orders": [
"input"
]
},
"examples": [
{
"value": "{\n \"input\": {\n \"mask\": \"https://replicate.delivery/pbxt/M0gpLCYdCLbnhcz95Poy66q30XW9VSCN65DoDQ8IzdzlQonw/kill-bill-mask.png\",\n \"image\": \"https://replicate.delivery/pbxt/M0gpKVE9wmEtOQFNDOpwz1uGs0u6nK2NcE85IihwlN0ZEnMF/kill-bill-poster.jpg\",\n \"steps\": 50,\n \"prompt\": \"movie poster says \\\"FLUX FILL\\\"\",\n \"guidance\": 60,\n \"outpaint\": \"None\",\n \"output_format\": \"jpg\",\n \"safety_tolerance\": 2,\n \"prompt_upsampling\": false\n }\n }",
"mediaType": "application/json",
"description": ""
}
],
"mediaType": "",
"oasExtensions": "",
"required": false,
"additionalContentTypes": []
},
"parameters": {
"path": [],
"query": [],
"cookie": [],
"header": [
{
"id": "GTujCrB2It",
"name": "Authorization",
"required": false,
"enable": true,
"description": "",
"type": "string",
"sampleValue": "Bearer {{YOUR_API_KEY}}"
}
]
},
"commonParameters": {
"query": [],
"body": [],
"cookie": [],
"header": []
},
"auth": {},
"responses": [
{
"id": 101866014,
"name": "成功",
"code": 200,
"contentType": "json",
"jsonSchema": {
"type": "object",
"properties": {
"id": {
"type": "string"
},
"model": {
"type": "string"
},
"version": {
"type": "string"
},
"input": {
"type": "object",
"properties": {
"aspect_ratio": {
"type": "string"
},
"input_image": {
"type": "string"
},
"output_format": {
"type": "string"
},
"prompt": {
"type": "string"
},
"prompt_upsampling": {
"type": "boolean"
},
"safety_tolerance": {
"type": "integer"
}
},
"required": [
"aspect_ratio",
"input_image",
"output_format",
"prompt",
"prompt_upsampling",
"safety_tolerance"
],
"x-apifox-orders": [
"aspect_ratio",
"input_image",
"output_format",
"prompt",
"prompt_upsampling",
"safety_tolerance"
]
},
"logs": {
"type": "string"
},
"output": {
"type": "null"
},
"data_removed": {
"type": "boolean"
},
"error": {
"type": "null"
},
"status": {
"type": "string"
},
"created_at": {
"type": "string"
},
"urls": {
"type": "object",
"properties": {
"cancel": {
"type": "string"
},
"get": {
"type": "string"
},
"stream": {
"type": "string"
},
"web": {
"type": "string"
}
},
"required": [
"cancel",
"get",
"stream",
"web"
],
"x-apifox-orders": [
"cancel",
"get",
"stream",
"web"
]
}
},
"required": [
"id",
"model",
"version",
"input",
"logs",
"output",
"data_removed",
"error",
"status",
"created_at",
"urls"
],
"x-apifox-orders": [
"id",
"model",
"version",
"input",
"logs",
"output",
"data_removed",
"error",
"status",
"created_at",
"urls"
]
},
"itemSchema": {},
"description": "",
"mediaType": "",
"headers": [],
"oasExtensions": ""
}
],
"responseExamples": [
{
"name": "成功示例",
"responseId": 101866014,
"data": "{\n \"id\": \"w72vtvbb79rmc0crb57tckqt24\",\n \"model\": \"black-forest-labs/flux-fill-pro\",\n \"version\": \"hidden\",\n \"input\": {\n \"guidance\": 60,\n \"image\": \"https://replicate.delivery/pbxt/M0gpKVE9wmEtOQFNDOpwz1uGs0u6nK2NcE85IihwlN0ZEnMF/kill-bill-poster.jpg\",\n \"mask\": \"https://replicate.delivery/pbxt/M0gpLCYdCLbnhcz95Poy66q30XW9VSCN65DoDQ8IzdzlQonw/kill-bill-mask.png\",\n \"outpaint\": \"None\",\n \"output_format\": \"jpg\",\n \"prompt\": \"movie poster says \\\"FLUX FILL\\\"\",\n \"prompt_upsampling\": false,\n \"safety_tolerance\": 2,\n \"steps\": 50\n },\n \"logs\": \"\",\n \"output\": null,\n \"data_removed\": false,\n \"error\": null,\n \"status\": \"starting\",\n \"created_at\": \"2025-07-30T03:10:33.786Z\",\n \"urls\": {\n \"cancel\": \"https://api.replicate.com/v1/predictions/w72vtvbb79rmc0crb57tckqt24/cancel\",\n \"get\": \"https://api.replicate.com/v1/predictions/w72vtvbb79rmc0crb57tckqt24\",\n \"stream\": \"https://stream.replicate.com/v1/files/bcwr-3y7tn6jo35hzo7xvk5kf2dslvdwmggf5zty5vnbfhq4tsggfhesa\",\n \"web\": \"https://replicate.com/p/w72vtvbb79rmc0crb57tckqt24\"\n }\n}",
"description": "",
"oasKey": "",
"oasExtensions": "",
"id": "019fc09b-0b2d-761c-a052-315081e659d2"
}
],
"codeSamples": [],
"projectId": 8662722,
"moduleId": 8310462,
"folderId": 92436086,
"ordering": 156,
"responsibleId": 0,
"commonResponseStatus": {},
"advancedSettings": {
"disabledSystemHeaders": {},
"isDefaultUrlEncoding": 1
},
"customApiFields": {},
"oasExtensions": "",
"mockScript": {},
"createdAt": "2026-08-02T03:53:34.000Z",
"updatedAt": "2026-08-06T12:15:55.000Z",
"creatorId": 2863449,
"editorId": 2863449,
"creatorUserId": 2863449,
"editorUserId": 2863449,
"responseChildren": [
"BLANK.101866014"
],
"visibility": "INHERITED",
"securityScheme": {},
"callbacks": ""
}