(Deno) Audio Analysis Finalizer
Turns Gemma's acoustic-analysis rambling into the five lines your prompt needs — and frees the VRAM
- clip
- audio_context
(Deno) Audio Analysis Finalizer does one small job, and it's the job that keeps an audio-reference workflow from silently going sideways: it takes the raw text output of ComfyUI's audio-capable TextGenerate (a Gemma 4 acoustic analysis of your clip), strips out the reasoning chatter, keeps only the documented analysis fields, and - if you want - unloads the Gemma CLIP model afterward so it stops squatting on VRAM.
It's the second half of the Deno pack's MiniMax H3 audio-reference lane. Whisper gives you the words via (Deno) Audio Transcript; Gemma describes the sound (energy, rhythm, sound sources, performance cues); this node makes that description safe to feed downstream. That matters more than it sounds: pasting raw LLM output into a prompt chain is a classic trap, because reasoning text gets mistaken for instructions and the real analysis gets buried in prose.
How it works
The node's analysis STRING goes through a sanitizer with two passes. First it drops everything through the last </think> tag - Gemma's reasoning block, the "let me think about this" noise you never want in a prompt. Then it scans the remaining text for the seven documented headings and keeps only those, in canonical order:
AUDIO_CLASS, VOCAL_PRESENCE, MAJOR_SOUND_SOURCES, ENERGY_AND_RHYTHM, TIMED_ACOUSTIC_EVENTS, PERFORMANCE_CUES, UNCERTAINTIES
Everything else - code fences, unrelated lines, hallucinations - is discarded. The output is labeled as data, not instructions, so a downstream LLM treats it as evidence rather than commands.
Then the memory half: model_after_run defaults to Unload after run, which calls ComfyUI's unload_model_and_clones on the connected CLIP's patcher and flushes the cache. Because you give it the same CLIP value TextGenerate used, it can release exactly that analysis model without touching the rest of the pipeline. That's the trick that makes the whole chain VRAM-tolerable: transcribe, analyze, unload, then generate.
The three inputs
analysis- the raw Gemma 4 analysis STRING fromTextGenerate. It's a forced input, so it comes in on a wire, not typed.clip- the same Gemma 4 CLIP value TextGenerate consumed. This is how the node knows which model to unload. Wire the identical CLIP you used upstream.model_after_run-Unload after run(default) releases the analysis model;Keep loadedis the advanced option for running analysis repeatedly.
The single output, audio_context, is that clean canonical-order STRING - wire it into (Deno) Local LLM Loader's optional audio_context input alongside the transcript.
Install
Part of the Deno Custom Nodes pack - ComfyUI Manager, search "deno custom nodes", or:
cd ComfyUI/custom_nodes
git clone https://github.com/Deno2026/comfyui-deno-custom-nodes.git
cd comfyui-deno-custom-nodes
python -m pip install -r requirements.txt
No extra Python deps for this node itself. What it does need lives upstream: the TextGenerate step wants a Gemma 4 text encoder - the README calls for gemma4_e4b_it_fp8_scaled.safetensors in ComfyUI/models/text_encoders/ - and ComfyUI Stable with audio-capable TextGenerate. And the targeted unload needs ComfyUI 0.23.0 or newer.
Where people get burned
Three error messages tell you exactly what to fix. "Ended inside an unfinished <think> block" means Gemma's reasoning got cut off - rerun TextGenerate with Thinking disabled. "No usable supported fields" means the analysis prompt didn't produce the seven-field format - use the documented analysis prompt. "Targeted Gemma CLIP unload requires ComfyUI 0.23.0 or newer" is self-explanatory: update ComfyUI. The sneaky one is wiring a different CLIP into clip than the one TextGenerate used - the unload then can't find the right patcher and errors out. Same CLIP in, same CLIP out.
Inputs (3)
| Name | Type | Default | Description |
|---|---|---|---|
| analysis | STRING | Raw Gemma 4 audio analysis from Text Generate. Reasoning chatter is removed and only the supported analysis fields are kept. | |
| clip | CLIP | The same Gemma 4 CLIP value used by Text Generate. It lets the node release only that audio-analysis model after the text is ready. | |
| model_after_run | COMBO | Unload after run | Unload releases only the connected audio-analysis CLIP model. Keep loaded is an advanced option for repeated runs. |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| audio_context | STRING | Canonical-order supported audio-analysis fields with Gemma reasoning and unrelated chatter removed. |