Blip 扩散
开发环境
开发环境
POST
https://stablediffusionapi.com/api/v5/blip_diffusion
POST
向 https://stablediffusionapi.com/api/v5/blip_diffusion 接口发出请求,并将所需参数作为请求正文传递到接口。controlnet_generation
,请求将如下所示{
"key":"",
"seed":88888,
"task":"controlnet_generation",
"prompt":"on a marble table",
"style_image":"https://m.media-amazon.com/images/I/61qEOpxc1WL.jpg",
"controlnet_condition_image":"https://m.media-amazon.com/images/I/81ELJHbkafL._AC_SX569_.jpg",
"style_subject":"teapot",
"target_subject":"cup",
"guidance_scale":10,
"steps":35,
"height":512,
"width":512,
"webhook": null,
"track_id": null
}
controlnet_scribble_generation
,请求将如下所示{
"key":"",
"seed":88888,
"task":"controlnet_generation",
"prompt":"on a marble table",
"style_image":"//huggingface.co/datasets/ayushtues/blipdiffusion_images/resolve/main/flower.jpg",
"controlnet_condition_image":"https://huggingface.co/lllyasviel/sd-controlnet-scribble/resolve/main/images/bag.png",
"style_subject":"flower",
"target_subject":"bag",
"guidance_scale":10,
"steps":35,
"height":512,
"width":512,
"webhook": null,
"track_id": null
}
请求示例请求示例
Shell
JavaScript
Java
Swift
curl --location --request POST 'https://stablediffusionapi.com/api/v5/blip_diffusion?members&reference&Type&_postman_listIndexKey=key&_postman_listAllowsMultipleValues' \
--data-raw '{
"key":"",
"seed":88888,
"task":"zeroshot",
"prompt":"on a marble table",
"condition_image":"https://m.media-amazon.com/images/I/61qEOpxc1WL.jpg",
"condition_subject":"teapot",
"target_subject":"school bag",
"guidance_scale":7.5,
"steps":35,
"height":512,
"width":512,
"webhook": null,
"track_id": null
}'
响应示例响应示例
{
"status": "success",
"generationTime": 3.270559072494507,
"id": 563,
"output": [
"https://pub-3626123a908346a7a8be8d9295f44e26.r2.dev/generations/9c1e05cc-16f0-4a11-9900-a6edd56586dd.png.png"
],
"meta": {
"base64": "no",
"file_prefix": "9c1e05cc-16f0-4a11-9900-a6edd56586dd.png",
"guidance_scale": 7.5,
"height": 512,
"instant_response": "no",
"neg_prompt": "over-exposure, under-exposure, saturated, duplicate, out of frame, lowres, cropped, worst quality, low quality, jpeg artifacts, morbid, mutilated, out of frame, ugly, bad anatomy, bad proportions, deformed, blurry, duplicate",
"num_inference_steps": 35,
"outdir": "out",
"prompt": "on a marble table",
"prompt_reps": 20,
"prompt_strength": 1,
"reference_image": "https://m.media-amazon.com/images/I/61qEOpxc1WL.jpg",
"seed": 88888,
"source_subject_category": "teapot",
"sub_task": "zeroshot",
"target_subject_category": "shoe",
"temp": "no",
"width": 512
}
}
请求参数
Body 参数application/json