Skip to content
EN

创建任务-stability-ai/stable-diffusion-inpainting

方法: POST路径: /replicate/v1/predictions

https://replicate.com/stability-ai/stable-diffusion-inpainting?input=http 使用“稳定扩散”填充图像的蒙版部分

请求参数

Header 参数

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

Body 参数 application/json

text
version
string
必需
input
object
必需
seed
integer
必需
image
string
必需
steps
integer
必需
prompt
string
必需
cfg_scale
integer
必需
scheduler
string
必需
sampler_name
string
必需
negative_prompt
string
必需
denoising_strength
number
必需
outpaint_direction
string
必需
overlay_original_img
boolean
必需
示例
{
"version"
:
"95b7223104132402a9ae91cc677285bc5eb997834bd2349fa486f53910fd68b3"
,
"input"
:
{
"mask"
:
"https://replicate.delivery/pbxt/HtGQBqO9MtVbPm0G0K43nsvvjBB0E0PaWOhuNRrRBBT4ttbf/mask.png"
,
"image"
:
"https://replicate.delivery/pbxt/HtGQBfA5TrqFYZBf0UL18NTqHrzt8UiSIsAkUuMHtjvFDO6p/overture-creations-5sI6fQgYIuo.png"
,
"width"
:
512
,
"height"
:
512
,
"prompt"
:
"Face of a yellow cat, high resolution, sitting on a park bench"
,
"scheduler"
:
"DPMSolverMultistep"
,
"num_outputs"
:
1
,
"guidance_scale"
:
7.5
,
"num_inference_steps"
:
25
}
}

请求示例代码

Shell

bash
curl --location --request POST '/replicate/v1/predictions' \
--header 'Authorization: Bearer {{YOUR_API_KEY}}' \
--header 'Content-Type: application/json' \
--data-raw '{
    "version": "95b7223104132402a9ae91cc677285bc5eb997834bd2349fa486f53910fd68b3",
    "input": {
      "mask": "https://replicate.delivery/pbxt/HtGQBqO9MtVbPm0G0K43nsvvjBB0E0PaWOhuNRrRBBT4ttbf/mask.png",
      "image": "https://replicate.delivery/pbxt/HtGQBfA5TrqFYZBf0UL18NTqHrzt8UiSIsAkUuMHtjvFDO6p/overture-creations-5sI6fQgYIuo.png",
      "width": 512,
      "height": 512,
      "prompt": "Face of a yellow cat, high resolution, sitting on a park bench",
      "scheduler": "DPMSolverMultistep",
      "num_outputs": 1,
      "guidance_scale": 7.5,
      "num_inference_steps": 25
    }
  }'

返回响应

🟢 200 成功

内容类型: application/json

响应结构

text
object

示例

json
{}