Skip to content

Kling โ€‹

Updated

Endpoint: POST https://mps.intl.tencentcloudapi.comAction: CreateAigcImageTask

Kling Image is an image generation model that supports text-to-image and reference-image generation, outputting 1โ€“9 images per request. 3.0-Omni / O1 suit scenarios that blend multiple references.

Basic Information โ€‹

ItemValue
ModelNameKling
ModelVersion3.0-Omni / 3.0 / O1 / 2.1
Guardrail disable supportNot supported

Specifications Supported by Version โ€‹

VersionOutput SpecificationsInput and Conditions
CommonAspect ratio: 1:1 / 16:9 / 9:16 / 4:3 / 3:4
Number of output images: VOD OutputImageCount: 1โ€“9
โ€”

Supports text generation and reference image editing.

Request Parameters โ€‹

ParameterRequiredTypeDescription
ModelNameRequiredStringFixed value Kling
ModelVersionOptionalString3.0-Omni / 3.0 / O1 / 2.1
PromptRequiredStringGeneration prompt. Up to 1000 characters
EnhancePromptOptionalBooleanAutomatic prompt correction. Default value false
ImageInfos.NOptionalArrayReference image array. Used for image-to-image and reference generation
ExtraParametersOptionalObjectOutput options such as Resolution / AspectRatio
AdditionalParametersOptionalStringA JSON string containing model-specific options. For the seed delivery format, see Additional Configuration

Request Example โ€‹

json
{
  "ModelName": "Kling",
  "ModelVersion": "3.0",
  "Prompt": "a young woman in traditional hanbok standing by a moonlit lake",
  "EnhancePrompt": true,
  "ExtraParameters": {
    "Resolution": "1080P",
    "AspectRatio": "16:9"
  },
  "Operator": "admin",
  "StoreCosParam": {
    "CosBucketName": "<bucket-appid>",
    "CosBucketRegion": "<bucket-region>",
    "CosBucketPath": "/aigc/"
  }
}

Reference Image Request โ€‹

json
{
  "ModelName": "Kling",
  "ModelVersion": "3.0",
  "Prompt": "Change the background to a quiet garden; preserve the subject.",
  "EnhancePrompt": true,
  "ExtraParameters": {
    "Resolution": "1080P",
    "AspectRatio": "16:9"
  },
  "Operator": "admin",
  "StoreCosParam": {
    "CosBucketName": "<bucket-appid>",
    "CosBucketRegion": "<bucket-region>",
    "CosBucketPath": "/aigc/"
  },
  "ImageInfos": [
    {
      "ImageUrl": "https://<host>/reference.jpg"
    }
  ]
}

Response Example โ€‹

json
{
  "Response": {
    "Status": "DONE",
    "Message": "ok",
    "ImageUrls": [
      "https://aigc-output-image-<id>.cos.<region>.myqcloud.com/<file>.png?q-sign-algorithm=sha1&..."
    ],
    "RequestId": "<request-id>"
  }
}

Built with VitePress ยท Deployed on Tencent EdgeOne Pages