注册

Replicate Flux Dev LoRA 功能

POST https://api.quickrouter.ai/replicate/v1/predictions 在线调试 →
Authorization

在 Header 添加参数 Authorization,其值为 Bearer 之后拼接 Token

示例: Authorization: Bearer ********************

请求参数

Header 参数
Authorization string
可选
示例: Bearer {{YOUR_API_KEY}}
Content-Type string
可选
示例: application/json
Body 参数 application/json
version string
必需
模型版本ID
input object
必需
模型输入参数
prompt string
可选
输入提示
hf_lora string
可选
Huggingface 路径,或 LoRA 权重的 URL。
lora_scale number
可选
LoRA 权重的缩放。默认值:0.8
num_outputs integer
可选
要输出的图像数量。默认值:1。最小值:1,最大值:4。
aspect_ratio string
可选
生成图像的长宽比。默认值:"1:1"。
output_format string
可选
输出图像的格式。默认值:"webp"。
guidance_scale number
可选
引导强度。默认值:3.5。
output_quality integer
可选
保存输出图像时的质量。默认值:80
prompt_strength number
可选
提示强度。默认值:0.8。
num_inference_steps integer
可选
推理步骤数。默认值:28。
示例
{
    "version": "lucataco/flux-dev-lora:091495765fa5ef2725a175a57b276ec30dc9d39c22d30410f2ede68a3eab66b3",
    "input": {
        "prompt": "a beautiful castle frstingln illustration",
        "hf_lora": "alvdansen/frosting_lane_flux"
    }
}

请求示例代码

curl --location --request POST 'https://api.quickrouter.ai/replicate/v1/predictions' --header 'Authorization: Bearer YOUR_API_KEY' --header 'Content-Type: application/json' --data-raw '{
    "version": "lucataco/flux-dev-lora:091495765fa5ef2725a175a57b276ec30dc9d39c22d30410f2ede68a3eab66b3",
    "input": {
        "prompt": "a beautiful castle frstingln illustration",
        "hf_lora": "alvdansen/frosting_lane_flux"
    }
}'
var myHeaders = new Headers();
myHeaders.append("Authorization", "Bearer YOUR_API_KEY");
myHeaders.append("Content-Type", "application/json");

var raw = JSON.stringify({
  "version": "lucataco/flux-dev-lora:091495765fa5ef2725a175a57b276ec30dc9d39c22d30410f2ede68a3eab66b3",
  "input": {
    "prompt": "a beautiful castle frstingln illustration",
    "hf_lora": "alvdansen/frosting_lane_flux"
  }
});

var requestOptions = {
  method: 'POST',
  headers: myHeaders,
  body: raw,
  redirect: 'follow'
};

fetch("https://api.quickrouter.ai/replicate/v1/predictions", requestOptions)
  .then(response => response.text())
  .then(result => console.log(result))
  .catch(error => console.log('error', error));
import http.client
import json

conn = http.client.HTTPSConnection("api.quickrouter.ai")
payload = json.dumps({
  "version": "lucataco/flux-dev-lora:091495765fa5ef2725a175a57b276ec30dc9d39c22d30410f2ede68a3eab66b3",
  "input": {
    "prompt": "a beautiful castle frstingln illustration",
    "hf_lora": "alvdansen/frosting_lane_flux"
  }
})
headers = {
  'Authorization': 'Bearer YOUR_API_KEY',
  'Content-Type': 'application/json'
}
conn.request("POST", "/replicate/v1/predictions", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))

返回响应

响应参数 application/json
id string
可选
任务ID
status string
可选
任务状态
output string
可选
任务输出
示例
{
    "id": "qpt5jq1fssrmc0cmd5hvy31mdg",
    "status": "starting"
}