Skip to content

Create Image Generation Task

POST https://www.kkiai.com/ent/v2/reference2image

Official documentation: https://platform.vidu.cn/docs/reference-to-image

Request Parameters

Authorization

Add the Authorization parameter to the Header. Its value should be the Token concatenated after Bearer.

Example: Authorization: Bearer ********************

Header Parameters

Parameter NameTypeRequiredDescriptionExample
AuthorizationstringOptionalBearer {{YOUR_API_KEY}}
Content-TypestringOptionalapplication/json

Body Parameters (application/json)

Parameter NameTypeRequiredDescription
modelstringRequiredModel name Optional values: viduq2, viduq1 viduq2: Supports text-to-image, image editing, reference-to-image viduq1: Supports reference-to-image
imagesarray[string]OptionalImage reference viduq2: Supports input of 0-7 images viduq1: Supports input of 1-7 images The model will use the subject in the images passed in this parameter as a reference to generate videos consistent with the subject in the images. Note 1: Supports Base64 encoded images or image URLs (ensure accessibility) Note 2: Images support png, jpeg, jpg, webp formats Note 3: Image pixels must not be smaller than 128*128, and the aspect ratio must be less than 1:4 or 4:1 Note 4: Size must not exceed 50M Note 5: Please note that the post body of http requests must not exceed 20MB, and the encoding must include an appropriate content type string, for example: data:image/png;base64,{base64_encode}
promptstringRequiredText prompt Text description for video generation, length must not exceed 2000 characters Note 1: The viduq2 model supports text-to-image. When using the viduq2 model and no images are uploaded, the model will use the text content of this parameter to generate images
seedstringOptionalRandom seed parameter When not passed by default or passed as 0, a random number will be used instead When manually set, the set seed will be used
aspect_ratiostringOptionalAspect ratio parameter. Different models support different ratios: viduq1: Default value 16:9, optional values: 16:9, 9:16, 1:1, 3:4, 4:3 viduq2: Default value 16:9, optional values: 16:9, 9:16, 1:1, 3:4, 4:3, 21:9, 2:3, 3:2 auto: Maintains the same aspect ratio as the first input image
resolutionstringOptionalResolution parameter. Different models support different resolutions: viduq1: Default 1080p, optional: 1080p viduq2: Default 1080p, optional: 1080p, 2K, 4K
payloadstringOptionalPass-through parameter No processing is performed, only data transmission Note: Maximum 1048576 characters
callback_urlstringOptionalCallback protocol You need to actively set callback_url when creating a task. The request method is POST. When the video generation task status changes, Vidu will send a callback request containing the latest task status to this address. The callback request content structure is consistent with the return body of the query task API The "status" returned in the callback includes the following states: processing Task is being processed success Task completed (if sending fails, callback three times) failed Task failed (if sending fails, callback three times) Vidu uses a callback signature algorithm for authentication. For details, see: Callback Signature Algorithm

Request Example

json
{
  "model": "viduq1",
  "prompt": "A cute little cat sitting on a windowsill, with sunlight shining on its body, creating a warm and cozy scene."
}

cURL Example

bash
curl --location --request POST 'https://www.kkiai.com/ent/v2/reference2image' \
--header 'Authorization: Bearer <YOUR_API_KEY>' \
--header 'Content-Type: application/json' \
--data-raw '{
  "model": "viduq1",
  "prompt": "A cute little cat sitting on a windowsill, with sunlight shining on its body, creating a warm and cozy scene."
}'

Response

🟢 200 Success

Response Body

Parameter NameTypeRequiredDescription
task_idstringRequired
statestringRequired
modelstringRequired
promptstringRequired
imagesarray[string]Required
seedintegerRequired
aspect_ratiostringRequired
callback_urlstringRequired
payloadstringRequired
cus_priorityintegerRequired
creditsintegerRequired
created_atstringRequired
watermarkbooleanRequired

Response Example

json
{
    "task_id": "911092490931552256",
    "state": "created",
    "model": "viduq2",
    "prompt": "一只可爱的小猫坐在窗台上,阳光洒在它的身上,温馨的画面",
    "images": [],
    "seed": 616519648,
    "aspect_ratio": "auto",
    "callback_url": "",
    "payload": "",
    "cus_priority": 0,
    "credits": 6,
    "created_at": "2026-01-20T07:08:12.262592985Z",
    "watermark": false
}