Prompt Sequence Interpolator
The interpolation trick that turns 3 prompts into 300 smooth frames
- prompts
- feat_mods
- PROMPTS
- CHARTS
The pack gives you maybe three prompts for a whole song. It then wants to render hundreds of frames. Something has to fill the gap - and that something is the Prompt Sequence Interpolator, arguably the cleverest node in MBM's Music Visualizer. It takes your sparse keyframe sequence and the per-frame audio feature modifiers from the Audio Feature Calculator, and produces one prompt per frame via weighted interpolation. A 90-second track at 6 fps becomes ~540 prompts you never typed, morphing smoothly from "dog in a boat" to "cat with a pipe" to "crocodile in a top hat."
The mechanism, plainly. For each adjacent pair of prompts, the node takes that section of the feature-modifier array and normalizes it into weights. Then it blends the two prompts' conditioning tensors step by step: start + cumulativeWeight × (stop - start). Because modifiers are big in energetic moments, the blend hangs near the old prompt when the music is loud and rushes toward the new one as things change - so interpolation speed literally follows the song. It interpolates the positive and negative conditioning and the SDXL pooled outputs, so the whole thing stays coherent on SDXL models. If one prompt has more tokens than another, it zero-pads the shorter one to match rather than crashing, then trims the final sequence to the exact frame count. That's a detail you'll never notice unless it's missing.
The inputs. prompts (your PROMPT_SEQ from a builder or the JSON loader), feat_mods (the calculator's FEAT_MODS), and split_mode - your one real decision:
split_evenly- each prompt pair gets an equal slice of frames. Simple, predictable, good default.split_on_timecode- pairs are sized by the timecodes attached to each prompt (from the Advanced builder or the loader's JSON), so a prompt scheduled at second 12 gets its transition centered there. Requiresfeat_seconds, the optional input fed by the calculator'sFEAT_SECONDSoutput.
Set split_on_timecode without feat_seconds (it defaults to -1) and the node refuses to run - that's a deliberate validation error, not a glitch. And timecode mode needs prompts that actually carry timecodes; feed it a plain-builder sequence and it errors.
The outputs. PROMPTS - the interpolated sequence, one entry per frame - goes straight into the Prompt Sequence Renderer. CHARTS is a stack of matplotlib charts showing the mean of the positive and negative prompts frame by frame, the normalized feature modifiers overlaid as a dotted line, and a prompt-distribution chart with vertical markers where each keyframe prompt starts. That distribution chart is the single most useful debug tool in this pack: you can see at a glance whether a transition is happening where you wanted it.
Why this is the trick that makes the pack work. Interpolating conditioning in latent space instead of just crossfading images is the same family of idea as the old "prompt travel" tricks in the A1111 animation scene - but here the weighting is driven by real audio features, and it happens per frame inside the graph instead of as an afterthought. It's also where the pack's whole "smooth" identity comes from; skip it and you get hard cuts, which has its own aesthetic but isn't what this pack is for.
Install once for the whole pack: git clone https://github.com/Sorcerio/MBM-Music-Visualizer.git MBM_MusicVisualizer into custom_nodes, pip install -r requirements.txt, restart. It sits in MBMnodes/Prompts.
Inputs (4)
| Name | Type | Default | Description |
|---|---|---|---|
| prompts | PROMPT_SEQ | — | |
| feat_mods | TENSOR_1D | — | |
| split_mode | COMBO | 2 options: split_evenly, split_on_timecode | |
| feat_secondsopt | FLOAT | -1.00-1–10000 | — |
Outputs (2)
| Name | Type | Description |
|---|---|---|
| PROMPTS | PROMPT_SEQ | — |
| CHARTS | IMAGE | — |