创建任务 lucataco/flux-dev-lora
POST /replicate/v1/predictions
说明
概览
| Method | POST |
|---|---|
| Path | /replicate/v1/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": { "version": { "type": "string" }, "input": { "type": "object", "properties": { "prompt": { "type": "string", "description": "提示生成图像。" }, "hf_lora": { "type": "string", "description": "HF、Replicate、CivitAI 或 LoRA 的 URL。例如:alvdansen/frosting_lane_flux" }, "lora_scale": { "type": "number", "description": "LoRA 权重的缩放。默认值:0.8。" }, "num_outputs": { "type": "integer", "description": "要输出的图像数量。默认值:1。最小值:1,最大值:4。" }, "aspect_ratio": { "type": "string", "description": "生成图像的长宽比。默认值:“1:1”。" }, "output_format": { "type": "string", "description": "输出图像的格式。默认值:“webp”。" }, "guidance_scale": { "type": "number", "description": "引导强度。默认值:3.5。最小值:0,最大值:10。" }, "output_quality": { "type": "integer", "description": "保存输出图像时的质量,范围为 0 至 100。100 为最佳质量,0 为最低质量。与 .png 输出无关。默认值:80。" }, "prompt_strength": { "type": "number", "description": "使用图像对图像时的提示强度(或去噪强度)。1.0 对应于完全破坏图像中的信息。默认值:0.8。" }, "num_inference_steps": { "type": "integer", "description": "推理步骤数。默认值:28。最小值:1,最大值:50。" } }, "required": [ "prompt" ], "x-apifox-orders": [ "prompt", "hf_lora", "lora_scale", "num_outputs", "aspect_ratio", "output_format", "guidance_scale", "output_quality", "prompt_strength", "num_inference_steps" ] } }, "x-apifox-orders": [ "version", "input" ] }, "mediaType": "", "examples": [ { "value": "{\n \"version\": \"lucataco/flux-dev-lora:091495765fa5ef2725a175a57b276ec30dc9d39c22d30410f2ede68a3eab66b3\",\n \"input\": {\n \"prompt\": \"a beautiful castle frstingln illustration\",\n \"hf_lora\": \"alvdansen/frosting_lane_flux\",\n \"lora_scale\": 0.8,\n \"num_outputs\": 1,\n \"aspect_ratio\": \"1:1\",\n \"output_format\": \"webp\",\n \"guidance_scale\": 3.5,\n \"output_quality\": 80,\n \"prompt_strength\": 0.8,\n \"num_inference_steps\": 28\n }\n }", "mediaType": "application/json", "description": "" } ], "oasExtensions": "" }
响应
[ { "id": 728681416, "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": 728681416, "data": "{\n \"id\": \"c9zn270jk1rj00crans8m6ssjc\",\n \"model\": \"lucataco/flux-dev-lora\",\n \"version\": \"091495765fa5ef2725a175a57b276ec30dc9d39c22d30410f2ede68a3eab66b3\",\n \"input\": {\n \"aspect_ratio\": \"1:1\",\n \"guidance_scale\": 3.5,\n \"hf_lora\": \"alvdansen/frosting_lane_flux\",\n \"lora_scale\": 0.8,\n \"num_inference_steps\": 28,\n \"num_outputs\": 1,\n \"output_format\": \"webp\",\n \"output_quality\": 80,\n \"prompt\": \"a beautiful castle frstingln illustration\",\n \"prompt_strength\": 0.8\n },\n \"logs\": \"\",\n \"output\": null,\n \"data_removed\": false,\n \"error\": null,\n \"status\": \"starting\",\n \"created_at\": \"2025-07-29T09:09:55.992Z\",\n \"urls\": {\n \"cancel\": \"https://api.replicate.com/v1/predictions/c9zn270jk1rj00crans8m6ssjc/cancel\",\n \"get\": \"https://api.replicate.com/v1/predictions/c9zn270jk1rj00crans8m6ssjc\",\n \"stream\": \"https://stream.replicate.com/v1/files/qoxq-37kfnrolbp7l2vy5f2ffduf6vyqye4savtprvsiikqzpcjbuejfa\",\n \"web\": \"https://replicate.com/p/c9zn270jk1rj00crans8m6ssjc\"\n }\n}", "description": "", "oasKey": "", "oasExtensions": "", "id": 648888687 } ]