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 Image to Image

POST
/AIGCImgOpenServ/saas/sd/v2/image2image
img
Generate images based on input images and prompt and other parameters

Request

Header Params
X-Request-req-accessKeyId
string 
required
Example:
accessKeyId
X-Request-req-accessKeySecret
string 
required
Example:
accessKeySecret
Body Params application/json
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
hr_scale
integer 
HD repair times
optional
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
denoising_strength
number 
Noise reduction strength
optional
Noise reduction strength, the value range is 0-1, and the default setting is 0.75. The larger the value, the greater the change in the image. 0 means that the image is almost unchanged, and 1 means that it may deviate seriously from the original image. Generally, this parameter is set in the range of 0.6~0.8;
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
hr_upscaler
string 
optional
Amplifier to use in HD restoration mode
alwayson_scripts
object 
External incoming parameters
required
override_settings
object 
External incoming parameters
optional
sd_model_checkpoint
string 
required
Reference model encoding in model list
sd_vae
string 
optional
Improve image rendering effect
output_image_format
string 
Output picture format
optional
Output image format. By default, no parameter is required. The output image format is jpg. It supports input of png.
id_task
string 
required
ADetailer
object 
optional
image_link
string 
URL link to the image uploaded by the user
required
mask_link
string 
User uploads the smeared url link
optional
Only supports the artifact smear function.
prompt
string 
required
Text description of the painting. Use lora to query the lora list. Refer to sdLoraFileSimplifyName
enable_hr
boolean 
HD restoration
optional
default:false
seed
string 
optional
default:-1 random
restore_faces
boolean 
facial repair
optional
cfg_scale
integer 
optional
How strongly the video sticks to the original image. Use lower values to allow the model more freedom to make changes and higher values to correct motion distortions.Default is false
sampler_index
string 
Sampling method
optional
list["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 
optional
[128,2048] Width of the image toEnlarged size, in an increment divisible by 8
hr_resize_y
integer 
optional
[128,2048] Height of the image toEnlarged size, in an increment divisible by 8
resize_mode
integer 
optional
Optional [0, 1, 2, 3], corresponding to webui["Just Resize", "Crop and Resize", "Resize and Fill", "Just resize (latent upscale)"]
mask_blur
integer 
optional
The value range is [0, 64], with a precision of 1; it corresponds to Mask blur in webui. When mask_blur exists, the passed mask_blur_x and mask_blur_y are invalid, mask_blur_x=mask_blur_y=mask_blur
mask_blur_x
integer 
optional
The numerical range is [0, 64], and the accuracy is 1; when it is greater than 0, kernel_size is constructed and Gaussian blur operation is performed horizontally.
mask_blur_y
integer 
Vertical mask blur coefficient
optional
The numerical interval is [0, 64], and the accuracy is 1; when it is greater than 0, kernel_size is constructed and Gaussian blur operation is performed vertically.
inpainting_fill
integer 
Mask covered content
optional
Optional [0, 1, 2, 3], corresponding to the optional settings of Masked content in webui ['fill', 'original', 'latent noise', 'latent nothing']
inpaint_full_res
boolean 
redraw area
optional
Corresponds to the Inpaint area in webui, true corresponds to Only masked, false corresponds to Whole picture
inpaint_full_res_padding
integer 
Edge reserved pixels
optional
Value range [0, 256], precision is 4; how many pixels on the edge of the redrawn content overlap with the original image, which can act as a buffer to make the transition more natural. It is only valid when inpaint_full_res is true
inpainting_mask_invert
integer 
Mask mode
optional
Corresponding to the Mask mode in webui, 0 means Inpaint masked, 1 means Inpaint not masked; when the value is not 0, the pixel value of the mask image will be inverted.
initial_noise_multiplier
number 
noise multiplier
optional
The value range is [0.5, 1.5], and the precision is 0.01; when the value is 1.0, it is equivalent to not setting it. The vector value sampled at each step of the graph generation will be multiplied by this value. This value greatly affects the quality of the generated image. It is recommended not to pass it. enter
image_cfg_scale
number 
optional
Numeric interval [0, 3.0], precision is 0.05
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,
    "alwayson_scripts": {
        "sd_model_checkpoint": "revAnimated_v122_7371.safetensors",
        "image_link": "https://paintcdn.glutinoust.com/uploads/20230610/62491f852782a40aebd13f8838f79c69.png",
        "id_task": "pro1686666",
        "sd_vae": "vae-ft-mse-840000-ema-pruned.ckpt",
        "override_settings": {
            "CLIP_stop_at_last_layers": 2
        }
    
    }
}

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/image2image' \
--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,
    "alwayson_scripts": {
        "sd_model_checkpoint": "revAnimated_v122_7371.safetensors",
        "image_link": "https://paintcdn.glutinoust.com/uploads/20230610/62491f852782a40aebd13f8838f79c69.png",
        "id_task": "pro1686666",
        "sd_vae": "vae-ft-mse-840000-ema-pruned.ckpt",
        "override_settings": {
            "CLIP_stop_at_last_layers": 2
        }
    
    }
}'

Responses

🟢200OK
application/json
Body
code
string 
required
Success=200 Failure=400
msg
string 
required
data
object 
required
task_id
string 
id_task
required
Example
{
    "code": "200",
    "msg": "success",
    "data": {
        "task_id": "pro1686666"
    }
}
Modified at 2024-08-09 01:54:16
Previous
sd text2image
Next
sd controlnet
Built with