YuE2 Official Semantic Tokens
The Stage That Decides What the Song Actually Sounds Like
- models
- plan
- options
- semantic
- report
Semantic Tokens is the middle child of the staged YuE2 graph, and it does the least visible work: takes a saved plan, generates audio tokens, writes them to an artifact folder. No audio comes out. Nothing in the ComfyUI canvas shows you a result.
It's also the stage that determines whether the song is any good. The plan fixes what gets played; this pass decides how it's played.
What's actually happening
YuE2 is two autoregressive passes and an acoustic renderer. The plan gave you notation. This node conditions the semantic pass on that exact plan - its exact token IDs, straight from the artifact, not re-tokenized from the ABC text - and generates a sequence of semantic audio tokens at 25 tokens per second. Then the acoustic model in the next stage turns those into latents.
Twenty-five tokens per second is the number to internalize, because it's how you reason about length. semantic_max_tokens, default 9000, works out to roughly 360 seconds of audio. It is a ceiling, not a target: the model stops when it wants to. The author is unusually direct about this in the node description, presumably because everyone gets it wrong exactly once.
Inputs and outputs
Required: models from the Model Loader, and plan from Generate ABC. Optional: options, which is where your semantic_* sampler settings live - temperature, top_p, top_k, repetition penalty and window, min and max tokens.
That optional options input is the entire reason to be at this node in a staged graph. Because the plan is frozen upstream, this is a clean experiment: change one semantic parameter, re-queue, hear the difference in the same composition. Do that in a one-node graph and you're comparing two different songs and learning nothing.
Outputs are semantic (YUE2_SEMANTIC, an artifact reference for Synthesize) and report, which is the JSON you actually want to read - token counts, generation rate, whether the ceiling was hit. A truncated semantic pass produces playable audio later, so the report is your only warning that the ending isn't an ending.
Practical settings
Leave semantic_temperature at 1.0 and semantic_top_p at 0.95 to start. They're the official defaults and they're looser than the ABC pass on purpose: too tight here and you get a stiff, loop-prone performance; too loose and the singer wanders off the melody the plan just wrote.
The knob with a real job is semantic_repetition_penalty (1.2 default, over a 50-token window). If you're hearing a phrase come around again and again, this is the lever - nudge it up rather than turning temperature into a blunt instrument.
And semantic_min_tokens (200) is a floor, not a length control. People set it hoping for a minimum song length and get a very short song that took slightly longer to stop.
Install
Ships with the pack under audio/YuE2 Official. It won't do anything without the isolated runtime and adapted models, and it needs a plan produced after installation - cached artifacts from an older pack version get rejected:
cd ComfyUI/custom_nodes
git clone https://github.com/jeankassio/ComfyUI_YuE2
cd ComfyUI_YuE2 && sh setup-runtime.sh && sh scripts/download-models.sh && sh convert-models.sh
Then load example_workflows/02-staged-generation.json.
Troubleshooting
"Invalid YuE2 artifact ID; connect a freshly executed YuE2 stage" means the plan reference is missing or doesn't look like a real artifact - usually a stale output from before an update, occasionally a graph where Generate ABC never actually ran. Re-queue the plan node.
If this node is slower than you expected, remember each stage launches its own process and reloads the 3B weights. There's no shared model in memory between stages; the artifact folder is the handoff. That's the price of stage isolation, and it's why the pack frees ComfyUI's other cached models before each launch.
Finally: don't wire ABC text into this node's neighbourhood hoping to nudge the composition. Editing the score is a Text Encode job. Here, the plan is authoritative and the only thing you steer is the performance.
Inputs (3)
| Name | Type | Default | Description |
|---|---|---|---|
| models | YUE2_MODELS | — | |
| plan | YUE2_PLAN | — | |
| optionsopt | YUE2_OPTIONS | — |
Outputs (2)
| Name | Type | Description |
|---|---|---|
| semantic | YUE2_SEMANTIC | — |
| report | STRING | — |