Prompt Sequence Loader
Author your whole song's prompts in JSON instead of wiring a prompt forest
- clip
- PROMPTS
There are two ways to feed prompts into MBM's Music Visualizer: chain Prompt Sequence Builders in the graph, or write the whole script as a JSON file and load it with this node. For a three-prompt demo, the builders are fine. For a song with a dozen scenes, a forest of CLIPTextEncode + builder wiring gets old fast - and that's when the Prompt Sequence Loader earns its keep. It reads a prompt sequence from JSON, encodes the text with a CLIP model you supply, and hands you the same PROMPT_SEQ the builders produce.
How it works. The node reads every .json file from the pack's own promptSequences/ directory (custom_nodes/MBM-Music-Visualizer/promptSequences/) and puts them in a filepath dropdown - note it ships with a working example.json already in place, so the dropdown is populated from the moment you install. The JSON follows a small documented spec:
defaults.positive/defaults.negative- fallback prompts used whenever a sequence entry doesn't specify its own.sequence- an ordered list. Each entry can have its ownpositiveandnegative, and an optionaltimecode(seconds) that becomes the "fully present" moment used by the Interpolator'ssplit_on_timecodemode.- A bare
{}entry means "use the defaults" - a clean way to hold a prompt steady across a section.
The node validates the file (missing defaults or sequence throws a ValueError with a message that tells you exactly what's wrong), then encodes each prompt with its own CLIPTextEncode call internally, wraps everything in the pack's MbmPrompt containers, and attaches the timecodes. The prompt-encoding all happens inside - you never see the encodes, you just supply the clip.
Inputs and outputs. Just two inputs: filepath (the dropdown) and clip, the CLIP model from your checkpoint loader. One output, PROMPTS, which feeds the Interpolator exactly like a builder's output. That's the whole node.
Why you'd bother. Repeatability, mostly. Prompt scripts live in a file you can edit in any text editor, diff, version-control, or regenerate - no digging through node widgets. If you ever rerun the same song, the JSON is your storyboard. It's also the natural home for timecodes: the Advanced builder gives you two per node, but a JSON file gives you one per scene with no extra nodes.
Gotchas, from the source. The file lives in the pack's promptSequences/ folder, not ComfyUI's input folder - same quirk as the Audio Loader's audio/ directory, so put your files in the right place and refresh the page. If your sequence array is empty, the node returns an empty sequence with a console note rather than crashing. And once prompts are encoded they can't be exported back out - the docs mention this, so don't treat the loader as a two-way format.
Same pack install as everything else: clone https://github.com/Sorcerio/MBM-Music-Visualizer.git into custom_nodes, pip install -r requirements.txt, restart. It appears under MBMnodes/Prompts, next to its builder siblings.
Inputs (2)
| Name | Type | Default | Description |
|---|---|---|---|
| filepath | COMBO | 1 options: example.json | |
| clip | CLIP | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| PROMPTS | PROMPT_SEQ | — |