Nodes/ComfyUI-RT-HeartMuLa/RT HeartMuLa Sampler
ComfyUI Node

RT HeartMuLa Sampler

Where a Four-Minute Song Actually Gets Built

By monnky·Created 7 months ago·Updated 7 months ago· 11
RT HeartMuLa Sampler
  • model
  • tokenizer
  • codec
  • gen_config
  • AUDIO
lyrics[Verse]
auto_clear_kv_cachetrue
tags
duration_seconds240
cfg_scale1.70
temperature1.00
top_k50
seed0

This is the node that does the actual work. Feed RT HeartMuLa Sampler the four handles from the loader plus some lyrics and tags, and it writes a full song - up to ten minutes of it - to a AUDIO output that you save or preview. If you came here from a workflow someone posted, this is the big orange box in the middle of the graph and it's where your GPU spends the next several minutes.

Understanding the mechanism helps you set the knobs, because the community feedback on HeartMuLa is consistent: vocals are great, lyric adherence is strong, but genre and style adherence is weak and every generation is a bit of a gacha roll. Most of the settings here exist to push back on that.

How it works

HeartMuLa is an autoregressive model over codec tokens, not a diffusion model like the image samplers you're used to. At 12.5 frames per second it predicts the next frame of audio tokens, then the HeartCodec model decodes that token stream into a 48kHz waveform. The sampler does roughly this:

  1. Builds the prompt from your tags (wrapped in <tag>...</tag>) followed by your lyrics - both lowercased, because the paper requires lowercase comma-separated tags.
  2. Runs classifier-free guidance: when cfg_scale is above 1.0 it doubles the batch (one conditional, one unconditional stream) and uses CFG to enforce the tags.
  3. Samples frame-by-frame with a temperature that decays slightly as the track goes on (0.9999 ** i per frame, floored at 0.8) - that's the pack's fix for the "song turns robotic near the end of long tracks" problem.
  4. Watches for an audio-EOS token so a song can end naturally instead of being chopped, then detokenizes, applies a 0.1s fade-in and 2.5s fade-out, and peak-normalizes so you don't blow your ears off.

There's a lot of KV-cache bookkeeping under the hood - a hard cache reset when CFG switches between 1.0 and higher (that was the v1.06 "Batch Size Mismatch" fix), plus aggressive soft_empty_cache calls on long runs so four-minute tracks don't OOM.

The inputs you'll actually touch

  • lyrics (default [Verse]) - the actual words. Multiline. The model sings these, and by all accounts it's unusually faithful to them. Structure it like a real song ([Verse], [Chorus]) and it mostly follows along.
  • tags - a comma-separated style description: genre, mood, instruments, vocal type. It must be wired in, not typed (forceInput is on) - that's exactly what the RT HeartMuLa Tags Builder is for.
  • cfg_scale (default 1.7, range 1–5) - this is your tag-obedience dial. At exactly 1.0 the model is known to ignore tags; the community found raising it (some people go as high as 4–5) is what actually gets you the genre you asked for. It costs some cleanliness in exchange.
  • duration_seconds (10–600, default 240) - the target song length. This is also your main OOM lever: every second is 12.5 more tokens to generate and hold.
  • temperature (default 1.0) and top_k (default 50) - creativity knobs. People report good results around 0.5–0.7 temperature for keeping a consistent style; higher is more chaotic.
  • seed - a seed of 0 randomizes. Same seed + same settings = same song, which is handy when you're hunting for the one that doesn't sound cheesy.

The single AUDIO output goes to any node that accepts audio - the pack's own RT HeartMuLa Preview will name files and play them for you, or the core SaveAudio node works fine.

Realistic expectations

This is not Suno. It's a 3B model on your local GPU and it's slow - roughly a minute and a half of compute per 60 seconds of audio on a 4090, slower on mid-range cards, before decode. On 8GB, run 4-bit and keep songs short; enabling the loader's compile_model (20–30% faster after the first run) pays off if you iterate a lot.

Common issues

  • Tags are ignored - you're almost certainly at cfg_scale 1.0, or feeding the tags in the wrong format. Raise CFG, use lowercase comma-separated tags, and let the Tags Builder format them.
  • Long tracks turn robotic or mushy at the end - that's the known failure mode the temperature decay targets; if you still hear it, shorten the duration or drop temperature a notch.
  • OOM on long durations - shrink duration_seconds, go 4-bit in the loader, and keep in mind a full 240s track is a lot of autoregressive steps.
  • "Batch Size Mismatch" if you switch CFG between runs - fixed in v1.06 via the hard KV-cache reset; if you still see it, toggle auto_clear_kv_cache (default on) or bump the pack to the latest version.
CategoryHeartMuLa/Generation

Inputs (12)

NameTypeDefaultDescription
modelHEARTMULA_MODEL
tokenizerHEARTMULA_TOKENIZER
codecHEART_CODEC
gen_configHEART_GEN_CONFIG
lyricsSTRING[Verse]
auto_clear_kv_cacheBOOLEANtrue
tagsSTRING
duration_secondsINT24010–600
cfg_scaleFLOAT1.701–5
temperatureFLOAT1.000.1–2
top_kINT500–200
seedINT00–18446744073709550000

Outputs (1)

NameTypeDescription
AUDIOAUDIO