⌘K

Kirin Image 4.0 Long Image

kirin_v4_long_image

Generate a single long image for a webpage design or an ecommerce product detail page.

API Notes

kirin_v4_long_image returns one complete long image per successful task. Omit n, series_amount, and result_type from settings.

Authentication

authorization string required

All APIs require authentication via Bearer Token.

Get API Key:

Visit API Key Management Page to get your API Key.

Usage:

Add to request header:

Authorization: Bearer YOUR_API_KEY

Parameters

model string required

Value: kirin_v4_long_image

input array required

Send one object containing params to POST https://cloud.vtrix.ai/model/v1/generation. The fields below belong to input[0].params.

contents array required

Include a prompt item with nonempty text. Choose reference images according to settings.skill. Use a unique material id within the task for each reference, then refer to it in the prompt with @id.

Item typeFieldsRequirements
prompttext (string)Required for both skills
style_refer_imageurl (string), id (string)Optional, up to one for webpage. Guides the visual style and layout
subject_refer_imageurl (string), id (string)Optional, up to one for webpage. Guides the design around the pictured subject
refer_imageurl (string), id (string)Provide 1 to 3 product reference images for ecommerce

For reference images, use an accessible URL or Base64-encoded image data in url. Each image must be JPEG or PNG, no larger than 30 MB, at least 300 px on both sides, and have a width-to-height ratio from 2:5 to 5:2.

English-only prompts have a limit of 166,000 characters. Non-English-only prompts have a limit of 71,000 characters. For mixed prompts, divide each character count by its respective limit. The sum must be at most 1.

settings object required

FieldOptionsDefault
skill (string, required)webpage for web design, ecommerce for product detail pagesSupply a value
resolution (string)1k, 2k1k
length (string)For ecommerce only. short has about 2 to 5 sections, medium about 6 to 10, and long about 11 to 18medium for ecommerce

Polling

Since result generation takes time, you need to poll the task status after creating the task.

The initial response only returns information such as the task ID and initial status. The final result must be obtained by polling the task status endpoint using the task ID.

See the examples on the right for polling requests and responses.

Poll GET https://cloud.vtrix.ai/model/v1/generation/task/{task_id} with the platform API key used to submit the request. Replace {task_id} with the id from the creation response.

Status in the query responseWhat to do
in_progressContinue polling
completedRead the image URLs from output[].content[].url
failedRead error for details

Response format

In the creation response, status: "completed" means the submission was accepted. Check the query response for the generation status. All responses shown are examples.

FieldDescription
idPlatform task ID
created_atUnix timestamp in milliseconds
modelRequested model ID
request_idRequest identifier returned on submission
output[].content[].typeimage for generated images
output[].content[].urlGenerated image URL

A query can return generated images while billing is pending. During that time, usage.cost and usage.quantity may be null.