vidu-image-q2) through TokenHub, which supports reference-to-image, text-to-image, and image editing: generate images by combining 0 to 7 reference images with text prompts, or perform text-to-image using text alone.task_id and the initial status created upon success.task_id until state = success, and obtain the image URL from the result. You can also configure a callback through callback_url, so that the server actively pushes notifications when the task status changes.request_id (at the top level, used for troubleshooting). Query APIs additionally return usage (usage consumption).Model Name | model Parameter Value | Supported Capability | Prompt Limit | Resolution | Aspect Ratio |
Vidu-Image-q2 | vidu-image-q2 | Reference-based image generation / text-to-image / image editing | 2000 characters | 1080p / 2K / 4K | 16:9,9:16,1:1,3:4,4:3,21:9,2:3,3:2,auto |
POST https://tokenhub-intl.tencentcloudmaas.com/v1/wand/vidu-image/generationParameter Name | Required | Type | Description |
model | Yes | string | Model ID. Value: vidu-image-q2 |
prompt | Yes | string | Text prompt, with a maximum length of 2000 characters. If images is not passed, image-to-text generation is performed based on this text. |
images | No | array[string] | Reference images, 0 to 7. Supports image URL or Base64 (with the data:image/png;base64, prefix required). Format png/jpeg/jpg/webp; pixels greater than or equal to 128×128; aspect ratio must be less than 1:4 or greater than 4:1; single image no more than 50 MB; POST body no more than 20 MB. |
aspect_ratio | No | string | Aspect ratio. Options: 16:9 / 9:16 / 1:1 / 3:4 / 4:3 / 21:9 / 2:3 / 3:2 / auto (consistent with the aspect ratio of the first input image). Default value: 16:9. |
resolution | No | string | Resolution. Options: 1080p / 2K / 4K. Default value: 1080p. |
seed | No | integer | Random seed. If not specified or set to 0, a random number is used. |
callback_url | No | string | Callback URL for task status changes (POST). The callback body is consistent with the response body of the query task, and authentication is performed using the callback signature algorithm. |
curl -X POST 'https://tokenhub-intl.tencentcloudmaas.com/v1/wand/vidu-image/generation' \\-H 'Authorization: Bearer YOUR_API_KEY' \\-H 'Content-Type: application/json' \\-d '{"model": "vidu-image-q2","images": ["https://example.com/reference.jpg"],"prompt": "a cat sitting on a windowsill at sunset","aspect_ratio": "16:9","resolution": "2K"}'
curl -X POST 'https://tokenhub-intl.tencentcloudmaas.com/v1/wand/vidu-image/generation' \\-H 'Authorization: Bearer YOUR_API_KEY' \\-H 'Content-Type: application/json' \\-d '{"model": "vidu-image-q2","prompt": "a cat sitting on a windowsill at sunset","aspect_ratio": "16:9","resolution": "1080p"}'
Field | Type | Description |
task_id | string | Task ID generated by Vidu, used for subsequent task queries and callback matching. |
state | string | Processing status: created / queueing / processing / success / failed. |
prompt | string | Prompt parameter of this call. |
created_at | string | Task creation time (ISO 8601). |
request_id | string | Unique request identifier used for troubleshooting. |
{"task_id": "1374200352-WandImage-a457a7b042694f8aad4deeff8c7f7ef3","state": "created","prompt": "a cat sitting on a windowsill at sunset","created_at": "2026-08-20T07:31:07.277Z","request_id": "26eb0d62-1c52-4f3a-9b5e-7e8fb2524d8f"}
ErrMsg/Error Message. For common error codes, see Appendix: Unified Error Codes.task_id is returned, poll this API to obtain the results.GET https://tokenhub-intl.tencentcloudmaas.com/v1/wand/vidu-image/tasks/{task_id}{task_id} in the path is the task_id returned when the task was submitted (represented by YOUR_TASK_ID in the example). Image generation takes approximately several seconds to tens of seconds, so polling every 3 to 5 seconds is recommended.Parameter Name | Required | Type | Description |
task_id | Yes | string | Task ID (path parameter), which is the task_id returned when the task is submitted. |
curl -X GET 'https://tokenhub-intl.tencentcloudmaas.com/v1/wand/vidu-image/tasks/YOUR_TASK_ID' \\-H 'Authorization: Bearer YOUR_API_KEY'
Field | Type | Description |
state | string | Processing status: created / queueing / processing / success / failed. |
model | string | Model name used in this call. |
aspect_ratio | string | Aspect ratio parameter of this call. |
resolution | string | Resolution parameter of this call. |
creations | array[object] | List of generated results (returned on success). |
creations[].url | string | The download URL of the generated image is a temporary address valid for 12 hours. Download and save it promptly. |
request_id | string | Unique request identifier used for troubleshooting. |
tokenhub_usage | object | Usage consumption. |
tokenhub_usage.total_tokens | integer | Number of tokens consumed by this task, used for billing/reconciliation. |
{"state": "success","model": "vidu-image-q2","prompt": "a cat sitting on a windowsill at sunset","creations": [{ "url": "https://aigc-image.cos.myqcloud.com/xxx/result.png" }],"aspect_ratio": "16:9","resolution": "2K","request_id": "3aec3299-06ad-4654-8b45-c57b823a15d2","tokenhub_usage": { "total_tokens": 1024 }}
state | Description | Handling Recommendation |
success | Generation succeeded | Obtain the result image from creations[].url. |
processing / queueing | Processing / queued | Poll once every 3 to 5 seconds until the status changes to success. |
failed | Generation failed | Check the failure cause, make modifications, and retry. If the failure persists, contact technical support and provide the request_id. |
Error Code | Error Message | Description |
BadRequest | bad request | Invalid request |
FieldLacking | field is missing or empty | Missing required field |
FieldUnwanted | unwanted field | Unwanted field was passed. |
FieldInvalid | invalid field | Input parameter failed validation. |
FieldItemCountOutOfRange | field item count out of range | The number of field items exceeds the limit (for example, the number of images exceeds the limit). |
PageSizeOutOfRange | page size out of range | Image size/parameter exceeds the limit. |
ImageFormatInvalid | invalid image format | Image format does not meet the requirements. |
ImageSizeInvalid | image size invalid | Image size is too large or too small. |
ImageDownloadFailure | image download failure | Failed to download the image from the URL. Check the link. |
TaskPromptPolicyViolation | prompt policy violation | Prompt triggers security review and risk control. |
CreationPolicyViolation | creation policy violation | Generated content triggers risk control. |
AuditSubmitIllegal | submit is illegal | Input failed security review. |
CreditInsufficient | insufficient credits | Insufficient credits |
ModelUnavailable | model unavailable | Model unavailable |
Unauthorized | unauthorized | Unauthenticated (check Authorization) |
Forbidden | forbidden | Request has no permission. |
TaskNotFound | task not found | task_id not found. |
QuotaExceeded | quota exceeded | Exceeding the concurrency limit |
TooManyRequests | too many requests | Requests are too frequent. |
InternalServiceFailure | internal service failure | Internal server error |
data:image/png;base64, prefix).images enables reference-to-image (using the subjects in the images as references), while omitting images enables text-to-image (generated solely from the prompt). vidu-image-q2 supports both modes.creations[].url promptly after the task succeeds and save it to your own storage. Do not rely on this link for a long time.aspect_ratio: auto indicates that the output aspect ratio remains consistent with the first input image. This setting is meaningful only in reference-to-image mode.Apakah halaman ini membantu?
Anda juga dapat Menghubungi Penjualan atau Mengirimkan Tiket untuk meminta bantuan.
masukan