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 text2image

POST
/AIGCImgOpenServ/saas/sd/v2/text2image
text to image.create image from text based on trained or on public models

Request

Header Params

Body Params application/json

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": 27,
    "sampler_index":"DPM++ 2M Karras",
    "hr_second_pass_steps":20,
    "hr_resize_x":1024,
    "hr_resize_y":1024,
    "denoising_strength": 0.55,
    "callbackUrl":"http://127.0.0.1:8087/image/api/callback/sdweb",
    "alwayson_scripts": {
        "sd_model_checkpoint": "revAnimated_v122_7371.safetensors",
        "id_task": "pro1686666",
        "sd_vae": "vae-ft-mse-840000-ema-pruned.ckpt",
        "override_settings": {
            "CLIP_stop_at_last_layers": 2
        },
        "ADetailer": {
            "args": [
                {
                    "ad_model": "None",
                    "ad_prompt": "",
                    "ad_negative_prompt": "",
                    "ad_confidence": 0.3,
                    "ad_mask_min_ratio": 0.0,
                    "ad_mask_max_ratio": 1.0,
                    "ad_dilate_erode": 32,
                    "ad_x_offset": 0,
                    "ad_y_offset": 0,
                    "ad_mask_merge_invert": "None",
                    "ad_mask_blur": 4,
                    "ad_denoising_strength": 0.4,
                    "ad_inpaint_only_masked": true,
                    "ad_inpaint_only_masked_padding": 0,
                    "ad_use_inpaint_width_height": false,
                    "ad_inpaint_width": 512,
                    "ad_inpaint_height": 512,
                    "ad_use_steps": true,
                    "ad_steps": 28,
                    "ad_use_cfg_scale": false,
                    "ad_cfg_scale": 7.0,
                    "ad_use_sampler": false,
                    "ad_sampler": "DPM++ 2M Karras",
                    "ad_use_noise_multiplier": false,
                    "ad_noise_multiplier": 1.0,
                    "ad_restore_face": false,
                    "ad_controlnet_model": "None",
                    "ad_controlnet_module": "None",
                    "ad_controlnet_weight": 1.0,
                    "ad_controlnet_guidance_start": 0.0,
                    "ad_controlnet_guidance_end": 1.0
                }
            ]
        }
    }
}

Request Code 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/text2image' \
--header 'X-Request-req-accessKeyId: accessKeyId' \
--header 'X-Request-req-accessKeySecret: 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": 27,
    "sampler_index":"DPM++ 2M Karras",
    "hr_second_pass_steps":20,
    "hr_resize_x":1024,
    "hr_resize_y":1024,
    "denoising_strength": 0.55,
    "callbackUrl":"http://127.0.0.1:8087/image/api/callback/sdweb",
    "alwayson_scripts": {
        "sd_model_checkpoint": "revAnimated_v122_7371.safetensors",
        "id_task": "pro1686666",
        "sd_vae": "vae-ft-mse-840000-ema-pruned.ckpt",
        "override_settings": {
            "CLIP_stop_at_last_layers": 2
        },
        "ADetailer": {
            "args": [
                {
                    "ad_model": "None",
                    "ad_prompt": "",
                    "ad_negative_prompt": "",
                    "ad_confidence": 0.3,
                    "ad_mask_min_ratio": 0.0,
                    "ad_mask_max_ratio": 1.0,
                    "ad_dilate_erode": 32,
                    "ad_x_offset": 0,
                    "ad_y_offset": 0,
                    "ad_mask_merge_invert": "None",
                    "ad_mask_blur": 4,
                    "ad_denoising_strength": 0.4,
                    "ad_inpaint_only_masked": true,
                    "ad_inpaint_only_masked_padding": 0,
                    "ad_use_inpaint_width_height": false,
                    "ad_inpaint_width": 512,
                    "ad_inpaint_height": 512,
                    "ad_use_steps": true,
                    "ad_steps": 28,
                    "ad_use_cfg_scale": false,
                    "ad_cfg_scale": 7.0,
                    "ad_use_sampler": false,
                    "ad_sampler": "DPM++ 2M Karras",
                    "ad_use_noise_multiplier": false,
                    "ad_noise_multiplier": 1.0,
                    "ad_restore_face": false,
                    "ad_controlnet_model": "None",
                    "ad_controlnet_module": "None",
                    "ad_controlnet_weight": 1.0,
                    "ad_controlnet_guidance_start": 0.0,
                    "ad_controlnet_guidance_end": 1.0
                }
            ]
        }
    }
}'

Responses

🟢200OK
application/json
Body

Example
{
    "code": "200",
    "msg": "success",
    "data": {
        "task_id": "pro1686666"
    }
}
Modified at 2024-08-08 10:19:42
Next
sd Image to Image
Built with