Prompt Enricher
Append Mood Data to a Prompt, Deterministically, With Zero LLM Calls
- enriched_prompt
Here's the thing nobody tells you about prompt-engineering LLM nodes: sometimes you don't want the LLM to touch your prompt at all. The main Audio Mood Analyzer already did the creative work - it turned the song into mood_json and then into full image prompts. Prompt Enricher exists for the moments when you want the mood data bolted onto a prompt without another language-model call deciding what's important. It's deterministic, it's instant, and it does exactly one thing.
This is the node in the pack you'd reach for when you're iterating. You've got a merge_prompt or environment_prompt from the analyzer, you've got the mood_json sitting right there, and you want to force the color palette, lighting, and texture fields into the prompt text so the sampler can't drift away from them. Prompt Enricher takes a base prompt, reads the selected fields out of mood_json, and appends them comma-separated. No Ollama call, no token budget, no hallucination risk - same input, same output, every time.
Inputs and the one that does the work
prompt- the base prompt, typicallymerge_promptorenvironment_promptfrom Audio Mood Analyzer. Multiline.mood_json- the JSON string from Audio Mood Analyzer'smood_jsonoutput.fields_to_inject- this is the whole node. One field name per line, appended in the order you list them. Default iscolor_palette,lighting_implications,texture_implications. Want the composition cues instead? Swap the lines. Want everything? List them all.
The output is enriched_prompt, a single STRING you can wire straight into CLIPTextEncode or a string-concat node.
Two behaviors worth knowing about, straight from the source:
- The
avoidfield gets special treatment. Instead of a plain comma append, it's prefixed asavoid: .... That's a deliberate hint: pipe a prompt enriched withavoidinto your negativeCLIPTextEncodeand you get a mood-aware negative prompt for free. Theavoidlist from the mood analysis is the node's way of telling you what not to generate. - Unknown field names and empty values are silently skipped, and if
mood_jsonis malformed the base prompt passes through unchanged. It never crashes, never throws. You can stick it in a workflow and forget about it.
Why you'd use it over just pasting
You could hand-copy the palette into the prompt - you won't, though, because the whole point of ComfyUI is that the graph does the glueing. And you could feed the mood JSON to an LLM and ask it to rewrite the prompt, but that's slow and non-reproducible, and it's exactly the thing this node is the alternative to. When you're batch-generating and want mood data attached with surgical predictability - same fields, same order, same result - Prompt Enricher is the honest tool. It's the "no LLM" companion to this pack's LLM-heavy core, and that role is more useful than it sounds.
Install
Same as the rest of the pack. ComfyUI Manager → search AudioMoodAnalyzer, or:
cd ComfyUI/custom_nodes
git clone https://github.com/andrea-spoldi/ComfyUI-AudioMoodAnalyzer.git
pip install -r ComfyUI-AudioMoodAnalyzer/requirements.txt
Restart, and it lives under audio/mood. Note that this node itself needs no Ollama and no extra models - only the mood_json you're already producing. The whole pack's install (librosa, soundfile, transformers for CLAP) is what you're pulling in to get to it.
Inputs (3)
| Name | Type | Default | Description |
|---|---|---|---|
| prompt | STRING | — | |
| mood_json | STRING | — | |
| fields_to_inject | STRING | color_palette lighting_implications texture_implications | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| enriched_prompt | STRING | — |