This topic describes the input and output parameters of the Wanx-Virtual Model. This model intelligently generates images from uploaded product display photos of real people or mannequins, replacing both the model and background with desired content. It uses virtual models to showcase products more elegantly and diversely while preserving the original pose. The model supports a wide range of products that interact with models, such as small handheld items, clothing, footwear, and accessories.
Model Overview
Wanx-Virtual Model intelligently generates images from uploaded product display photos of real people or mannequins, replacing both the model and background with desired content. It uses virtual models to showcase products more elegantly and diversely while preserving the original pose. The model supports a wide range of products that interact with models, such as small handheld items, clothing, footwear, and accessories.
Model Version | Model Name | Model Description |
Virtual Model (V1) | wanx-virtualmodel |
|
Virtual Model V2 (V2) | virtualmodel-v2 |
|
| Model Name | Billing Price | Rate Limit (shared by Alibaba Cloud account and RAM user) | Free Quota(View) | |
|---|---|---|---|---|
| Task Submission API RPS Limit | Number of Simultaneously Processing Tasks | |||
| wanx-virtualmodel | Currently for free trial only.After the free quota is used, you cannot invoke them. For alternative solutions, see Image Editing - Qianwen or Image Editing - Wanx 2.1. | 2 | 1 | 500 images |
| virtualmodel-v2 | ||||
Prerequisites
Obtain an API key and export the API key as an environment variable.
HTTP Calls
To reduce waiting time and prevent request timeouts, the service uses asynchronous invocation. Make two requests:
- Create a task: First, send a request to create a text-to-image task. This request returns a task ID.
- Query results by task ID: Use the task ID obtained in the previous step to query the model generation results.
Step 1: Create a task to obtain a task ID
POST https://{WorkspaceId}.cn-beijing.maas.aliyuncs.com/api/v1/services/aigc/virtualmodel/generation
Replace {WorkspaceId} with your actual workspace ID.
Note: Unless otherwise specified, the following parameters are supported in Virtual Model V1 and V2.
Request HeadersAuthorizationstringRequiredUse an Alibaba Cloud Model Studio API key or a DashScope API key. Example: Bearer d1xxx2a.X-DashScope-AsyncstringRequiredWhether to use asynchronous invocation. HTTP supports only asynchronous invocation. Set it toenable.Content-TypestringRequiredThe request content type. It is fixed as application/json.Request BodymodelstringRequiredThe model to invoke.inputobjectRequiredBasic information about the input image, such as its URL.
Properties base_image_url stringRequiredThe URL of the original product display image featuring a real person.The URL must be publicly accessible and use HTTP or HTTPS.You can also obtain a temporary public URL.Image requirements:
Real Person Image Example ![]()
Mask Image Example ![]()
Enumeration Examples
![]()
![]()
![]()
![]()
![]()
![]()
Seed represents the random seed value. -1 means the system randomly generates a value. Values from 0 to 10000000 let you specify the random seed value. Using the same seed produces identical results.aspect_ratio String OptionalThe aspect ratio of the generated image. Used only in V2.
Enumeration Values Available aspect ratios:
Properties n Integer OptionalThe number of images to generate. Valid values: 1 to 4. Default value: 1.short_side_size stringRequiredThe short side size of the generated image, in pixels. The generated image maintains the same aspect ratio as the input image.V1 valid values: 512 and 1024.V2 valid values: 1024 and 2048. |
ResponseoutputobjectThe task output information.
Properties task_id stringThe task ID.task_status stringThe task status.
|
Step 2: Query results by task ID
GET https://{WorkspaceId}.cn-beijing.maas.aliyuncs.com/api/v1/tasks/{task_id}
Replace {WorkspaceId} with your actual workspace ID.
Request HeadersAuthorizationstringRequiredUse an Alibaba Cloud Model Studio API key or a DashScope API key. Example: Bearer d1xxx2a.URL Path Parameterstask_idstringRequiredThe task ID. |
|
ResponseoutputobjectThe task output information.
Properties task_id stringThe task ID.task_status stringThe task status.
Properties url stringThe URL of the image generated by the model.
Properties TOTAL integerThe total number of tasks.SUCCEEDED integerThe number of successful tasks.FAILED integerThe number of failed tasks.
Properties image_count integerThe number of images generated by the model. |
Task data (task status and image URLs) is retained for only 24 hours and then automatically purged. Save generated images promptly. |
Error codes
If the model call fails and returns an error message, see Error codes for resolution.
This API also returns specific status codes, as follows.
HTTP status code | API error code (code) | API error message (message) | Description |
|---|---|---|---|
400 | InvalidFile.Content | The input image has no human body or has unclear human body. Please upload other image | The input image contains no human body. |
400 | InvalidParameter | The request is missing required parameters or in a wrong format, please check the parameters that you send. | The input parameter format is incorrect. |
400 | InvalidURL | The request URL is invalid, please check the request URL is available and the request image format is one of the following types: JPEG, JPG, PNG, BMP, and WEBP. | The input image failed to download. Check your network or input format. |
400 | InvalidFile.Resolution | The image resolution is invalid, please make sure that the aspect ratio is smaller than 2.0, and largest length of image is smaller than 4096 | The uploaded image size does not meet the requirements. |
500 | InternalError.Algo | An internal error occurs during computation, please try this model later. | Algorithm running error. |







