Image Generation
Create Task
Please note that in order to maintain naming consistency, the original model field has been changed to model_name, so in the future, please use this field to specify the version of the model that needs to be called.
At the same time, we keep the behavior forward-compatible. If you continue to use the original model field, it will not have any impact on the interface call, there will not be any exception, which is equivalent to the default behavior when model_name is empty (i.e., call the V1 model).
Request Header
Data Exchange Format
Authentication information, refer to API authentication
Request Body
Model Name
Positive text prompt
Cannot exceed 2500 characters
Negative text prompt
Cannot exceed 2500 characters
Note: In the Image-to-Image scenario (when the "image" field is not empty), negative prompts are not supported.
Reference Image
- Support inputting image Base64 encoding or image URL (ensure accessibility)
Base64 Encoding Note:
Please note, if you use the Base64 method, make sure all image data parameters you pass are in Base64 encoding format. When using Base64, do NOT add any prefix like data:image/png;base64,. Only provide the Base64-encoded string.
Correct:
Incorrect:
- Supported image formats: .jpg / .jpeg / .png
- File size: ≤10MB, dimensions: min 300px, aspect ratio: 1:2.5 ~ 2.5:1
- Required when image_reference parameter is not empty
Image reference type
subject: character feature reference,face: character appearance reference
- When using
face, the uploaded image must contain only one face
Required when using kling-v1-5 and image parameter is not empty
Face reference intensity for user-uploaded images during generation
Value range: [0, 1], The larger the value, the stronger the reference intensity
Only kling-v1, kling-v1-5 support this parameter
Facial reference intensity, refers to the similarity of the facial features of the person in the reference image
Only image_reference parameter is subject is available
Value range: [0, 1], The larger the value, the stronger the reference intensity
Only kling-v1-5 supports this parameter
Reference element list based on element library ID
- Load with key:value format as follows:
The amount of reference element is related to the amount of reference image, the sum of the amount of reference element and the amount of reference image shall not exceed 10.
Element ID
Image generation resolution
1k: 1K standard,2k: 2K high-res
Different model versions support varying ranges. For details, refer to the Capability Map
Number of generated images
Value range: [1, 9]
Aspect ratio of the generated images (width:height)
Different model versions support varying ranges. For details, refer to the Capability Map
Whether to generate watermarked results simultaneously
- Defined by the enabled parameter, format:
- true: generate watermarked result, false: do not generate
- Custom watermarks are not currently supported
The callback notification address for the result of this task. If configured, the server will actively notify when the task status changes.
- For specific message schema, see Callback Protocol
Customized Task ID
- Will not overwrite system-generated task ID, but supports querying task by this ID
- Please note that the customized task ID must be unique within a single user account.
Query Task (Single)
Request Header
Data Exchange Format
Authentication information, refer to API authentication
Path Parameters
The task ID for image generation. Request path parameter, directly fill the value in the request path.
Customized Task ID for audio generation
- The external_task_id filled in when creating the task. You can choose to query by external_task_id or task_id
- When creating a task, you can choose to query by external_task_id or task_id.
Query Task (List)
Request Header
Data Exchange Format
Authentication information, refer to API authentication
Query Parameters
Page number
Value range: [1, 1000]
Number of items per page
Value range: [1, 500]