LLM Session ID / Cache Buster
The cache-buster that stops your LLM from giving you the same song twice
- session_id
- seed
ComfyUI caches node outputs by their inputs. That's normally great. But it's a trap when you're using an external LLM node to generate song prompts, because your creative prompt doesn't change between runs - "instrumental progressive house, emotional, 4–5 minutes" stays exactly that string - so ComfyUI looks at the LLM node's inputs, sees no change, and hands you yesterday's response. The LLM never even runs. That's what "LLM Session ID / Cache Buster" exists to break.
It's a two-line node that turns a seed into a text session ID. Wire its session_id output into the session_id input your LLM node supports, set the seed widget's control-after-generate to Randomize or Increment, and every queue run feeds the LLM a different session ID - which means a different input, which means ComfyUI's cache is invalidated and the model actually re-executes. Same prompt, new song. That's the whole trick.
Inputs and outputs
seed- an INT that becomes the session ID. Defaults to 1. The control-after-generate behavior (Randomize/Increment) is what makes it useful in batches; the brief and README both tell you to set it.prefix- text prepended to the numeric seed, defaultsong_. It has zero effect on sampling; it only makes the session ID recognizable in logs and metadata.
Outputs are session_id (a STRING like song_48273) and seed (the same INT, passed through so you can also log it). The seed passthrough is handy when you want the session seed and the generation seed to line up in the sidecar.
Where it fits
In the example workflow it sits in the prompt-preparation stage, feeding the local GGUF LLM node (the toolkit's prompt and parser nodes are LLM-runtime agnostic - they work with whatever ComfyUI LLM node you run). Without it, batch workflows silently generate the same song as many times as you queue, because the creative prompt never changes. That's the failure mode this node kills.
Installing it
Pack install via ComfyUI Manager (search "MiniMax Music Production Toolkit") or:
cd ComfyUI/custom_nodes
git clone https://github.com/jplenio/ComfyUI-MiniMax-Music-Production-Toolkit.git
cd ComfyUI-MiniMax-Music-Production-Toolkit
python -m pip install -r requirements.txt
Dependencies: scipy, soundfile, imageio-ffmpeg, mutagen, Pillow. Restart ComfyUI and hard-refresh once.
Gotchas
Two things to check when it "doesn't work." First, your LLM node has to actually accept and honor a session_id input - if it doesn't expose one, this node has nothing to bust, and you'll need the LLM node's own cache-clear mechanism. Second, the seed widget's control-after-generate mode has to be Randomize or Increment; leaving it on Fixed means the session ID never changes and the cache stays warm. Also note: this only busts the LLM node's cache. The audio generation stages have their own seeds, and they're handled separately.
Inputs (2)
| Name | Type | Default | Description |
|---|---|---|---|
| seed | INT | 10–9223372036854776000 | Random seed for the KSampler. The same model, inputs, settings and seed are intended to reproduce the same sampling trajectory, subject to backend/device determinism. |
| prefix | STRING | song_ | Text prepended to the numeric seed when creating an external-LLM session ID. 'song_' is a clear default. The prefix has no sampling effect; it only makes the session identifier easier to recognize. |
Outputs (2)
| Name | Type | Description |
|---|---|---|
| session_id | STRING | — |
| seed | INT | — |