# SD图生图 - 换背景接口
<a id=SD图生图 - 换背景接口>
# 基本信息
Path: /pictures/change_background
Method: POST
接口描述: 通过该接口可以保证主体特征,通过提示词修改背景
# 请求参数
Headers
参数名称 | 参数值 | 是否必须 | 示例 | 备注 |
---|---|---|---|---|
Content-Type | application/json | 是 |
Body
| 名称 | 类型 | 是否必须 | 默认值 | 备注 | 其他信息 |
| -------------------- | -------- | -------- | ------ | -------------------------------------------------------------------- | ----------------------------------------- |
| callback_url | string | 非必须 | | 回调URL | |
| taskid | number | 非必须 | | 任务ID # 默认值 -1 不回调 | |
| prompt | string | 必须 | | 提示词 | |
| img_url | string | 必须 | | 图片URL | |
| is_remove_bg | string | 非必须 | | 是否去除背景,默认值True去背景 "True"需要去除,"False"不需要去除 | |
| width | number | 非必须 | | 默认值0 ,保持原图宽度 | |
| height | number | 非必须 | | 默认值0 ,保持原图高度 | |
| negative_prompt | string | 非必须 | | 负面提示词,有默认负面提示词 | |
| is_controlnet | string | 非必须 | | 是否开启controlnet,默认已开启"True" | |
| control_model | string | 非必须 | | controlnet的model名称 | |
| batch_size | string | 非必须 | | 生成图片张数,默认值1张 | |
| mast_expend_num | string | 非必须 | | 生成Mast的膨胀系数,默认值-2(调研最优解) | |
| sd_model_checkpoint | string | 非必须 | | 模型名称 | |
| mask_url | string | 非必须 | | img_url对应的mask_url | |
| sd_lora_name | string | 必须 | | Lora列表,如["SDS_DSZGSNBJ_v1.safetensors"] | |
| sd_lora_weight | string | 必须 | | Lora权重列表,如[1] | |
| api_type | string | 必须 | | 底层服务类型,默认 pipeline,支持 pipeline 和 comfyui | |
| from | string | 必须 | | 业务来源,跟付飞确认 | |
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
# 返回数据
# 返回数据
名称 | 类型 | 是否必须 | 默认值 | 备注 | 其他信息 |
---|---|---|---|---|---|
error_code | number | 非必须 | |||
error_msg | string | 非必须 | |||
data | string [] | 非必须 | item 类型: string | ||
非必须 |