Skip to content

Kling VFX โ€‹

Updated

Endpoint: POST https://vod.intl.tencentcloudapi.comAction: CreateAigcAudioTask

Kling VFX is a sound effect generation capability: it generates sound effects from a text description, or automatically adds effects that match an input video.

Basic Information โ€‹

ItemValue
ModelNameKling
SceneTypesfx

If you provide only a prompt, it is text-based; if you provide a video, it creates sound effects matching that video.

Request Parameters โ€‹

ParameterRequiredTypeDescription
ModelNameRequiredStringFixed value Kling
SceneTypeRequiredStringsfx
PromptOptionalStringUsed for text-based generation
VideoInfos.NOptionalArrayVideo-based generation input. Type / Url
AdditionalParametersOptionalStringbgm_prompt (background sound direction), asmr_mode, etc.

Request Examples โ€‹

json
{
  "SubAppId": 123456789,
  "ModelName": "Kling",
  "SceneType": "sfx",
  "Prompt": "rain falling on a tin roof, distant thunder"
}
json
{
  "SubAppId": 123456789,
  "ModelName": "Kling",
  "SceneType": "sfx",
  "VideoInfos": [
    {
      "Type": "Url",
      "Url": "https://<cos>/source.mp4"
    }
  ],
  "AdditionalParameters": "{\"bgm_prompt\": \"tense cinematic ambience\"}"
}

Text-based Sound Effects โ€‹

Create sound effects from a prompt alone. The length is specified with OutputConfig.Duration, in the range of [3, 10] seconds.

json
{
  "SubAppId": 123456789,
  "ModelName": "Kling",
  "SceneType": "sfx",
  "Prompt": "fireworks during a holiday celebration, distant crowd cheering",
  "OutputConfig": {
    "StorageMode": "Temporary",
    "Duration": 6
  }
}

Response Example โ€‹

json
{
  "AigcAudioTask": {
    "Status": "FINISH",
    "ErrCode": 0,
    "Output": {
      "AudioInfos": [
        {
          "FileUrl": "http://<host>.vod2.myqcloud.com/.../aigcAudioGenFile.mp3"
        }
      ]
    }
  }
}

Video Input Constraints (video-to-sfx) โ€‹

These are the constraints when you put a video into Kling video-to-sfx.

ItemValue
FormatMP4 / MOV
File size100MB or less
Video length3.0 seconds ~ 20.0 seconds
Length specificationOutputConfig.Duration is ignored and follows the video length

Model-Specific Audio Options โ€‹

ModelFieldDescription
Kling (video-to-sfx)bgm_promptBackground music generation prompt
Kling (video-to-sfx)asmr_modeASMR mode. Emphasizes detailed sound effects

Special Settings โ€‹

Video-based Sound Effects โ€‹

If you provide a video, it creates sound effects matching that video. Pass the video with VideoInfos, and specify the background sound direction and ASMR mode in the top-level AdditionalParameters.

json
{
  "SubAppId": 123456789,
  "ModelName": "Kling",
  "SceneType": "sfx",
  "VideoInfos": [
    {
      "Type": "Url",
      "Url": "https://<cos>/source.mp4"
    }
  ],
  "Prompt": "gentle wind, distant birdsong, occasional footsteps, pages turning, rain tapping on the window",
  "AdditionalParameters": "{\"bgm_prompt\": \" healing piano with soft strings, warm and gentle, suitable for a drama scene\", \"asmr_mode\": true}",
  "OutputConfig": {
    "StorageMode": "Temporary"
  }
}

AdditionalParameters fields:

FieldTypeDescription
bgm_promptStringPrompt describing the background sound direction
asmr_modeBooleanASMR mode. Emphasizes detailed sound to create an immersive result

Input Specifications โ€‹

ItemConstraint
Video formatMP4 / MOV
File size100MB or less
Video length3.0 seconds ~ 20.0 seconds

Duration is ignored for video-based generation

The length of video-based sound effects follows the input video length.

Output Format โ€‹

Use OutputConfig.OutputAudioFormat to specify the output format. If omitted, the model default is used.

json
{
  "OutputConfig": {
    "StorageMode": "Temporary",
    "OutputAudioFormat": "wav"
  }
}

Additional Options โ€‹

VideoInfos is entered in [{ "Type": "Url", "Url": "..." }] format.

Built with VitePress ยท Deployed on Tencent EdgeOne Pages