E-Commerce Image
POST https://api.vidu.com/ent/v2/ecommerce-img
Request Header
Field | Value | Description |
---|---|---|
Content-Type | application/json | Data Exchange Format |
Authorization | Token {your api key} | Replace {} with your API key |
Request Body
Field | Type | Required | Description |
---|---|---|---|
image | String | Required | Image 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,
|
count | Int | Required | Number of output images. Default is 4, acceptable range: 1–4 |
background | String | Optional | Background 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 |
prompt | String | Optional | Prompt Generates a specific background based on the provided text prompt Either background or prompt must be provided in each request |
callback_url | String | Optional | Callback 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
Field | Type | Description |
---|---|---|
task_id | String | Task ID |
state | String | It will be returned to a specific processing state: - created created task successfully - queueing task in queue - processing processing - success generation successful - failedtask failed |
image | String | The image used for this call |
count | Int | The images count used for this call |
background | String | The background parameter used in this call |
prompt | String | The text prompt used for this call |
created_at | String | Task creation time |