Img Open
  1. 绘图信息
Img Open
  • CV任务状态码信息附录
  • 绘图信息
    • sd 文生图-v2
      POST
    • sd 文生图-v3
      POST
    • sd 图生图-v2
      POST
    • sd 图生图-v3
      POST
    • sd 局部重绘-v1
      POST
    • sd controlnet 生图
      POST
    • 查询模型列表
      POST
    • 查询lora列表
      POST
    • 查询vae列表
      POST
    • 查询Embedding列表
      POST
  • 绘图任务
    • 查询归档任务详情
      POST
    • 查询任务实时状态 (百分比/进度条/中间图)
      POST
    • 绘图工具任务查询
      POST
  • 模型训练
    • 提交训练任务
      POST
    • 训练结果回调
      POST
  • 绘图工具
    • Flux文生图
      POST
    • 个性化写真
      POST
    • 高级换脸
      POST
    • 超级换脸 faceFusion
      POST
    • 面部检测(脸部提取) faceDetection
      POST
    • 换发型
      POST
    • 提示词扩写
      POST
    • sd prompts优化
      POST
    • 提示词扩写优化
      POST
    • 图转文
      POST
    • 超分辨
      POST
    • 换脸 roop
      POST
    • 面部修复
      POST
    • 智能擦除
      POST
    • 风格识别
      POST
    • 图片外扩
      POST
    • CNT预览
      POST
    • 背景去除
      POST
    • 图片扩大
      POST
    • 给图片加水印
      POST
    • 图片去水印
      POST
    • 图生视频
      POST
  • 图片检测
    • 异步图片检测
  • 视频工具
    • 视频加水印
    • 移除视频背景
    • 视频比例调整
    • 扩大视频图像
    • 视频补帧
    • 视频格式转换
  • 音频工具
    • 人声分离
    • 文生音乐
    • 文字配音
    • 生成歌词
  • 翻译
    • 翻译
  1. 绘图信息

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 
正向描述词
必需
绘画的文本描述(支持中文和英文描述),使用lora,可以查询lora列表,参考sdLoraFileSimplifyName
n_iter
integer 
生成的批次
可选
batch_size
integer 
每批次生成数量
必需
最终生图数量=n_iter*batch_size
steps
integer 
迭代步数
可选
seed
integer 
随机种子
可选
默认就是随机
restore_faces
boolean 
脸部修复
可选
enable_hr
boolean 
高清修复
可选
hr_scale
integer 
高清修复倍数
可选
width
integer 
图片宽度
可选
[128,1024] 且为8的倍数
height
integer 
图片高度
可选
[128,1024] 且为8的倍数
negative_prompt
string 
负向描述词
可选
建议词:nsfw, lowres, bad anatomy, bad hands, text, error, missing fingers, extra digit, fewer digits, cropped, worst quality, low quality, normal quality, artifacts, signature, watermark, username, blurry, missing arms, long neck, humpbacked, bad feet
cfg_scale
number 
提示词引导系数
可选
范围[1,30] ,建议值为 [7,11]
sampler_index
string 
采样方式
可选
可选["Euler a","Euler","LMS","Heun","DPM2","DPM2 a","DPM++ 2S a","DPM++ 2M","DPM++ SDE","DPM fast","DPM adaptive","LMS Karras","DPM2 Karras","DPM2 a Karras","DPM++ 2S a Karras","DPM++ SDE Karras","DPM++ 2M Karras",]
hr_second_pass_steps
integer 
高清修复的后面步骤
可选
hr_resize_x
integer 
高清修复后的高度
可选
[128,2048] 且为8的倍数
hr_resize_y
integer 
高清修复后的宽度
可选
[128,2048] 且为8的倍数
denoising_strength
number 
重绘幅度
可选
resize_mode
number 
resize模式
必需
可选[0, 1, 2, 3],分别对应webui中["Just Resize", "Crop and Resize", "Resize and Fill", "Just resize (latent upscale)"]
alwayson_scripts
object 
外部传入参数
必需
sd_model_checkpoint
string 
模型编码,需要带着
必需
参考模型列表中的模型编码
override_settings
object 
可选
id_task
string 
任务ID
必需
sd_vae
string 
变分自动编码器
可选
提升出图效果
output_image_format
string 
输出图片格式
可选
输出图片格式,默认无需传参,输出图片格式jpg,可支持输入png
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 
返回状态码
必需
成功=200 失败=400
msg
string 
返回状态信息
必需
data
object 
必需
task_id
string 
提交的任务id
必需
示例
{
  "code": "200",
  "msg": "success",
  "data": {
    "task_id": "pro1686666"
  }
}
修改于 2024-07-23 01:24:13
上一页
sd 局部重绘-v1
下一页
查询模型列表
Built with