Personalized text-to-image: Create a model training task.
Try it now
Test
RAM authorization
|
Action |
Access level |
Resource type |
Condition key |
Dependent action |
|
aicontent:Personalizedtxt2imgAddModelTrainJob |
create |
*All Resource
|
None | None |
Request syntax
POST /api/v1/personalizedtxt2img/addModelTrainJob HTTP/1.1
Request parameters
|
Parameter |
Type |
Required |
Description |
Example |
| body |
object |
No |
The request body. |
|
| name |
string |
Yes |
The name of the model training job. |
熊猫图片生成 |
| objectType |
string |
Yes |
A single word that defines the object type in the training images, such as "girl", "person", "man", "boy", or "dog". |
dog |
| imageUrl |
array |
Yes |
A list of one or more image URLs for training. For example: ["url_1", "url_2", ...] |
|
|
string |
No |
A publicly accessible URL for a training image. |
https://img.alicdn.com/imgextra/i2/O1CN011Ps6OK1LdWZQSUZD1_!!6000000001322-0-tps-572-1096.jpg |
|
| trainSteps |
integer |
No |
The number of training steps for the model training job. |
800 |
Response elements
|
Element |
Type |
Description |
Example |
|
object |
The response object. |
{"success":true,"errCode":null,"errMessage":null,"requestId":"8f6b1cd2-5390-478a-9968-2a5678601df5","data":{"id":"2","name":"熊猫图片生成","objectType":"panda","imageUrl":["https://pic1.zhimg.com/v2-6154d925bcebd8b41a30051695e5a134_720w.jpg","https://k.sinaimg.cn/n/tech/crawl/114/w550h364/20211103/24e2-2bc49a39210ce2ac520c876dcaee7bcd.jpg/w700d1q75cms.jpg"],"jobStatus":"NOT_START","inferenceJobList":null,"inferenceImageCount":0,"createTime":"2024-06-28T11:02:32.0598209"}} |
|
| requestId |
string |
The request ID. |
xxxx-xxxx-xxxx-xxxxxxxx |
| success |
boolean |
Indicates whether the request succeeded. |
true |
| errCode |
string |
The error code. |
UNKNOWN_ERROR |
| errMessage |
string |
The error message. |
未知错误 |
| httpStatusCode |
integer |
The HTTP status code. |
200 |
| data |
object |
The response data. |
[] |
| id |
string |
The model training job ID. |
456 |
| modelId |
string |
The model ID. |
modelId-xxxx-xxxx-xxxx |
| name |
string |
The model training job name. |
可爱熊猫模型训练任务 |
| objectType |
string |
The training subject. |
panda |
| imageUrl |
array |
A list of image URLs for model training. |
|
|
string |
An image URL for model training. |
https://img.alicdn.com/imgextra/i2/O1CN011Ps6OK1LdWZQSUZD1_!!6000000001322-0-tps-572-1096.jpg |
|
| jobStatus |
string |
The status of the model training job. |
TRAINING |
| jobTrainProgress |
number |
The progress of the model training job. |
0.5 |
| inferenceJobList |
array<object> |
A list of inference jobs. |
|
|
object |
Details of a single inference job. |
||
| id |
string |
The inference job ID. |
3220 |
| promptId |
string |
The prompt ID. |
promptId-xxxx-xxxx-xxxx |
| modelId |
string |
The model ID. |
modelId-xxxx-xxxx-xxxx |
| jobStatus |
string |
The status of the inference job. |
FINISHED |
| jobTrainProgress |
number |
The progress of the inference job. |
0.5 |
| resultImageUrl |
array |
A list of URLs for the resulting images. |
0000.png |
|
string |
A URL for a resulting image. |
0000.png |
|
| createTime |
string |
The creation time of the inference job. |
2023-12-25T12:00:00 |
| inferenceImageCount |
integer |
The total number of images generated by this model. |
5 |
| createTime |
string |
The creation time of the model training job. |
2023-12-25T12:00:00 |
Examples
Success response
JSON format
{
"requestId": "xxxx-xxxx-xxxx-xxxxxxxx",
"success": true,
"errCode": "UNKNOWN_ERROR",
"errMessage": "未知错误",
"httpStatusCode": 200,
"data": {
"id": "456",
"modelId": "modelId-xxxx-xxxx-xxxx",
"name": "可爱熊猫模型训练任务",
"objectType": "panda",
"imageUrl": [
"https://img.alicdn.com/imgextra/i2/O1CN011Ps6OK1LdWZQSUZD1_!!6000000001322-0-tps-572-1096.jpg\n"
],
"jobStatus": "TRAINING",
"jobTrainProgress": 0.5,
"inferenceJobList": [
{
"id": "3220",
"promptId": "promptId-xxxx-xxxx-xxxx",
"modelId": "modelId-xxxx-xxxx-xxxx",
"jobStatus": "FINISHED",
"jobTrainProgress": 0.5,
"resultImageUrl": [
"0000.png"
],
"createTime": "2023-12-25T12:00:00"
}
],
"inferenceImageCount": 5,
"createTime": "2023-12-25T12:00:00"
}
}
Error codes
See Error Codes for a complete list.
Release notes
See Release Notes for a complete list.