Nodes/ComfyUI-AudioX/AudioX Text to Audio
ComfyUI Node

AudioX Text to Audio

Type 'typing on a keyboard', get keyboard sounds

By lum3on·Created about a year ago·Updated about a year ago· 53
AudioX Text to Audio
  • model
  • audio
text_promptTyping on a keyboard
steps250
cfg_scale7.0
seed-1
duration_seconds10.0

This is the node that makes the whole pack make sense. Feed it an AUDIOX_MODEL from the AudioX Model Loader and a sentence describing a sound, and it returns actual audio - no API, no key, no cloud. Given how young local text-to-audio is in ComfyUI (people are still mostly leaning on MMAudio or a cloud service for this), having a self-contained diffusion model for sound effects is genuinely handy for foley, ambience beds, and game/short-video sound design.

The mechanism is the interesting part. The node calls stable-audio-tools' generate_diffusion_cond with a text-conditioned diffusion pass, using the dpmpp-3m-sde sampler. Your prompt gets run through an enhancement step first (enhance_audio_prompt) that appends audio-domain context - it'll turn "rain on a window" into "natural environmental rain on a window sound" - and the model generates a waveform of duration_seconds length at its native sample rate, then normalizes and clamps it. The default is 250 steps, which is slow, but that's the quality dial.

Inputs that matter

  • model - the AUDIOX_MODEL output from the loader. Non-negotiable.
  • text_prompt - describe the sound. The default Typing on a keyboard is a good sanity check for your first run.
  • steps - 250 by default (range 1–1000). For quick experiments, 50–100 steps gets you a preview in a fraction of the time.
  • cfg_scale - 7 by default, 0.1–20. This is classifier-free guidance: higher = sticks to your prompt harder (and gets more artificial/overcooked past ~10).
  • seed - -1 = random every run. Set a fixed seed to lock a result.
  • duration_seconds - 1–30, default 10. Longer costs more VRAM and time, and AudioX is already a heavyweight.

The single output, audio, is a ComfyUI AUDIO - a dict with waveform and sample_rate. From here it plugs into the pack's AudioX Volume Control or Audio Processor, or into any audio-save/encode node (VHS's SaveAudio or similar) to write an actual file.

Installing

Same story as the rest of the pack:

cd ComfyUI/custom_nodes
git clone https://github.com/lum3on/ComfyUI-StableAudioX.git
cd ComfyUI-StableAudioX
pip install -r requirements.txt

Then grab the AudioX weights + config.json from HKUSTAudio/AudioX on Hugging Face and drop them in ComfyUI/models/diffusion_models/, renaming the weights to AudioX.ckpt. System-level ffmpeg and libsndfile are recommended. ComfyUI Manager can install the code (search "ComfyUI-AudioX"), but the model download stays manual.

Common issues

  • First queue is slow or does nothing for a while. The first call lazily imports the heavy generation stack (stable_audio_tools, DAC codec, transformers) - the pack also auto-installs missing deps at startup, so the very first run can take minutes. Subsequent runs are faster.
  • "Audio generation failed" errors. Often tensor-size errors from conditioning; the node has a fallback path for the common ones. If you keep hitting it, cut duration_seconds - this model was tested on a 4090, and it shows.
  • Expectations. Be honest with yourself: this is a finetune of stable-audio-tools, not a miracle. Single sounds and ambience work well; "an entire orchestral score that ends on a swell" will disappoint. That's the state of local audio gen, not a bug.

Wire it up, hit run, and the reward is a 10-second WAV that matches your description instead of a search through a royalty-free library. That's a pretty good trade for a free node.

CategoryAudioX/Generation

Inputs (6)

NameTypeDefaultDescription
modelAUDIOX_MODEL
text_promptSTRINGTyping on a keyboard
stepsINT2501–1000
cfg_scaleFLOAT7.00.1–20
seedINT-1-1–4294967295
duration_secondsFLOAT10.01–30

Outputs (1)

NameTypeDescription
audioAUDIO