创建任务 lucataco/flux-schnell-lora

POST /replicate/v1/predictions

MethodPOST
Path/replicate/v1/predictions
Typehttp
Status1
Module2102810
Folder62419371

说明

概览

MethodPOST
Path/replicate/v1/predictions
Typehttp
Status1
Module2102810
Folder62419371

参数

{
  "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": "Huggingface 路径,或 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”。"
          },
          "output_quality": {
            "type": "integer",
            "description": "保存输出图像时的质量,范围为 0 至 100。100 为最佳质量,0 为最低质量。与 .png 输出无关。默认值:80"
          },
          "prompt_strength": {
            "type": "number",
            "description": "使用图像对图像时的提示强度(或去噪强度)。1.0 对应于完全破坏图像中的信息。默认值:0.8。最小值:0,最大值:1。"
          },
          "num_inference_steps": {
            "type": "integer",
            "description": "推理步骤数。默认值:4。最小值:1,最大值:12。"
          }
        },
        "required": [
          "prompt"
        ],
        "x-apifox-orders": [
          "prompt",
          "hf_lora",
          "lora_scale",
          "num_outputs",
          "aspect_ratio",
          "output_format",
          "output_quality",
          "prompt_strength",
          "num_inference_steps"
        ]
      }
    },
    "x-apifox-orders": [
      "version",
      "input"
    ]
  },
  "mediaType": "",
  "examples": [
    {
      "value": "{\n    \"version\": \"lucataco/flux-schnell-lora:2a6b576af31790b470f0a8442e1e9791213fa13799cbb65a9fc1436e96389574\",\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      \"output_quality\": 80,\n      \"prompt_strength\": 0.8,\n      \"num_inference_steps\": 4\n    }\n  }",
      "mediaType": "application/json",
      "description": ""
    }
  ],
  "oasExtensions": ""
}

响应

[
  {
    "id": 728635985,
    "name": "成功",
    "code": 200,
    "contentType": "json",
    "jsonSchema": {
      "type": "object",
      "properties": {
        "created": {
          "type": "integer"
        },
        "data": {
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "url": {
                "type": "string"
              }
            },
            "required": [
              "url"
            ],
            "x-apifox-orders": [
              "url"
            ]
          }
        }
      },
      "required": [
        "created",
        "data"
      ],
      "x-apifox-orders": [
        "created",
        "data"
      ]
    },
    "itemSchema": {},
    "description": "",
    "mediaType": "",
    "headers": [],
    "oasExtensions": ""
  }
]

响应示例

[
  {
    "name": "成功示例",
    "responseId": 728635985,
    "data": "{\n    \"id\": \"nfg4nbtgm9rj00crankr6ft6t0\",\n    \"model\": \"lucataco/flux-schnell-lora\",\n    \"version\": \"2a6b576af31790b470f0a8442e1e9791213fa13799cbb65a9fc1436e96389574\",\n    \"input\": {\n        \"aspect_ratio\": \"1:1\",\n        \"hf_lora\": \"alvdansen/frosting_lane_flux\",\n        \"lora_scale\": 0.8,\n        \"num_inference_steps\": 4,\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-29T08:58:10.978Z\",\n    \"urls\": {\n        \"cancel\": \"https://api.replicate.com/v1/predictions/nfg4nbtgm9rj00crankr6ft6t0/cancel\",\n        \"get\": \"https://api.replicate.com/v1/predictions/nfg4nbtgm9rj00crankr6ft6t0\",\n        \"stream\": \"https://stream.replicate.com/v1/files/qoxq-kwulj767tbexpyags2qj6zh6f5k6dmbvfdt6cigg2f4zcuzpnhcq\",\n        \"web\": \"https://replicate.com/p/nfg4nbtgm9rj00crankr6ft6t0\"\n    }\n}",
    "description": "",
    "oasKey": "",
    "oasExtensions": "",
    "id": 648861667
  }
]