Audio Classification
What's That Sound? Audio Classification in ComfyUI
- results_json
Audio Classification is the node that tells you what a sound is. Feed it an audio file and it returns ranked labels - "speech," "guitar," "dog bark," "engine" - with confidence scores. In a ComfyUI graph it's the audio cousin of image classification: a quick way to tag audio clips, sort a folder by content, or sanity-check what's actually in a sound file before you build a bigger pipeline around it.
It wraps the audio-classification pipeline from Hugging Face, defaulting to MIT/ast-finetuned-audioset-10-10-0.4593 - an Audio Spectrogram Transformer fine-tuned on AudioSet, Google's massive audio event dataset. AST chops the audio into a spectrogram and runs it through a vision-style transformer, which is why it can recognize hundreds of everyday sound categories. The node returns the top labels as JSON with scores.
The inputs and output
- audio_path - a string path to an audio file on disk. The recurring pattern in this pack's audio nodes: it's a file path, not an audio signal, so make sure something upstream saved your audio to a real file.
- model_name - the Hub model ID, typed as a string.
- top_k - how many labels to return, default 5, range 1–20.
The single output, results_json, is a STRING with the ranked labels and scores - [{"label": "Speech", "score": 0.83}, ...] and so on.
How to install it
Standard pack install - ComfyUI Manager (search "ComfyUI-Transformers") or:
cd ComfyUI/custom_nodes
git clone https://github.com/kadirnar/ComfyUI-Transformers
Restart ComfyUI. The pack's requirements.txt includes soundfile and scipy for audio I/O, and the AST checkpoint is a few hundred MB on first download.
Where people get burned
The path-string input is the usual trap - beginners try to wire an AUDIO output from another node directly in and hit a type mismatch. You need a file path. And note the default model's scope: AudioSet categories are everyday sounds, so a clip that's purely speech will often come back labeled "Speech" with music or other secondary labels - it's not a music-genre or speaker-ID classifier. If your goal is transcribing the words, the ASR node in this pack is the one you want; if you want to know what kind of sound it is, this is it.
Inputs (3)
| Name | Type | Default | Description |
|---|---|---|---|
| audio_path | STRING | — | |
| model_name | STRING | MIT/ast-finetuned-audioset-10-10-0.4593 | — |
| top_k | INT | 51–20 | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| results_json | STRING | — |