- CV任务状态码信息附录
- 绘图信息
- 绘图任务
- 模型训练
- 绘图工具
- 图片检测
- 视频工具
- 音频工具
- 翻译
sd controlnet 生图
POST
/AIGCImgOpenServ/saas/sd/v2/controlnet
img
1.动漫转真人
2.真人转动漫
3.控制人物姿势(OpenPose)、表情
4.线稿AI上色(Recolor)
5.固定主角
6.超分辨率 (单独工具)
7.去除背景 (单独工具)
8.深度检测(Depth)
9.神奇涂抹(Scibble/Sketch)
10.物体分割(Segmentation)
controlnet预处理器与模型对应关系表:https://ewe8txd9jt.feishu.cn/sheets/IbPssjPVEhnfoetP2dqcfPeBn4f
请求参数
Header 参数
X-Request-req-accessKeyId
string
必需
X-Request-req-accessKeySecret
string
必需
Body 参数application/json
prompt
string
正向描述词
n_iter
integer
生成的批次
batch_size
integer
每批次生成数量
steps
integer
迭代步数
seed
integer
随机种子
restore_faces
boolean
脸部修复
enable_hr
boolean
高清修复
hr_scale
integer
高清修复倍数
width
integer
图片宽度
height
integer
图片高度
negative_prompt
string
负向描述词
cfg_scale
number
提示词引导系数
sampler_index
string
采样方式
hr_second_pass_steps
integer
高清修复的后面步骤
hr_resize_x
integer
高清修复后的高度
hr_resize_y
integer
高清修复后的宽度
denoising_strength
number
重绘幅度
resize_mode
number
resize模式
alwayson_scripts
object
外部传入参数
sd_model_checkpoint
string
模型编码,需要带着
override_settings
object
可选
id_task
string
任务ID
sd_vae
string
变分自动编码器
output_image_format
string
输出图片格式
image_link
string
图生图的底图
controlnet
object
必需
示例
{
"prompt": "{best quality}, {{masterpiece}}, {highres}, original, extremely detailed,incredibly_absurdres,intricate detail,(detailed face),(face:1.2),1girl , kneeling down, from below , crying, sitting, ghost",
"n_iter": 1,
"steps": 25,
"seed": "1221212",
"restore_faces": false,
"enable_hr": false,
"hr_scale": 2,
"width": 768,
"height": 768,
"negative_prompt": "(nsfw:1.5),(nude:1.3), (child Pornography:1.2),molestation,incest,rape,about to be raped,(sex:1.3),uncensored,EasyNegative,(worst quality, low quality:1.4), (((distorted hands))),((disfigured)), ((bad art)), ((deformed)),((extra limbs)),((b&w)), (((duplicate))), ((morbid)), ((mutilated)),poorly drawn face, out of frame, mutation, mutated, (text), signature, monster,watermark,extra fingers,fewer fingers, Wrong hands,wrong fingers,fingers crossed,styled fingers,fingers missed,missed fingers,cheese fingers, chocolate fingers,fingers on fingers,closed fist, fighting fist,fist ,hands with fist,many fists,only hands with wrong fists,fingers crossed,\r\n,",
"cfg_scale": 11,
"sampler_index": "DPM++ 2M Karras",
"hr_second_pass_steps": 20,
"hr_resize_x": 1024,
"hr_resize_y": 1024,
"denoising_strength": 0.55,
"alwayson_scripts": {
"sd_model_checkpoint": "revAnimated_v122_7371.safetensors",
"id_task": "pro1686666",
"sd_vae": "vae-ft-mse-840000-ema-pruned.vae.pt",
"image_link": "https://paintimage.glutinoust.com/api/2023_08_18/20230818183453157097_2436301704c05f465c363e5758d46cff.png",
"controlnet": {
"args": [
{
"image_link": "https://dbt-aigc.oss-cn-hangzhou.aliyuncs.com/Output-Img2/bbbb/QR_Code4.png",
"enabled": true,
"module": "inpaint_global_harmonious",
"model": "control_v1p_sd15_brightness",
"weight": 0.7,
"resize_mode": "Crop and Resize",
"low_vram": false,
"processor_res": 512,
"threshold_a": 64,
"threshold_b": 64,
"guidance_start": 0.35,
"guidance_end": 0.75,
"pixel_perfect": true,
"control_mode": "Balanced"
}
]
}
}
}
示例代码
Shell
JavaScript
Java
Swift
Go
PHP
Python
HTTP
C
C#
Objective-C
Ruby
OCaml
Dart
R
请求示例请求示例
Shell
JavaScript
Java
Swift
curl --location --request POST 'https://api.zhiqite.com/AIGCImgOpenServ/saas/sd/v2/controlnet' \
--header 'X-Request-req-accessKeyId;' \
--header 'X-Request-req-accessKeySecret;' \
--header 'Content-Type: application/json' \
--data-raw '{
"prompt": "{best quality}, {{masterpiece}}, {highres}, original, extremely detailed,incredibly_absurdres,intricate detail,(detailed face),(face:1.2),1girl , kneeling down, from below , crying, sitting, ghost",
"n_iter": 1,
"steps": 25,
"seed": "1221212",
"restore_faces": false,
"enable_hr": false,
"hr_scale": 2,
"width": 768,
"height": 768,
"negative_prompt": "(nsfw:1.5),(nude:1.3), (child Pornography:1.2),molestation,incest,rape,about to be raped,(sex:1.3),uncensored,EasyNegative,(worst quality, low quality:1.4), (((distorted hands))),((disfigured)), ((bad art)), ((deformed)),((extra limbs)),((b&w)), (((duplicate))), ((morbid)), ((mutilated)),poorly drawn face, out of frame, mutation, mutated, (text), signature, monster,watermark,extra fingers,fewer fingers, Wrong hands,wrong fingers,fingers crossed,styled fingers,fingers missed,missed fingers,cheese fingers, chocolate fingers,fingers on fingers,closed fist, fighting fist,fist ,hands with fist,many fists,only hands with wrong fists,fingers crossed,\r\n,",
"cfg_scale": 11,
"sampler_index": "DPM++ 2M Karras",
"hr_second_pass_steps": 20,
"hr_resize_x": 1024,
"hr_resize_y": 1024,
"denoising_strength": 0.55,
"alwayson_scripts": {
"sd_model_checkpoint": "revAnimated_v122_7371.safetensors",
"id_task": "pro1686666",
"sd_vae": "vae-ft-mse-840000-ema-pruned.vae.pt",
"image_link": "https://paintimage.glutinoust.com/api/2023_08_18/20230818183453157097_2436301704c05f465c363e5758d46cff.png",
"controlnet": {
"args": [
{
"image_link": "https://dbt-aigc.oss-cn-hangzhou.aliyuncs.com/Output-Img2/bbbb/QR_Code4.png",
"enabled": true,
"module": "inpaint_global_harmonious",
"model": "control_v1p_sd15_brightness",
"weight": 0.7,
"resize_mode": "Crop and Resize",
"low_vram": false,
"processor_res": 512,
"threshold_a": 64,
"threshold_b": 64,
"guidance_start": 0.35,
"guidance_end": 0.75,
"pixel_perfect": true,
"control_mode": "Balanced"
}
]
}
}
}'
返回响应
🟢200成功
application/json
Body
code
string
返回状态码
msg
string
返回状态信息
data
object
必需
task_id
string
提交的任务id
示例
{
"code": "200",
"msg": "success",
"data": {
"task_id": "pro1686666"
}
}
修改于 2024-07-23 01:24:13