SD HeartMuLa Sampler
HeartMuLa Sampler Generates Your Song One Token at a Time
- model
- conditioning
- audio_tokens
This is where the magic happens and where you'll wait. SD HeartMuLa Sampler takes the conditioning from the Conditioning node and runs the autoregressive generation loop - the actual "compose a song" step. It's a language model, same family as the LLMs you already know, except its vocabulary is audio tokens from the HeartCodec codec instead of words. It predicts one token frame at a time, feeding each prediction back in, until it hits an end-of-song token or the duration cap.
It is not fast. Every frame is a forward pass through a 3B-parameter transformer, and the loop runs roughly one frame per 80ms of audio - a 60-second song is hundreds of frames of sequential prediction. Generation is the single biggest time sink in the whole pack, and there's no clever way around it short of a bigger GPU. Put a real album's worth of patience behind this node.
The controls that actually shape the output:
- max_duration_sec - default 60, and it's a hard cap, not a target: the loop stops early if the model sings an EOS token. Range 10–240 (the model tops out at four minutes).
- temperature - default 1.0. Lower it (0.5 is a popular sweet spot) for more consistent, focused output. The model's weak spot is randomness and repetition; turning this down helps.
- top_k - default 50. Lower = more conservative. You'll rarely touch this unless you're chasing repeats, but it's there.
- seed -
-1means random. Set a fixed number to reproduce a run exactly, which is handy once you land on a song structure you like.
It also takes model (from the loader) and conditioning (from the conditioning node). Note that CFG is decided upstream in the Conditioning node - if you left cfg_scale above 1.0 there, this sampler is doing double the forward passes per frame for guidance, which is another reason a 60-second song takes as long as it does.
The single output, audio_tokens (HEARTMULA_TOKENS), feeds the Decode node - that's its only consumer.
Two things the console tells you that are worth reading. First, it prints the actual duration of what it generated (Generated N frames (X.XXs)), and if that's way short of your cap, your lyrics ran out of runway or the model just decided to end the song - that's normal, not an error. Second, watch for the memory-management lines: in low/ultra mode it offloads the codec to CPU and aggressively empties CUDA caches before starting, so you may see a burst of cleanup before the progress bar even moves.
The pack's settings print the seed it actually used when you left it at -1 - grab that number if you generate something great and want to recreate it.
Where people get burned: they set max_duration_sec to 240 expecting a four-minute song and get one at 20 seconds, or they leave temperature at 1.0 and get a loop-y, repetitious result that "starts to get louder" the longer it goes. Both are the model's known personality, and both are adjustable from this node. Start at 60 seconds, temperature 0.5–0.8, and tune from there.
Inputs (6)
| Name | Type | Default | Description |
|---|---|---|---|
| model | HEARTMULA_MODEL | Loaded HeartMuLa model from Model Loader node | |
| conditioning | HEARTMULA_COND | Conditioning from the Conditioning node | |
| max_duration_secopt | INT | 6010–240 | Maximum audio duration in seconds (max 240s / 4 minutes) |
| temperatureopt | FLOAT | 1.000.1–2 | Sampling temperature (higher = more random/creative) |
| top_kopt | INT | 501–500 | Top-k sampling (lower = more focused/consistent) |
| seedopt | INT | -1-1–2147483647 | Random seed (-1 for random) |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| audio_tokens | HEARTMULA_TOKENS | — |