Nodes/Comfyui-Kling-Wrapper/Comfyui-Kling-Wrapper TextToAudio
ComfyUI Node

Comfyui-Kling-Wrapper TextToAudio

The quiet little node that scores your videos with sound

By magicwang1111·Created 5 months ago·Updated 18 days ago· 1
Comfyui-Kling-Wrapper TextToAudio
    • id
    • url
    prompt
    duration3.0

    Every video generation workflow hits the same wall: you render a great clip and it comes out dead silent. Kling's native audio is locked to specific models, so this node exists to fill the silence. Comfyui-Kling-Wrapper TextToAudio generates an audio track from a text description via Kling's /v1/audio/text-to-audio endpoint. Not speech - ambience, sound effects, music beds. Type "rain on a tin roof" or "distant city traffic" and get an MP3 back that sounds like it.

    It's the least glamorous node in the pack and one of the most useful. Native audio in video is the current frontier of closed video models - Google's Veo 3 made it a headline feature, and the open-source world still has no real equivalent - so Kling offering it as a separate paid call is a workable middle path. You can score a silent clip without ever leaving the graph.

    How it works

    The node is about as simple as a cloud API node gets. It wraps your prompt and a duration (a float from 3 to 10 seconds, default 3) into a task, submits it to /v1/audio/text-to-audio, and polls until Kling finishes. When it succeeds you get two outputs:

    • id - the audio ID on Kling's side
    • url - the MP3 URL you can preview or save

    That's it. Two inputs, two outputs, one API call. If the response comes back without a usable url_mp3, the node raises a "url_mp3 无效" error - Kling said it made something but didn't hand back a file, which usually means the task failed on their end. Check your credits and try a shorter duration.

    Where it fits

    TextToAudio is a utility node, so think of it as part of an assembly line rather than a hero node. The classic pattern is: Text2Video renders a clip → Video2Audio or TextToAudio builds a matching sound bed → Preview Audio lets you audition it before you commit. The pack's example workflow 11_comfyui_kling_wrapper_text_to_audio.json shows it standalone, and 15 chains subject-bound video generation into Video2Audio for music. If you just need a quick SFX layer for a clip you made elsewhere, this node is the fastest path to a file you can actually use.

    Installing it

    Same pack install as the rest of the wrapper:

    cd ComfyUI/custom_nodes
    git clone https://github.com/magicwang1111/Comfyui-Kling-Wrapper.git
    cd Comfyui-Kling-Wrapper
    pip install -r requirements.txt
    

    Or install via ComfyUI Manager by searching "Comfyui-Kling-Wrapper". Then create config.local.json in the repo root with your Kling API credentials and restart. There are no local models - every generation happens on Kling's servers and costs credits.

    Common issues

    Two gotchas worth knowing before you run it:

    • Provider matters. The node explicitly rejects the vapeur provider with a "text-to-audio" unsupported error. Use the official Kling provider, which is the provider_default you set in config.local.json.
    • The 3–10 second window is enforced. duration clamps to that range regardless of what you type. If you need longer audio, you'll have to generate in segments or reach for the TTS node instead.
    CategoryComfyui-Kling-Wrapper

    Inputs (2)

    NameTypeDefaultDescription
    promptSTRING
    durationFLOAT3.03–10

    Outputs (2)

    NameTypeDescription
    idSTRING
    urlSTRING