Virtual Model Alternation Submit API Reference
Virtual Model Alternation Submit
GET/POST
/ai/virtual/model/generation/batch
The Virtual Model Alternation can automatically retain the clothing area in the model image and intelligently match the model type to generate diverse models from different countries, showcasing the best wear effect of the product. This allows for localized content targeting for cross-border markets, accurately capturing user preferences and reducing photograph costs.
This is an asynchronous interface that you need to submit the task first, then obtain the task ID and call the result query interface to get the generated result. The current API is the first step, which is the task submission API.
Request Parameters
Parameter | Type | Required | Description |
---|---|---|---|
| Object[] | Yes | |
| String | No | The model image URL. Both imageUrl and imageBase64 cannot be empty at the same time. If both imageUrl and imageBase64 are present, Base64 is preferred. Input image size larger than 512×512 pixels, but smaller than 3000×3000 pixels. |
| String | No | The Base64 encoding of the model image. Both imageUrl and imageBase64 cannot be empty at the same time. If both imageUrl and imageBase64 are present, Base64 is preferred. Input image size larger than 512×512 pixels, but smaller than 3000×3000 pixels. |
| String | Yes | Specifies the content type of the model in the submitted image, such as real person model, complete mannequin, incomplete mannequin, etc. Currently, only real person model images are supported. Range of values: realPhoto:Submit a real person model phoyo
|
| String | Yes | Specifies the model that needs to be generated. Currently, four different models are supported. Range of values: universal_model_1: universal_model_2: universal_model_3: universal_model_4:
|
| String | No | Specifies the gender of the model to be generated. If not set, the algorithm's automatic recognition result is used by default. Range of values: MALE: male FEMALE: female
|
| String | No | Specifies the age group of the model to be generated. If not set, the algorithm's automatic recognition result is used by default. Range of values: OLD_AGE: Old-aged about 60 years old and above MIDDLE_AGE: middle-aged, about 30-50 years old YOUTH: youth, about 20-30 years old
|
| Boolean | No | Specifies whether to keep the original image's background. If not set, the original background is kept by default. Range of values: true: Keep the background unchanged. No need to fill in the bgStyle parameter. false: Change the background. The bgStyle parameter must be specified.
|
| String | No | Specifies the background style to be generated. When selecting background replacement (maskKeepbg=false), this parameter must be filled in. Currently, four scenes are supported. Range of values: studio: studio photography room: room photography European_street: street photography beach: beach photography
|
| Number | No | Specifies the desired number of images to be generated. A maximum of four images can be generated per task. If not set, 2 images are generated by default. Range of value: 1-4
|
| Number | No | Specifies the desired size of the images to be generated. The generated images will maintain the original aspect ratio, with the shortest side based on the input value. If not set, the default generated size is 768. Range of value: 512-2048
|
Sample Request
Input limitations:
Image formats: JPEG、JPG、PNG、BMP、WEBP
Image size: no more than 4 MB
Image resolution: The size of input image should be more than 512×512 pixels and less than 3000×3000 pixels.
Category: Now the API only supports automatic segmentation and retention for the "clothing" category and does not yet support other specified product categories.
Response Parameters
Parameter | Type | Description |
---|---|---|
| String | A unique request ID used for troubleshooting. |
| Boolean | The status of the returned request, indicating whether the request was successful. |
| Number | The returned result code, where 200 indicates success. For detailed error codes, please refer to the error code list. |
| String | The returned request information. |
| Object | The returned JSON result data. |
| Object | The returned result data. |
| String | A unique task ID. It is used for subsequent result query requests. |
Sample Response
Errors
Error Code | Error Message | Description |
---|---|---|
500 | system error | System error. |
501 | rate limit exceed | The current interface has reached the current limit. Please contact us via navigation bar or email us (aidge_support@service.alibaba.com) to increase the current limit value. |
700 | invalid input | The format of the input parameters does not meet the requirements, and resMessage will return detailed fields that do not meet the requirements. |
801 | model failed | Internal call exception, please contact us via navigation bar or email us (aidge_support@service.alibaba.com) for troubleshooting. |
1000 | content has sensitive data, please try other input | Content has sensitive data and cannot be handled now. Please try other input. |
1001 | content control failed, please retry | Content risk failed, please try other input. If an error persists,please contact us via navigation bar or email us (aidge_support@service.alibaba.com) for troubleshooting. |
1002 | content risk filter failed, please contact us | Content risk failed, please ccontact us via navigation bar or email us (aidge_support@service.alibaba.com). |
Last updated