创建任务 black-forest-labs/flux-fill-dev
POST /replicate/v1/models/black-forest-labs/flux-fill-dev/predictions
说明
概览
| Method | POST |
|---|---|
| Path | /replicate/v1/models/black-forest-labs/flux-fill-dev/predictions |
| Type | http |
| Status | 1 |
| Module | 2102810 |
| Folder | 62419371 |
参数
{ "query": [], "path": [], "cookie": [], "header": [ { "required": false, "description": "", "type": "string", "id": "GTujCrB2It", "enable": true, "name": "Authorization", "sampleValue": "Bearer {{YOUR_API_KEY}}" } ] }
请求体
{ "type": "application/json", "parameters": [], "jsonSchema": { "type": "object", "properties": { "input": { "type": "object", "properties": { "mask": { "type": "string", "description": "一张黑白图像,用于描述需要修复的图像部分。黑色区域将被保留,白色区域将被修复。" }, "image": { "type": "string", "description": "待修复的图像。可包含 Alpha 蒙版。如果图像宽度或高度不是 32 的倍数,则会缩放至最接近的 32 倍数。如果图像尺寸超出 1440x1440 的范围,则会缩小以适应 1440x1440 的尺寸" }, "prompt": { "type": "string", "description": "提示生成图像。" }, "guidance": { "type": "integer", "description": "图像生成的引导信息。默认值:30。最小值:0,最大值:100。" }, "lora_scale": { "type": "integer", "description": "确定主 LoRA 的适用强度。对于基础推理,合理的结果介于 0 到 1 之间。对于 go_fast,我们对此值应用 1.5 倍乘数;通常情况下,将基础值按此倍数缩放时,性能会很好。您可能仍需要进行实验,以找到适合您特定 LoRA 的最佳值。默认值:1。最小值:-1,最大值:3。" }, "megapixels": { "type": "string", "description": "生成图像的近似像素数。使用 match_input 匹配输入的大小(上限为 1440x1440 像素),默认值:“1”。" }, "num_outputs": { "type": "integer", "description": "要生成的输出数量。默认值:1。最小值:1,最大值:4。" }, "output_format": { "type": "string", "description": "输出图像的格式。默认值:“webp”。" }, "output_quality": { "type": "integer", "description": "保存输出图像时的质量,范围为 0 至 100。100 为最佳质量,0 为最低质量。与 .png 输出无关。默认值:80" }, "num_inference_steps": { "type": "integer", "description": "去噪步数。建议范围为 28-50,步数越少,输出质量越低,但速度越快。默认值:28。最小值:1,最大值:50。" } }, "required": [ "image", "prompt" ], "x-apifox-orders": [ "mask", "image", "prompt", "guidance", "lora_scale", "megapixels", "num_outputs", "output_format", "output_quality", "num_inference_steps" ] } }, "x-apifox-orders": [ "input" ] }, "mediaType": "", "examples": [ { "value": "{\n \"input\": {\n \"mask\": \"https://replicate.delivery/pbxt/M0hxLu8a1YBcybWuumSsfoEec8ooer6JZ2fR28vuM1U0CN9m/74b40bb1-364a-461a-bec5-200a38c7bc87.png\",\n \"image\": \"https://replicate.delivery/pbxt/M0hxMJeO7wFCMr7QYNZsjRxzHhz6ntlLllMteRQNsRD7f3Nf/flux-fill-dev.webp\",\n \"prompt\": \"a spaceship\",\n \"guidance\": 30,\n \"lora_scale\": 1,\n \"megapixels\": \"1\",\n \"num_outputs\": 2,\n \"output_format\": \"webp\",\n \"output_quality\": 80,\n \"num_inference_steps\": 28\n }\n }", "mediaType": "application/json", "description": "" } ], "oasExtensions": "" }
响应
[ { "id": 729644951, "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" ] }, "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" ] } }, "required": [ "id", "model", "version", "input", "logs", "output", "data_removed", "error", "status", "created_at", "urls" ] }, "itemSchema": {}, "description": "", "mediaType": "", "headers": [], "oasExtensions": "" } ]
响应示例
[ { "name": "成功示例", "responseId": 729644951, "data": "{\n \"id\": \"tv3jnp73n1rmc0crb54b3srz94\",\n \"model\": \"black-forest-labs/flux-fill-dev\",\n \"version\": \"hidden\",\n \"input\": {\n \"guidance\": 30,\n \"image\": \"https://replicate.delivery/pbxt/M0hxMJeO7wFCMr7QYNZsjRxzHhz6ntlLllMteRQNsRD7f3Nf/flux-fill-dev.webp\",\n \"lora_scale\": 1,\n \"mask\": \"https://replicate.delivery/pbxt/M0hxLu8a1YBcybWuumSsfoEec8ooer6JZ2fR28vuM1U0CN9m/74b40bb1-364a-461a-bec5-200a38c7bc87.png\",\n \"megapixels\": \"1\",\n \"num_inference_steps\": 28,\n \"num_outputs\": 1,\n \"output_format\": \"webp\",\n \"output_quality\": 80,\n \"prompt\": \"a spaceship\"\n },\n \"logs\": \"\",\n \"output\": null,\n \"data_removed\": false,\n \"error\": null,\n \"status\": \"starting\",\n \"created_at\": \"2025-07-30T03:03:25.864Z\",\n \"urls\": {\n \"cancel\": \"https://api.replicate.com/v1/predictions/tv3jnp73n1rmc0crb54b3srz94/cancel\",\n \"get\": \"https://api.replicate.com/v1/predictions/tv3jnp73n1rmc0crb54b3srz94\",\n \"stream\": \"https://stream.replicate.com/v1/files/bcwr-epcf2nmmvkvxq7trerel6zuoiwzyoji3ifhkuu3lf7rtdzh3i6ca\",\n \"web\": \"https://replicate.com/p/tv3jnp73n1rmc0crb54b3srz94\"\n }\n}", "description": "", "oasKey": "", "oasExtensions": "", "id": 649177495 } ]