ComfyUI Extension: Comfyui-Kling-Wrapper
Run ComfyUI workflows without the setup
No installs, no CUDA version roulette, no GPU sitting idle on your bill. Bring a workflow and run it in the browser.
ComfyUI custom nodes for Kling AI image generation, text-to-video, image-to-video, advanced custom elements, motion control, lip sync, text/video to audio, effects, virtual try-on, and image expansion.
Looking for a different extension?
Custom Nodes (26)
- Comfyui-Kling-Wrapper Advanced Element Create
- Comfyui-Kling-Wrapper Advanced Element Delete
- Comfyui-Kling-Wrapper Advanced Element Query
- Comfyui-Kling-Wrapper Avatar
- Comfyui-Kling-Wrapper Custom Voice Create
- Comfyui-Kling-Wrapper Custom Voice List Builder
- Comfyui-Kling-Wrapper Custom Voice Query
- Comfyui-Kling-Wrapper Effects
- Comfyui-Kling-Wrapper Element List Builder
- Comfyui-Kling-Wrapper Image2Video
- Comfyui-Kling-Wrapper Image Expander
- Comfyui-Kling-Wrapper Image Generator
- Comfyui-Kling-Wrapper Lip Sync
- Comfyui-Kling-Wrapper Lip Sync Audio Input
- Comfyui-Kling-Wrapper Lip Sync Text Input
- Comfyui-Kling-Wrapper Motion Control
- Comfyui-Kling-Wrapper Multi Images To Video
- Comfyui-Kling-Wrapper Multi Modal Video Edit
- Load Audio
- Comfyui-Kling-Wrapper Preview Video
- Comfyui-Kling-Wrapper Text2Video
- Comfyui-Kling-Wrapper TextToAudio
- Comfyui-Kling-Wrapper TTS
- Comfyui-Kling-Wrapper Video2Audio
- Comfyui-Kling-Wrapper Video Extender
- Comfyui-Kling-Wrapper Virtual Try On
README
Comfyui-Kling-Wrapper
Comfyui-Kling-Wrapper is a ComfyUI custom node pack for calling the Kling AI API directly inside ComfyUI.
It bundles image generation, text-to-video, image-to-video, multi-image video, advanced custom elements, motion control, advanced lip sync, Avatar image-to-video, text/video to audio, TTS, custom voice creation, effects, virtual try-on, image expansion, and local preview helpers under the Comfyui-Kling-Wrapper category.
Highlights
- Direct Kling API access from ComfyUI workflows
- New-system features such as
element_list, advanced custom elements, reference video, and motion control - Built-in
voice_presetdropdown for models that support native audio generation - Custom voice creation plus returned trial audio preview flow
- Importable example workflows in examples/README.md
Current model visibility
The plugin keeps the visible model dropdowns aligned with models confirmed for the active integration paths.
Visible image generation models:
kling-v1kling-v1-5kling-v2kling-v2-newkling-v2-1kling-v3
Visible text-to-video models:
kling-v1kling-v1-6kling-v2-masterkling-v2-1-masterkling-v2-5-turbokling-v2-6kling-v3kling-v3-omni
Visible image-to-video models:
kling-v1kling-v1-5kling-v1-6kling-v2-masterkling-v2-1kling-v2-1-masterkling-v2-5-turbokling-v2-6kling-v3kling-v3-omni
Visible multi-image video models:
kling-v2-1kling-v2-5-turbokling-v3kling-v3-omni
Visible video generation modes:
stdpro4k(kling-v3andkling-v3-omnitext-to-video, image-to-video, and multi-image video; the API usesmode: "4k")
Documented newer models such as kling-image-o1 and kling-video-o1 still exist in the internal capability map, but are hidden from the UI until live endpoint support is confirmed for normal accounts.
Important limitations
- Native 4K video output is exposed through the video
modedropdown. Models that do not supportmode=4kwill be rejected by the node capability checks before submission. - Native preset and cloned voices are available for
kling-v2-6;Image2Video.custom_voice_idsends cloned voice control throughvoice_list. The active API rejects this field forkling-v3. kling-v3-omniis visible for text-to-video, image-to-video, and multi-image video comparison. It can combinevoice_list/custom_voice_idwithelement_list; reference-video requests remain guarded because native audio andmode=4kare rejected whenreference_videois provided.kling-video-o1remains hidden until live endpoint support is confirmed for normal accounts.Advanced Element Createrequires 1 frontal subject image plus 1-3 additional reference images of the same subject. Background images do not count as reference images.Advanced Element Createalso enforceselement_name <= 20characters andelement_description <= 100characters.- If you need both strong subject consistency and voiced output, the reliable flow on the current endpoint is usually: generate the bound subject video first, then add speech with
Lip Sync,TextToAudio, orVideo2Audio.
Requirements
Before using these nodes, you need a Kling API key:
Python dependencies are listed in requirements.txt.
Installation
Manual installation
-
Open your
ComfyUI/custom_nodesdirectory. -
Clone this repository:
git clone https://github.com/magicwang1111/Comfyui-Kling-Wrapper.git -
Install dependencies:
Windows (portable ComfyUI):
python -m pip install -r ComfyUI\custom_nodes\Comfyui-Kling-Wrapper\requirements.txtLinux or macOS:
cd Comfyui-Kling-Wrapper pip install -r requirements.txt -
Create
config.local.jsonin the repository root.You can copy config.example.json and fill in your Kling credentials:
{ "provider_default": "official", "api_key": "", "access_key": "", "secret_key": "", "poll_interval": 1.0, "request_timeout": 30, "area": "global", "oss_endpoint": "", "oss_access_key_id": "", "oss_access_key_secret": "", "oss_bucket": "", "oss_prefix": "kling_uploads", "oss_signed_url_expires": 86400, "vapeur_api_key": "", "vapeur_base_url": "https://api.vapeur.ai", "vapeur_poll_interval": 5.0, "vapeur_request_timeout": 120, "vapeur_max_wait_seconds": 3600 }Notes:
api_keyis the newer Kling official static Bearer token. When it is set, the official client usesAuthorization: Bearer <api_key>and does not requireaccess_key/secret_keyJWT signing.provider_defaultacceptsofficial,tencent_vod, orvapeur. Provider selection remains backend-only and is not stored in ComfyUI workflows.- Vapeur uses only
vapeur_api_key(orVAPEUR_API_KEY) and never falls back to official or Tencent credentials. Its default base URL ishttps://api.vapeur.ai. - Vapeur model IDs are isolated from official Kling model IDs. The verified catalog currently maps
kling-v2-6tokling-v2-6-cnandkling-v3tokling-v3-cn; other models fail locally instead of submitting an unauthorized task. - Vapeur supports Text2Video, Image2Video, Multi Images To Video, Motion Control, Video Extender, Custom Voice Create/Query, and Advanced Element Create/Query. Nodes absent from the supplied Vapeur API, plus MultiModal Video Edit (
kling-v3-omniis unavailable), image generation, image expansion, virtual try-on, lip sync, avatar, effects, audio generation, TTS, and element deletion, fail explicitly instead of falling back to another provider. access_keyandsecret_keyremain supported for the older AK/SK signing flow.config.local.jsonis ignored by git and should hold your real private keys.config.example.jsonis only a template and is never read as live config.- Legacy config.ini is still accepted as a fallback for
KLINGAI_API_ACCESS_KEYandKLINGAI_API_SECRET_KEY.
-
Restart ComfyUI and search for nodes prefixed with
Comfyui-Kling-Wrapper.
Node list
Comfyui-Kling-Wrapper Image GeneratorComfyui-Kling-Wrapper Image ExpanderComfyui-Kling-Wrapper Text2VideoComfyui-Kling-Wrapper Image2VideoComfyui-Kling-Wrapper Multi Images To VideoComfyui-Kling-Wrapper Virtual Try OnComfyui-Kling-Wrapper Video ExtenderComfyui-Kling-Wrapper Lip SyncComfyui-Kling-Wrapper Lip Sync Text InputComfyui-Kling-Wrapper Lip Sync Audio InputComfyui-Kling-Wrapper AvatarComfyui-Kling-Wrapper EffectsComfyui-Kling-Wrapper TextToAudioComfyui-Kling-Wrapper TTSComfyui-Kling-Wrapper Custom Voice CreateComfyui-Kling-Wrapper Custom Voice QueryComfyui-Kling-Wrapper Custom Voice List BuilderComfyui-Kling-Wrapper Video2AudioComfyui-Kling-Wrapper Advanced Element CreateComfyui-Kling-Wrapper Advanced Element QueryComfyui-Kling-Wrapper Element List BuilderComfyui-Kling-Wrapper Motion ControlComfyui-Kling-Wrapper Preview VideoComfyui-Kling-Wrapper Preview Audio
Lip sync notes
Lip Sync now calls /v1/videos/identify-face followed by /v1/videos/advanced-lip-sync. Leave face_id empty to select the first detected face, or enter a returned face ID explicitly.
Lip Sync Audio Input accepts exactly one of a ComfyUI AUDIO connection, Kling audio_id, local audio_file, or public audio_url. ComfyUI audio supplies its duration automatically; URL, file, and ID inputs must provide sound_end_time_ms when the duration cannot be inferred.
Lip Sync accepts generated video_id, public video_url, local video_file, ComfyUI VIDEO, or video_frames plus video_info from VHS_LoadVideo. Local video inputs are uploaded through the same temporary media relay used by motion control.
For a Video Helper Suite workflow, connect LoadAudio -> Lip Sync Audio Input.audio, then connect VHS_LoadVideo.IMAGE -> Lip Sync.video_frames and VHS_LoadVideo.video_info -> Lip Sync.video_info.
Lip Sync Text Input remains supported. The node first creates preset-voice audio through /v1/audio/tts, then sends the resulting audio_id to Advanced Lip Sync.
Avatar notes
Avatar calls /v1/videos/avatar/image2video with one ComfyUI IMAGE and exactly one of AUDIO, audio_id, audio_file, or audio_url. Local ComfyUI audio is validated to be between 2 and 300 seconds before submission.
Custom voice and TTS notes
Custom Voice Create accepts one source at a time: a ComfyUI AUDIO input, a local voice_file, a public voice_url, or a Kling video_id. Local audio/files are uploaded through the same temporary media relay used by other media inputs.
The custom voice API returns a reusable voice_id plus a trial_url when the task succeeds. To audition the cloned voice, connect Custom Voice Create.trial_url or Custom Voice Query.trial_url directly to Preview Audio.audio_url.
Kling currently returns Voice id not found when a custom voice ID from Custom Voice Create is sent to /v1/audio/tts. Use TTS with official or preset voice IDs; use trial_url to preview custom voices.
Kling requires clean single-speaker source media between 5 and 30 seconds for voice cloning.
Connect Custom Voice Create.voice_id to Image2Video.custom_voice_id and select kling-v2-6 to use the cloned voice. Set mode=pro, sound=on, use a 5- or 10-second duration, and reference the voice as <<<voice_1>>> in the prompt. Custom voice mode rejects simultaneous voice_preset or element_list input.
Motion control notes
Motion Control now accepts reference video only from workflow inputs:
reference_video_input: connect a node that outputsVIDEOreference_video_frames+reference_video_info: connect an uploaded video loader that outputs decoded frames plus timing metadatareference_video: pass an existing public http(s) video URL directly
Reference images and local reference videos must be reachable by Kling before generation starts. If OSS settings are present in config.local.json or environment variables (OSS_ENDPOINT, OSS_ACCESS_KEY_ID, OSS_ACCESS_KEY_SECRET, OSS_BUCKET, OSS_PREFIX), the wrapper uploads media to Aliyun OSS first and sends Kling a signed temporary download URL. Without OSS, it falls back to public temporary hosts: tmpfiles.org, then catbox.moe.
The visible model_name dropdown for motion control is:
kling-v2-6kling-v3
duration is now a dropdown with:
auto35101530
When duration is set to auto, the node tries to match the uploaded reference video's duration using the connected video metadata or the VIDEO input object.
character_orientation controls whether subject orientation follows the reference image or the reference video:
image: keep orientation from the reference image while transferring motion from the videovideo: follow both motion and orientation from the reference video
Voice presets
Text2Video and Image2Video expose a voice_preset dropdown. Image2Video additionally accepts a connected custom_voice_id for one custom voice, or a connected custom_voice_list from Custom Voice List Builder for multiple custom voices.
The selected preset is converted to:
[{"voice_id":"..."}]
These presets are mainly intended for models that support native audio generation on the active endpoint, especially kling-v2-6.
For multiple custom voices, connect one or more Custom Voice Create.voice_id outputs to Custom Voice List Builder, then connect its custom_voice_list output to Image2Video.custom_voice_list. Set sound=on and reference each voice in order with prompt markers such as <<<voice_1>>> and <<<voice_2>>>. custom_voice_list, custom_voice_id, and voice_preset are mutually exclusive.
For official or manually supplied preset voice IDs, use the dedicated TTS node. It calls /v1/audio/tts and returns an audio_url that can be saved or previewed with Preview Audio.
Kling v3 Turbo notes
kling-v3-turbo is available in the Text2Video and Image2Video model dropdowns for the official Kling provider. It uses the newer /text-to-video/kling-3.0-turbo, /image-to-video/kling-3.0-turbo, and /tasks API shape with static Bearer-token auth.
The node keeps the existing front-end mode values for workflow compatibility:
stdsendssettings.resolution=720pprosendssettings.resolution=1080p4kis accepted but also sendssettings.resolution=1080p, because the v3 Turbo API currently documents only720pand1080p
Use duration values from 3 through 15. For multi-shot v3 Turbo prompts, write the shot structure directly in the prompt text; the older shot_type=intelligence, separate negative_prompt, cfg_scale, camera_control, sound, voice_list, image_list, element_list, and reference_video controls are not sent for this model.
Examples
Example workflows and small Python snippets live in examples/README.md.
The workflow JSON files no longer depend on a front-end Client node. Prepare config.local.json first, then import the workflow you want to run.
Official references
- Kling new-system API documentation
- Kling TTS API documentation
- Kling custom voice API documentation
- Kling advanced lip-sync API documentation
- Kling Avatar API documentation
- Kling 3.0 custom voice documentation
- Kling 3.0 Turbo text-to-video documentation
- Kling 3.0 series capability map
- Kling V2.6 API documentation
- Kling pricing
Notes
The nodes log final_unit_deduction when the API returns billing information. This is useful when checking the real unit cost of newer Kling endpoints and workflows.
Run ComfyUI workflows without the setup
No installs, no CUDA version roulette, no GPU sitting idle on your bill. Bring a workflow and run it in the browser.