AUDIO Music to Emotion Detector @ vrch.ai
Turn a song into valence and arousal floats
- audio
- AUDIO
- RAW_DATA
- MOODS
- VALENCE
- AROUSAL
The AUDIO Music to Emotion Detector @ vrch.ai is where the ComfyUI Web Viewer pack starts doing something most audio nodes in this ecosystem don't: it maps music onto human emotion, numerically. Feed it an AUDIO clip and it returns mood labels plus two float values - VALENCE and AROUSAL - that describe how positive and how intense the track feels. Wire those two floats into your prompt or your generation parameters and you get visuals that move with the music's emotional shape, not just its waveform.
This is the node behind the pack's "music emotion and visualizer" example workflow, and it's genuinely the one people reach for when they want a DJ-reactive art setup. The catch: unlike most of the pack, this node needs an optional third-party model installed, and it's the one install step people miss.
How it works
The node runs the audio through the Music2Emotion model, which the pack bundles as a git submodule. The model scores the track across a set of moods and collapses that into the two-dimensional valence-arousal space that emotion research loves: valence runs sad-to-happy, arousal runs calm-to-energetic. threshold (float, default 0.5) filters out mood labels below that confidence level, so it controls how many moods show up in the results.
The outputs:
- MOODS (STRING) - the mood labels that cleared the threshold.
- RAW_DATA (JSON) - the full scored output; this is what you feed into the pack's AUDIO Emotion Visualizer to get the radar chart and word cloud.
- VALENCE / AROUSAL (FLOAT) - the two emotion axes as plain numbers.
- AUDIO - passthrough of the input, so you can keep it in your chain.
Installing it (the important part)
The base pack gets you most nodes with zero extra downloads, but not this one. You need the Music2Emotion submodule:
cd ComfyUI/custom_nodes/comfyui-web-viewer
git submodule update --init --recursive
pip install -r requirements.txt
Or, if submodules aren't your thing, clone it manually into third_party:
cd ComfyUI/custom_nodes/comfyui-web-viewer/third_party
git clone https://github.com/VrchStudio/Music2Emotion.git music2emotion
Then restart ComfyUI. The pack's own requirements.txt already includes the Music2Emotion dependencies, and the README is explicit about why you should use that file rather than the submodule's: the versions in the main file are the tested-compatible ones. If the module isn't installed, the node still loads and shows a warning but won't actually detect anything - other audio nodes keep working fine, so it's easy to have it silently not working. The node itself tells you, but only as a startup warning you might glance past.
Where to go next
The intended flow is Detector → Emotion Visualizer → Web Viewer: score the music, render the moods as images, and stream those to a browser tab. Valence and arousal are also great as raw conditioning inputs - try mapping VALENCE to a brightness or warm/cool parameter and watch the look track the song's emotional arc in realtime.
Inputs (3)
| Name | Type | Default | Description |
|---|---|---|---|
| audio | AUDIO | — | |
| threshold | FLOAT | 0.500–1 | — |
| debug | BOOLEAN | false | — |
Outputs (5)
| Name | Type | Description |
|---|---|---|
| AUDIO | AUDIO | — |
| RAW_DATA | JSON | — |
| MOODS | STRING | — |
| VALENCE | FLOAT | — |
| AROUSAL | FLOAT | — |