Blip 扩散
POST
https://stablediffusionapi.com/api/v5/blip_diffusion该接口允许您对传递的图像执行 blip 扩散。它最适合对象
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
}
请求参数
Body 参数application/json
key
string
必需
您用于请求授权的 API Key
seed
integer
必需
种子用于重现结果,相同的种子将再次为您提供相同的图像。为随机数传递null 。
task
string
必需
要执行的任务。它接受zeroshot,controlnet_generation和controlnet_scribble_generation. 默认为“零射击
prompt
string
必需
文本提示,包含您想要在图像中生成的内容的描述
condition_image
string
必需
任务 执行时需要zeroshot
condition_subject
string
必需
当任务 为 时需要zeroshot。它是条件图像中的主题
target_subject
string
反对结果的预期
guidance_scale
number
必需
选修的。无分类器指导的量表(最小值:1;最大值:20)。默认为8
steps
integer
必需
去噪步骤数(最小:1;最大:50)默认为20
height
integer
必需
最大高度: 高度:512 x 512
width
integer
必需
最大高度: 宽度: 512 x 512
webhook
null
必需
设置 URL 以在图像生成完成后获取 POST API 调用。
track_id
null
必需
此 ID 在 Webhook API 调用的响应中返回。这将用于识别 Webhook 请求。
示例
{
"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
}
示例代码
返回响应
成功(200)
HTTP 状态码: 200
内容格式: JSONapplication/json
数据结构
status
string
必需
generationTime
number
必需
id
integer
必需
output
array[string]
必需
meta
object
必需
base64
string
必需
file_prefix
string
必需
guidance_scale
number
必需
height
integer
必需
instant_response
string
必需
neg_prompt
string
必需
num_inference_steps
integer
必需
outdir
string
必需
prompt
string
必需
prompt_reps
integer
必需
prompt_strength
integer
必需
reference_image
string
必需
seed
integer
必需
source_subject_category
string
必需
sub_task
string
必需
target_subject_category
string
必需
temp
string
必需
width
integer
必需
示例
{
"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
}
}
最后修改时间: 1 年前