Kling AI icon

Kling AI

Consume Kling AI API

Actions12

Overview

The Kling AI node's Video - Lip Sync operation enables users to generate lip-synced videos by synchronizing video content with either text-to-speech or audio input. This is particularly useful for creating engaging video content where the subject’s lip movements match spoken words or sounds, such as in animated characters, virtual avatars, or dubbing applications.

Common scenarios include:

  • Creating videos where a character or person appears to speak provided text using synthesized voices.
  • Synchronizing existing videos with custom audio tracks for dubbing or voice-over purposes.
  • Automating lip sync generation for marketing, entertainment, or educational content.

For example, you can provide a video ID or URL and supply text along with a selected voice to generate a new video where the lips move in sync with the spoken text. Alternatively, you can provide an audio file or URL to sync the lips of the video with the given audio.

Properties

Name Meaning
API Token JWT token for authenticating with the Kling AI API. Must be generated with specific header and payload (including access key and expiration). Do not include "Bearer" prefix.
Input Type The type of input for lip sync: Text to Video (generate speech from text) or Audio to Video (use provided audio).
Video Source Source of the video to lip sync: Video ID (an existing Kling AI generated video ID) or Video URL (a direct URL to an uploaded video).
Video ID The ID of the video generated by Kling AI (required if Video Source is Video ID).
Video URL The URL of the uploaded video (required if Video Source is Video URL).
Text Content Text to be converted into speech for lip syncing (required if Input Type is Text to Video).
Voice Language Language of the synthesized voice: Chinese or English (required if Input Type is Text to Video).
Voice ID Selection of voice persona for speech synthesis. Different options are available depending on the chosen voice language. For Chinese and English, multiple voice styles and characters are offered.
Voice Speed Speed multiplier for the synthesized speech, ranging from 0.8 to 2.0 (default 1).
Audio Source How to provide audio when Input Type is Audio to Video: File (Base64-encoded audio) or URL (link to audio file).
Audio File Base64-encoded audio file content (required if Audio Source is File).
Audio URL URL of the audio file (required if Audio Source is URL).
Callback URL Optional URL to receive a callback notification when the lip sync process completes.

Output

The node outputs JSON data representing the response from the Kling AI API after submitting the lip sync request. This typically includes details about the created lip sync task, such as task IDs, status, and URLs to the generated video.

If the operation is asynchronous (using a callback URL), the output may initially contain task metadata, with the final video accessible via the callback or subsequent retrieval operations.

No binary data output is directly handled by this node; all media references are provided as URLs or IDs within the JSON response.

Dependencies

  • Requires a valid JWT API token for authentication with the Kling AI API.
  • Network access to https://api.klingai.com for API requests.
  • Properly formatted input parameters according to the API specification.
  • Optional: A callback URL endpoint to receive asynchronous notifications.

Troubleshooting

  • Authentication errors (401): Usually caused by invalid or improperly formatted JWT tokens. Ensure the token is generated correctly without the "Bearer" prefix and contains valid claims (iss, exp, nbf).
  • Missing required parameters: Errors may occur if mandatory fields like video ID/URL, text content, or audio source are missing based on the selected input type.
  • Invalid voice selection: Selecting a voice ID that does not correspond to the chosen voice language will cause errors.
  • API rate limits or network issues: May result in request failures; check network connectivity and API usage quotas.
  • Callback URL failures: If specified, ensure the callback URL is reachable and properly handles incoming requests.

To resolve errors, verify all inputs, especially authentication tokens and required fields, and consult the API documentation for correct parameter formats.

Links and References

  • Kling AI Official API Documentation (hypothetical link, replace with actual if available)
  • JWT Token Generation Guidelines: Use standard JWT libraries to create tokens with appropriate headers and payloads.
  • n8n HTTP Request Node Documentation for understanding API call mechanics.

This summary is based solely on static analysis of the provided source code and property definitions.

Discussion