Nodes/Comfyui-YuE2-T8/YuE2 生成语义 Tokens
ComfyUI Node

YuE2 生成语义 Tokens

Stop and save the expensive half of a song

By T8mars·Created 3 days ago·Updated a day ago· 28
YuE2 生成语义 Tokens
  • model
  • plan
  • semantic
  • metadata

This is the second of the three /高级 nodes, and it exists so you can cut the pipeline in half. YuE2's song generation is four stages: an ABC plan, then the autoregressive model producing semantic tokens, then the acoustic model producing latents, then a VAE decode to audio. This node runs stage two and stops.

What you get out of it

semantic - a YUE2_SEMANTIC handle to wire into YuE2 声学合成. Behind it is a job artifact folder holding the token array as a plain integer .npy, a small JSON with timing, a manifest, and a copy of the plan it came from. metadata is the job status JSON.

The reason to route through here instead of just generating a song: the AR stage is the long one. It's the model sitting there emitting tokens, one at a time, for minutes. If you're experimenting with anything downstream - attention backend, memory budget, the acoustic stage at all - you don't want to re-pay for that every attempt. Tokenize once, then grid the rest.

The other reason is restarts. The pack writes stage checkpoints, and a failed or cancelled long run can resume from the semantic artifact instead of starting over. That's the difference between a 25-minute experiment and a 25-minute experiment you have to redo.

Inputs, and the thing that trips people

Inputs are just model and plan. No sampling knobs here at all - sampling parameters for this stage live behind the WebUI, not in the ComfyUI node. If you came looking for a top-p slider, there isn't one.

The trip hazard is provenance. Every advanced artifact carries a manifest pinning the model repository source, the runtime weight identity, and a digest of the previous stage's manifest. Before this node writes anything it verifies the plan's hash manifest; before the next node runs, it verifies this one's, and checks that the weight identity still matches the current install. Change your model directory, swap or re-download a weight between stages, and the chain breaks with an error rather than producing a song built from two different models.

Good design, minor annoyance: the fix is to regenerate from the plan, not to try to re-associate the old artifacts. Same applies if you upgraded the pack between stages - old advanced artifacts get rejected, and the guide is explicit that modified or legacy artifacts are refused.

Install

cd ComfyUI/custom_nodes
git clone https://github.com/T8mars/Comfyui-YuE2-T8.git

Run install_runtime.bat once from the node directory, restart ComfyUI, and pass YuE2 模型服务 before queueing. Registry: comfy node install yue2-t8. Recommended: Windows 10/11, NVIDIA, 24 GB VRAM, 60 GB free disk. This stage is AR inference - it's slower than the acoustic stage but far less memory-hungry, which is why offload_ar on the loader defaults to on.

Wiring and expectations

YuE2 模型服务YuE2 生成乐谱计划this nodeYuE2 声学合成YuE2 VAE 解码. All three advanced nodes take the same model handle; keep the same loader node feeding the whole chain so the provenance check has nothing to complain about.

Two honest notes. First, the token count in metadata is your song's length constraint - a truncated semantic result means the acoustic stage will produce a track that stops early, and it'll carry that flag forward. Second, this is a raw-stage workflow: you lose the candidate batching and the single-click convenience the full song node gives you, and you gain the ability to stop halfway. That's the trade. If you just want a song, use YuE2 生成歌曲.

One more: these artifacts are ordinary files on disk under the job output folder, and the pack's retention policy eventually cleans finished jobs up. Long-lived experiments should be exported with YuE2 导出工件, which copies the whole artifact tree to exports and exempts it from cleanup.

CategoryYuE2 音乐/高级

Inputs (2)

NameTypeDefaultDescription
modelYUE2_MODEL
planYUE2_PLAN

Outputs (2)

NameTypeDescription
semanticYUE2_SEMANTIC
metadataSTRING