Img Open English
  1. AI image generation
Img Open English
  • AI image generation
    • sd text2image
      POST
    • sd Image to Image
      POST
    • sd controlnet
      POST
    • QueryModelList
      POST
    • QueryLoralList
      POST
    • QueryVaeList
      POST
    • queryEmbeddingList
      POST
  • task query
    • queryTaskInfoV1.0
      POST
    • queryTaskInfoV2.0
      POST
    • queryImageToolTaskInfo
      POST
  • train model
    • Submit training task
      POST
    • Training result query
      POST
  • image tool
    • Flux text2image
      POST
    • Single Face Swap V1.0
      POST
    • Single Face Swap V2.0
      POST
    • instantID
      POST
    • Face restoration
      POST
    • Super Resolution
      POST
    • image description
      POST
    • Multiple Face Swap
      POST
    • Face Detection
      POST
    • Prompt expansion
      POST
    • Hairstyle changer
      POST
    • Object Removal
      POST
    • Style recognition
      POST
    • Outpainting
      POST
    • CNT preview
      POST
    • background remove
      POST
    • image enlarge
      POST
    • image watermark
      POST
  1. AI image generation

sd controlnet

POST
/AIGCImgOpenServ/saas/sd/v2/controlnet
img
You can now control Stable Diffusion with ControlNet. The ControlNet models are available in this API.
1.canny
2.depth
3.inpaint
4.lineart
5.MLSD
6.NormalMap
7.OpenPose
8.Reference
9.Scribble
10.Segmentation
11.Shuffle
12.SoftEdge
13.T2I-Adapter
14.Tile
15.Recolor
16.IP-Adapter
17.Instant-ID

Request

Header Params
X-Request-req-accessKeyId
string 
required
X-Request-req-accessKeySecret
string 
required
Body Params application/json
prompt
string 
required
Text description of the painting. Use lora to query the lora list. Refer to sdLoraFileSimplifyName
n_iter
integer 
generated batch
optional
batch_size
integer 
Generate quantity per batch
required
Number of images=n_iter*batch_size
steps
integer 
Number of iteration steps
optional
seed
integer 
optional
restore_faces
boolean 
facial repair
optional
enable_hr
boolean 
HD restoration
optional
hr_scale
integer 
HD repair times
optional
width
integer 
optional
[128,1024] Width of the image to generate, in pixels, in an increment divisible by 8
height
integer 
optional
[128,1024] Height of the image to generate, in pixels, in an increment divisible by 8
negative_prompt
string 
optional
Suggested words: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 
optional
Range [1,30], recommended value is [7,11]
sampler_index
string 
Sampling method
optional
Optional["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 
Next steps for HD restoration
optional
hr_resize_x
integer 
HD restored height
optional
[128,2048] Width of the image toEnlarged size, in an increment divisible by 8
hr_resize_y
integer 
HD restored width
optional
[128,2048] Height of the image toEnlarged size, in an increment divisible by 8
denoising_strength
number 
optional
resize_mode
number 
required
Optional [0, 1, 2, 3], corresponding to ["Just Resize", "Crop and Resize", "Resize and Fill", "Just resize (latent upscale)"] in webui.
alwayson_scripts
object 
External incoming parameters
required
sd_model_checkpoint
string 
model code
required
Model code in the reference model list
override_settings
object 
optional
id_task
string 
required
sd_vae
string 
optional
Use custom vae in generating images
output_image_format
string 
Output picture format
optional
Output image format, no parameters are required by default, output image format is jpg, and can support input png
image_link
string 
The base map of the graph
optional
controlnet
object 
required
Example
{
    "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"
                }
            ]
        }
    }
}

Request samples

Shell
JavaScript
Java
Swift
Go
PHP
Python
HTTP
C
C#
Objective-C
Ruby
OCaml
Dart
R
Request Request Example
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"
                }
            ]
        }
    }
}'

Responses

🟢200OK
application/json
Body
code
string 
Return status code
required
Success=200 Fail=400
msg
string 
Return status information
required
data
object 
required
task_id
string 
Submitted task id
required
Example
{
    "code": "200",
    "msg": "success",
    "data": {
        "task_id": "pro1686666"
    }
}
Modified at 2024-08-08 10:52:55
Previous
sd Image to Image
Next
QueryModelList
Built with