ComfyUI Node

Text2Audio

Generate a short sound clip from a text description via KLing

By KlingAIResearch·Created 2 years ago·Updated 10 months ago· 174
Text2Audio
  • client
  • id
  • url
prompt
duration3.0

The README's own name for this is TextToAudioNode, and that's exactly what it is: describe a sound in words, get a short generated audio clip back. This is the one node in the pack that isn't about images or video at all - it's KLing's text-to-audio model, useful for a quick sound effect, an ambient bed, or a short musical sting when you need something to go under a clip and don't want to go source it from a library.

How it works

You write a prompt describing the sound, set how long you want it, and KLing's servers generate and render the audio, handing back both an id and a download URL once it's done. Same async pattern as everything else in this pack - no local audio model, no local rendering, just a request and a poll.

The inputs and outputs that matter

  • prompt - a text description of the sound you want. Since there's no genre or instrument picker, how specific and evocative you get in the prompt is doing all the work here - "tense orchestral sting" is going to behave very differently from "birdsong in a quiet forest."
  • duration - 3 to 10 seconds, adjustable in 0.1-second steps. That fine-grained step size is worth noticing: if you're syncing this to a specific clip length, you can dial it in tightly rather than being stuck with whole-second increments.

Outputs are id (KLing's reference for the generation, useful if you need to look it up again) and url - the download link for the clip, which you'd typically route through a save step to actually get the file, since this node only returns the URL.

Installing it

ComfyUI Manager: search ComfyUI-KLingAI-API, install, restart. Manually:

cd ComfyUI/custom_nodes
git clone https://github.com/KwaiVGI/ComfyUI-KLingAI-API
cd ComfyUI-KLingAI-API && pip install -r requirements.txt

No local model to download - a Client node with a valid KLing AI API key upstream is what makes it run, region-matched via area to your account.

Common issues

The tight duration cap - a maximum of 10 seconds - is the thing to plan around rather than fight; this isn't built for a full music track, it's for a short sting, effect, or loop-length bed. If you're expecting a specific instrument or vocal style and getting something generic back, it's almost always the prompt being too vague rather than the model being weak - treat it the way you'd prompt a text-to-image model, with concrete, sensory language rather than an abstract mood word. Since this node only hands back a url, don't forget a download/save step afterward if you actually need the file on disk - nothing in this node writes it there automatically. And as everywhere else in the pack, an authentication failure or empty account balance on the Client node will silently stall this one too.

CategoryKLingAI

Inputs (3)

NameTypeDefaultDescription
clientKLING_AI_API_CLIENT
promptSTRING
durationFLOAT3.03–10

Outputs (2)

NameTypeDescription
idSTRING
urlSTRING