FL HeartMuLa Sampler
The slow node that turns your lyrics into audio tokens
- model
- conditioning
- audio_tokens
This is the node where the pack earns its keep and where it tests your patience. FL HeartMuLa Sampler takes the conditioning from the Conditioning node and autoregressively generates the audio tokens that become your song. It's the heavy step - on a 3090, real-world reports put it at roughly three minutes of compute per three minutes of audio. Plan accordingly.
How it works
HeartMuLa is a LLaMA-architecture language model trained on audio tokens, so sampling looks a lot like text generation: the model predicts the next frame of tokens from everything before it, one frame at a time, in a loop. Each frame is 80 ms of audio, and the sampler keeps going until it hits an audio EOS token or the duration cap - 240 seconds max, which is the model's ceiling anyway.
It feeds the prompt tensors from conditioning (which already handles CFG batching) into the model's generate_frame method with KV caches, and stops early when it detects an end-of-song token. The final output is a HEARTMULA_TOKENS object - frame tensors plus the sample rate - that isn't sound yet. It becomes sound one node later, in FL HeartMuLa Decode.
The inputs that matter
- max_duration_sec - default 60, range 10–240. This is a maximum; if the model hits its EOS token it stops early. Longer songs mean linearly more compute, so don't just max it out.
- temperature - default 1.0, range 0.1–2.0. Higher is more random and creative; lower is more consistent but can get repetitive. The community consensus that emerged is 1.1.
- top_k - default 50, range 1–500. Lower is more focused. Community testing landed on ~30 as the sweet spot that obeys tags better without going stale.
- seed -
-1for random, or lock it to reproduce a run. Since rerolling is the normal workflow here, you'll usually leave this at -1 and let the sampler gamble for you.
Note the mismatch with the README: it lists cfg_scale as a sampler parameter, but in the shipped code CFG actually lives on the Conditioning node. If you're hunting for it, look there, not here.
Installation
Same pack, same steps:
cd ComfyUI/custom_nodes
git clone https://github.com/filliptm/ComfyUI_FL-HeartMuLa.git
cd ComfyUI_FL-HeartMuLa
pip install -r requirements.txt
Or ComfyUI Manager → search "FL HeartMuLa" → Install → restart. The Sampler needs both a loaded model and conditioning, and it'll sit idle until it has them.
Common issues
- It's slow - is it broken? No. Autoregressive generation is inherently sequential; 3,000 frames (a 4-minute song) is a lot of forward passes. On a 4090 people report sub-100s for three minutes of audio, which is about the practical floor.
- Output stops early / songs end abruptly - the model hit its EOS token. That's a model behavior, not an error; reroll or accept the shorter cut.
- Low memory modes crash the sampler -
ultra/lowmodes flush caches aggressively; if you're on the VRAM edge and seeing instability, drop tonormalor enable 4-bit in the loader instead. - Same output every time - check the seed; if it's locked, that's working as intended.
Wire the audio_tokens output into FL HeartMuLa Decode and you'll finally hear what the model has been singing about.
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 | — |