Encode Ace (HMN)
Conditioning for music generation in ComfyUI
- clip
- mask
- CONDITIONING
Encode Ace is the pack's odd one out and you should know what it is before you wire it up, because it isn't for images at all. It prepares conditioning for ACE-Step - ByteDance's music generation model (ACE-Step-v1-3.5B, Apache 2.0) - which ComfyUI can run. If you've been generating audio in ComfyUI at all, you've likely seen ACE-Step workflows that need a text encoder for the song prompt and the lyrics. This is that encoder: it takes a song description, the lyrics, and three strength knobs, and produces the CONDITIONING your sampler needs to make the audio.
The inputs that matter
- clip - required. The CLIP from an ACE-Step checkpoint (the standard checkpoint loader can provide it). This is not a generic image CLIP.
- prompt - the tooltip calls it "detailed description of the song." Mood, genre, instrumentation, vibe. This feeds the model's main text conditioning.
- lyrics - the actual lyrics, and it responds to short bracket instructions:
[chorus],[verse],[instrumental]. That's structural guidance - you're telling the model how the song is laid out, not just what it's about. - prompt_strength - the "substancial cfg multiplier," default 1.0. Scales how hard the description steers the track.
- lyrics_strength - the "structural cfg multiplier," default 1.0. Scales the lyrics' structural influence.
- speaker_strength - the "embedding cfg multiplier," default 1.0. ACE-Step has a speaker embedding slot (a zeroed 512-dim embedding in the current implementation); this scales its influence.
- mask / set_area_to_bounds / mask_strength - optional mask "stretched over the entire track." Same mask-conditioning vocabulary as the image nodes, but applied along the audio timeline: a mask region, with set_area_to_bounds restricting attention to the mask's bounds and mask_strength as opacity.
How it works
The encoding path is the giveaway: clip.tokenize(prompt, lyrics=lyrics) - a tokenizer call with a lyrics argument that only an ACE-Step clip understands - then encode_from_tokens_scheduled, and finally conditioning_set_values stamps the three strengths and the optional mask onto the conditioning. Downstream, ComfyUI's ACE-Step model wrapper reads those values back as prompt_strength, lyrics_strength, speaker_strength and speaker_embeds during sampling. So the node is essentially the missing front-end for ACE-Step's conditioning schema.
The single biggest gotcha: it will not work with a normal SD/SDXL/Flux clip. Feed it an image-model clip and the lyrics= tokenize call will fail or produce garbage, because those clips don't have a lyrics path. This node is only useful once you have an ACE-Step checkpoint loaded. It's also worth knowing the pack README never mentions this node - the docs ran behind the code, so the tooltips are the real documentation.
Installing it
Part of Hellrunner's Magical Nodes. Install via ComfyUI Manager (search "Hellrunner's Magical Nodes") or:
cd ComfyUI/custom_nodes
git clone https://github.com/Hellrunner2k/ComfyUI-HellrunnersMagicalNodes.git
Restart after. No extra dependencies from this pack - but the ACE-Step checkpoint itself is the real requirement, and it's a download you'll need to make separately (the model is on Hugging Face as ACE-Step/ACE-Step-v1-3.5B).
Troubleshooting
- Encoding fails or output is nonsense? Check which checkpoint your
clipcame from. Any non-ACE-Step clip is the wrong input here. - Lyrics ignored? Confirm the bracket instructions are exactly
[chorus]-style - the node tokenizes them into structural markers; stray brackets or full sentences in the wrong field get treated as lyrics text instead. - Song sounds washed out or overdriven? The three strengths all default to 1.0. If the description is overpowering the structure, drop prompt_strength; if the track ignores the lyrics' arrangement, raise lyrics_strength.
Inputs (9)
| Name | Type | Default | Description |
|---|---|---|---|
| clip | CLIP | — | |
| promptopt | STRING | Detailed description of the song. | |
| lyricsopt | STRING | Lyrics - it also responds to short instruction in []. [chorus] [verse] [instrumental] | |
| prompt_strengthopt | FLOAT | 1.000–10 | substancial cfg multiplier |
| lyrics_strengthopt | FLOAT | 1.000–10 | structural cfg multiplier |
| speaker_strengthopt | FLOAT | 1.000–10 | embedding cfg multiplier |
| maskopt | MASK | Mask stretched over the entire track | |
| set_area_to_boundsopt | BOOLEAN | false | restrict attention to mask bounds |
| mask_strengthopt | FLOAT | 1.000–10 | Opacity of the masked area |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| CONDITIONING | CONDITIONING | — |