Kling Text to Audio
Type 'Rain on a Tin Roof' and Get the Sound
- auth
- audio
- audio_file
- url
- task_id
Kling Text to Audio generates ambient sound and sound effects from a text description - "rain on a tin roof," "cafe chatter," "a distant train" - as a standalone audio clip. It's the pack's ambient/SFX arm, distinct from the TTS nodes that handle speech. If your video pipeline ends with a silent render and you want believable background audio without hunting a library, this is the node. It does not do voices; that's the TTS / voice-clone territory elsewhere in the pack.
This is where the Kling API route earns its keep in a way local can't cheaply match. Open-source audio generation in ComfyUI is a real but scrappy scene (models like MMAudio and AudioLDM exist and run locally), yet for quick, one-shot ambient beds a hosted call is often the pragmatic choice - no model download, no VRAM, no wrestling with a checkpoint that only speaks its training dialect. You pay a few credits per clip and move on.
How it works
Three inputs: auth (the KLING_AUTH object), prompt (multiline text describing the audio), and duration - an integer in seconds from 1 to 30, default 5. The flow underneath is the same shape as every generation node in this pack: submit a task to /v1/audio/text-to-audio, poll Kling until it's done (with the pack's adaptive backoff and ~1s cancellation check), download the result as an MP3, and load it into ComfyUI's AUDIO format.
Outputs:
audio(AUDIO) - the generated clip, ready to wire into anything that consumes audio (a video muxer, an audio preview, a Cloud Uploader).audio_file(STRING) - the path of the saved MP3 on disk.url(STRING) - the hosted URL Kling gave you.task_id(STRING) - the task handle, if you want to chain a Task Status check.
The output that matters day-to-day is audio. The others are mostly for debugging or for when you want the file/URL outside the graph.
Practical notes
- Write the sound, not the source. Describe the audio: "wind howling through a canyon," "a vinyl record crackle," "waves and seagulls." You're not asking for a scene, you're asking for a soundscape, and prompt hygiene shows in the result.
- Duration is a slider, not a promise. Keep clips under ~15 seconds for the best quality-to-credit ratio; long ambient beds come out better assembled from a few shorter clips, or run through the pack's video-to-audio / extend flows if you need a full soundtrack.
- It's per-call metered. Unlike a local audio model, every run spends credits. The Cost Estimator node in the pack can give you a rough number before you commit.
Common issues
- Silent or thin output - usually an under-specified prompt. "Ambient background" gives you mush; "steady rainfall on a metal roof with distant thunder" gives you something usable.
- Duration rejected or clipped - the API has its own limits beyond the widget's 30-second max; if a long value errors, drop it and re-roll shorter.
- No
audiooutput appearing - check theaudio_file/urloutputs instead; the tensor conversion is usually the failure point, and the file will tell you whether the download happened.
Install
It ships with the pack:
cd ComfyUI/custom_nodes
git clone https://github.com/IxMxAMAR/ComfyUI-Kling-Direct
or ComfyUI Manager → search "Kling Direct" → install → restart. No model downloads, no GPU required - just the libraries ComfyUI already bundles. Wire it between your Auth node and your final video save and you've got a one-stop silent-film-to-soundstage pipeline.
Inputs (3)
| Name | Type | Default | Description |
|---|---|---|---|
| auth | KLING_AUTH | — | |
| prompt | STRING | Text description of the audio to generate. | |
| duration | INT | 51–30 | Audio duration in seconds. |
Outputs (4)
| Name | Type | Description |
|---|---|---|
| audio | AUDIO | — |
| audio_file | STRING | — |
| url | STRING | — |
| task_id | STRING | — |