This topic describes the input and output parameters of the footwear model. The footwear model takes a series of multi-angle images of footwear as input, applies an AI try-on to the shoe area of a model template image, and reconstructs the footwear layout on the model to generate a final image with a natural layout, rich details, high fidelity, and realistic try-on results. This model is suitable for scenarios such as creating product images with models, generating AI try-ons for new footwear, and adjusting the footwear layout on a model.
Model overview
| Model name | Free quota(View) | Billing unit price | Rate limiting (for Alibaba Cloud accounts and RAM users) | |
| QPS limit for task submission API | Number of concurrent tasks | |||
| shoemodel-v1 | 500 images | For free trial only.You cannot make calls after the free quota is used up. Please stay tuned for future updates. | 2 | 1 |
Prerequisites
Obtain an API key and export the API key as an environment variable.
HTTP invocation
To reduce wait times and prevent request timeouts, this service is provided asynchronously. You must make two requests:
- Create a task: Send a request to create a footwear model task. The response returns a task ID.
- Query the result by task ID: Use the task ID from the previous step to retrieve the model's generation result.
Step 1: Create a task and get the task ID
POST https://{WorkspaceId}.cn-beijing.maas.aliyuncs.com/api/v1/services/aigc/virtualmodel/generation
Replace {WorkspaceId} with your actual workspace ID.
HeadersAuthorizationstringRequiredUse an Alibaba Cloud Model Studio API key. You can also use a DashScope API key. Example: Bearer d1xxx2a.X-DashScope-AsyncstringRequiredSpecifies whether to use DashScope asynchronous invocation. Because HTTP supports only asynchronous invocation, you must set this parameter toenable.Content-TypestringRequiredThe content type of the request. This must be application/json.Request bodymodelstringRequiredThe model to call. Set this parameter toshoemodel-v1 for the footwear model.parameters IntegerRequiredThe number of images to generate. The value must be an integer from 1 to 4. The default value is 1.inputobjectRequiredBasic information about the input images, such as their URLs.
Properties template_image_url stringRequiredThe URL of the model template image.The URL must be publicly accessible and use HTTP or HTTPS.You can also obtain a temporary public URL.Image requirements:
|
|
ResponseoutputobjectInformation about the task output.
Properties task_id stringThe task ID.task_status stringThe task status.
|
Step 2: Query the result by task ID
GET https://{WorkspaceId}.cn-beijing.maas.aliyuncs.com/api/v1/tasks/{task_id}
Replace {WorkspaceId} with your actual workspace ID.
HeadersAuthorizationstringRequiredUse an Alibaba Cloud Model Studio API key. You can also use a DashScope API key. Example: Bearer d1xxx2a.URL path parameterstask_idstringRequiredThe task ID. |
|
ResponseoutputobjectTask output information.
Properties task_id stringThe task ID.task_status stringThe task status.
Properties TOTAL integerThe total number of tasks.SUCCEEDED integerThe number of successful tasks.FAILED integerThe number of failed tasks. url field, which is the URL of the generated image.codestringThe error code for a failed task.messagestringThe detailed information for a failed task. |
Error codes
If the model call fails and returns an error message, see Error codes for resolution.
The following table describes the specific status codes for this API.
HTTP status code | API error code (code) | API error message (message) | Description |
|---|---|---|---|
400 | InvalidParameter | Required parameter(s) missing or invalid, please check the request parameters. | The API call parameters are invalid. |
400 | InvalidFile.Content | The input image does not contain a human body or the human body is unclear. Upload a different image. | The input image contains an incomplete human body or no human body. |
400 | InvalidParameter | The request is missing required parameters or is in the wrong format. Check the parameters that you sent. | The format of the request parameters is incorrect. |
400 | InvalidParameter.DataInspection | Unable to download the media resource during the data inspection process. | Failed to download the media resource during data inspection. Check if the input URL is accessible and the image format is correct. |
400 | InvalidFile.Resolution | The image resolution is invalid. Make sure that the aspect ratio is less than 3:2 and the longest side of the image is less than 4096 pixels. | The uploaded image size does not meet the requirements. |
500 | InternalError.Algo | An internal error occurred during computation. Try this model again later. | An algorithm execution error occurred. |