Img Open English
  1. train model
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. train model

Submit training task

POST
/AIGCImgOpenServ/saas/modelTraining/submitTraining/Job
img

Request

Header Params
X-Request-req-accessKeyId
string 
optional
X-Request-req-accessKeySecret
string 
optional
Body Params application/json
taskId
string 
required
Task id, required and unique
fileUrlList
array[string]
required
The training image urllist must be accessible from the public network, and the number of images is 10-100.
maxEpochs
integer 
optional
Number of iteration steps 10-50, default 20
batchSize
integer 
optional
Number of pictures sent in each batch 1-4 Default 1
learningRate
string 
optional
Range 0.0000001 - 0.0001 Default 0.00001; prevent precision loss when str is passed in
maxTokenLength
integer 
optional
Range 0,150,225 Default 225
clipSkip
integer 
optional
1-5 default 1
randomCrop
boolean 
optional
pretrainedModel
string 
optional
Training base model, default v1-5-pruned-emaonly
repeats
integer 
optional
Range 1-30 Default 10
mixedPrecision
string 
optional
"fp16", "bf16"
savePrecision
string 
optional
"fp16", "bf16", "float"
numCpuThreadsPerProcess
integer 
optional
1-20
seed
integer 
optional
cacheLatents
boolean 
optional
cacheLatentsToDisk
boolean 
optional
lrScheduler
string 
optional
lrWarmupSteps
integer 
optional
0-100
optimizerType
string 
optional
"AdamW", "AdamW8bit", "PagedAdamW8bit", "Lion8bit", "PagedLion8bit", "Lion", "SGDNesterov", "SGDNesterov8bit", "DAdaptation", "DAdaptAdaGrad", "DAdaptAdam", "DAdaptAdan", "DAdaptAdanIP", "DAdaptLion", "DAdaptSGD", "AdaFactor"
resolution
integer 
optional
enableBucket
boolean 
optional
minBucketReso
integer 
optional
maxBucketReso
integer 
optional
textEncoderLr
string 
optional
unetLr
string 
optional
networkDropout
number 
optional
0-1
rankDropout
number 
optional
0-1
moduleDropout
number 
optional
0-1
networkModule
string 
optional
networkDim
integer 
optional
networkAlpha
integer 
optional
networkArgs
string 
optional
v2
boolean 
optional
flipAug
boolean 
optional
colorAug
boolean 
optional
gradientAccumulationSteps
integer 
optional
noiseOffset
number 
optional
0-1
Example
{
    "file_url_list": [],
    "max_epochs": 20,
    "batch_size": 2,
    "learning_rate": "0.0001",
    "max_token_length": 225,
    "clip_skip": 2,
    "random_crop": 0,
    "repeats": 10,
    "mixedPrecision": "bf16",
    "savePrecision": "bf16",
    "numCpuThreadsPerProcess": 4,
    "seed": 1234,
    "cacheLatents": true,
    "cacheLatentsToDisk": false,
    "lrScheduler": "constant",
    "lrWarmupSteps": 0,
    "optimizerType": "Lion",
    "resolution": 384,
    "enableBucket": true,
    "minBucketReso": 256,
    "maxBucketReso": 2048,
    "textEncoderLr": "5e-05",
    "unetLr": "0.0001",
    "networkDropout": 0,
    "rankDropout": 0,
    "moduleDropout": 0,
    "networkModule": "networks.lora",
    "networkDim": 128,
    "networkAlpha": 128,
    "networkArgs": "",
    "v2": false,
    "flipAug": false,
    "colorAug": false,
    "noiseOffset": 0.05,
}

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/modelTraining/submitTraining/Job' \
--header 'X-Request-req-accessKeyId;' \
--header 'X-Request-req-accessKeySecret;' \
--header 'Content-Type: application/json' \
--data-raw '{
    "file_url_list": [],
    "max_epochs": 20,
    "batch_size": 2,
    "learning_rate": "0.0001",
    "max_token_length": 225,
    "clip_skip": 2,
    "random_crop": 0,
    "repeats": 10,
    "mixedPrecision": "bf16",
    "savePrecision": "bf16",
    "numCpuThreadsPerProcess": 4,
    "seed": 1234,
    "cacheLatents": true,
    "cacheLatentsToDisk": false,
    "lrScheduler": "constant",
    "lrWarmupSteps": 0,
    "optimizerType": "Lion",
    "resolution": 384,
    "enableBucket": true,
    "minBucketReso": 256,
    "maxBucketReso": 2048,
    "textEncoderLr": "5e-05",
    "unetLr": "0.0001",
    "networkDropout": 0,
    "rankDropout": 0,
    "moduleDropout": 0,
    "networkModule": "networks.lora",
    "networkDim": 128,
    "networkAlpha": 128,
    "networkArgs": "",
    "v2": false,
    "flipAug": false,
    "colorAug": false,
    "noiseOffset": 0.05,
}'

Responses

🟢200OK
application/json
Body
code
string 
required
200 success
msg
string 
required
Example
{
    "code": "string",
    "msg": "string"
}
Modified at 2024-08-08 12:04:01
Previous
queryImageToolTaskInfo
Next
Training result query
Built with