Skip to content
EN

创建任务-通过url路径

方法: POST路径: /replicate/v1/models/{models}/predictions

models 支持以下

"black-forest-labs/flux-1.1-pro-ultra",
"black-forest-labs/flux-1.1-pro",
"black-forest-labs/flux-dev",
"black-forest-labs/flux-pro",
"black-forest-labs/flux-schnell",
"minimax/video-01-live",
"minimax/video-01",
"recraft-ai/recraft-v3",
"recraft-ai/recraft-v3-svg",
"ideogram-ai/ideogram-v2-turbo"

models 具体参数请前往 replicate.com 查看具体模型请求参数

请求参数

Path 参数

text
models
string
必需

Header 参数

text
Content-Type
string
必需
示例:
application/json
Authorization
string
可选
默认值:
Bearer {{YOUR_API_KEY}}

Body 参数 application/json

text
input
object
必需
prompt
string
必需
go_fast
boolean
可选
megapixels
string
可选
num_outputs
integer
可选
aspect_ratio
string
默认1:1
可选
output_format
string
可选
output_quality
integer
可选
num_inference_steps
integer
可选
示例
{
"input"
:
{
"prompt"
:
"black forest gateau cake spelling out the words \"FLUX 1.1 Pro\", tasty, food photography"
,
"prompt_upsampling"
:
true
}
}

请求示例代码

Shell

bash
curl --location --request POST '/replicate/v1/models//predictions' \
--header 'Authorization: Bearer {{YOUR_API_KEY}}' \
--header 'Content-Type: application/json' \
--data-raw '{
      "input": {
            "prompt": "black forest gateau cake spelling out the words \"FLUX 1.1 Pro\", tasty, food photography",
            "prompt_upsampling": true
      }
}'

返回响应

🟢 200 成功

内容类型: application/json

响应结构

text
object

示例

json
{}