Vidu API
Dashboard
Docs
Sign in

E-Commerce Image

POST https://api.vidu.com/ent/v2/ecommerce-img

Request Header

FieldValueDescription
Content-Typeapplication/jsonData Exchange Format
AuthorizationToken {your api key}Replace {} with your API key

Request Body

FieldTypeRequiredDescription
imageStringRequiredImage input parameter, used to generate the final product image output. Supported formats and requirements:
- Only one image can be uploaded
- Accepts image URL (must be publicly accessible) or Base64 format
- Supported formats: png, jpeg, jpg, webp
- Image width and height must each be at least 512 pixels
- Aspect ratio must be less than 2
- Image file size must not exceed 10 MB
- The length of the base64 decode must be under 10MB, and it must include an appropriate content type string. For instance,
data:image/png;base64,{base64_encode}
countIntRequiredNumber of output images.
Default is 4, acceptable range: 1–4
backgroundStringOptionalBackground Parameter
- Used to specify a preset background
- Either background or prompt must be provided in each request
For available values, refer to the documentation: Background Enum doc
promptStringOptionalPrompt
Generates a specific background based on the provided text prompt
Either background or prompt must be provided in each request
callback_urlStringOptionalCallback
When creating a task, you need to actively set the callback_url with a POST request. When the video generation task changes its status, Vidu will send a callback request to this URL, containing the latest status of the task. The structure of the callback request content will be the same as the return body of the GET Generation API.
The “status” in the callback response includes the following states:
- processing: Task is being processed.
- success: Task is completed (if sending fails, it will retry the callback three times).
- failed: Task failed (if sending fails, it will retry the callback three times).
curl -X POST -H "Authorization: Token {your_api_key}" -H "Content-Type: application/json" -d '
{
"background": "clear_blue",
"image": "input_your_image_url",
"count": 4
}' https://api.vidu.com/ent/v2/ecommerce-img

Response Body

FieldTypeDescription
task_idStringTask ID
stateStringIt will be returned to a specific processing state:
- created created task successfully
- queueing task in queue
- processing processing
- success generation successful
- failedtask failed
imageStringThe image used for this call
countIntThe images count used for this call
backgroundStringThe background parameter used in this call
promptStringThe text prompt used for this call
created_atStringTask creation time