Nodes/ComfyUI_YuE/YUE_Stage_A_Sampler
ComfyUI Node

YUE_Stage_A_Sampler

Where your lyrics become an actual song

By smthemex·Created 2 years ago·Updated 2 years ago· 190
YUE_Stage_A_Sampler
  • model
  • stage1_set
  • info
genres_promptinspiring female uplifting pop airy vocal electronic bright vocal vocal.
lyrics_prompt[verse] Staring at the sunset, colors paint the sky. Thoughts of you keep swirling, can't deny. I know I let you down, I made mistakes. But I'm here to mend the heart I didn't break. [chorus] Every road you take, I'll be one step behind. Every dream you chase, I'm reaching for the light. You can't fight this feeling now. I won't back down. You know you can't deny it now. I won't back down [verse] They might say I'm foolish, chasing after you. But they don't feel this love the way we do. My heart beats only for you, can't you see? I won't let you slip away from me. [chorus] Every road you take, I'll be one step behind. Every dream you chase, I'm reaching for the light. You can't fight this feeling now. I won't back down. You know you can't deny it now. I won't back down [bridge] No, I won't back down, won't turn around. Until you're back where you belong. I'll cross the oceans wide, stand by your side. Together we are strong. [outro] Every road you take, I'll be one step behind. Every dream you chase, love's the tie that binds. You can't fight this feeling now. I won't back down.
seed0
run_n_segment2
repetition_penalty1.1
prompt_start_time0.0
prompt_end_time30.0
max_new_tokens3000
use_dual_tracks_prompttrue
use_audio_promptfalse
offload_modeltrue
stage1_no_guidancetrue

YUE_Stage_A_Sampler is the node where YuE actually writes your song. The loader just pulls a 7B model into VRAM; this node is where your genre tags and lyrics become music. It's the second stop in a four-node chain - Stage A Loader → Stage A Sampler → Stage B Loader → Stage B Sampler - and if you're only going to fiddle with one node, it's this one.

What YuE is, in 30 seconds

YuE is an open-source lyrics-to-song model from the M-A-P team, released in early 2025. It was the first credible local alternative to Suno and Udio that took your lyrics, your genre tags, and returned actual full songs with vocals. It's not a diffusion model - it's a two-stage causal language model trained over music codec tokens. Stage A is a ~7B model that reads your lyrics section by section and generates a "scratch track" of interleaved vocal and instrumental codec tokens. Stage B is a 1B upsampler that turns those tokens into real audio. Community consensus: best local lyrics-to-song you can run, still noticeably behind Suno/Udio on polish - but it's local, free, and steerable, which is why people put up with the setup.

How the sampler works

You feed it two text prompts. genres_prompt takes genre/mood/vocal-timbre tags (the repo ships a top_200_tags.json to crib from), and lyrics_prompt is a multiline block split into [verse], [chorus], [bridge], [outro] sections. The node tokenizes each section, feeds them to the model one at a time, and glues the generated codec tokens into one sequence - vocals and instrumental interleaved as dual tracks. It saves the raw token files (.npy) to ComfyUI/output/stage1 and passes them along.

The two style-reference booleans are the part people miss. use_dual_tracks_prompt (on by default) and use_audio_prompt both borrow musical style from reference tracks that ship with the pack - pop.00001.Instrumental.mp3 and pop.00001.mp3 - so the model "gets a feel" for your genre. Here's the trap: those filenames are hardcoded in the source. You can swap the files for your own, but the names have to stay identical.

The inputs you'll actually touch:

  • prompt_end_time - this is how long the song is, not a generation timer. The README says start at 30 seconds. Single most important knob here.
  • run_n_segment - how many lyric sections to generate (default 2; each is a chunk of song).
  • repetition_penalty (default 1.1) and seed - your standard generation dials.
  • stage1_no_guidance - on by default; the code builds guidance internally, so leaving it on is usually right.
  • offload_model - on by default, kicks the 7B back to CPU after sampling so Stage B can load into the freed VRAM.

Outputs

  • stage1_set - the scratch-track tokens plus the codec objects Stage B needs. Wire it into YUE_Stage_B_Sampler.
  • info - carries your quantization choice (fp16/int8/exllamav2) and mmgp profile forward. Wire it into YUE_Stage_B_Loader's info input so Stage B loads the same way you ran Stage A. The bundled example workflow does exactly this; it's easy to miss.

Install and models

Install the pack first (block below), then gather the model files. Three go in ComfyUI/models/yue: ckpt_00360000.pth (the xcodec codec), plus decoder_131000.pth and decoder_151000.pth for Stage B. The pytorch_model.bin semantic model goes inside the pack at inference/xcodec_mini_infer/semantic_ckpts/hf_1_325000/. The two big LMs (Stage A ~11.5G, Stage B ~3.65G) auto-download from Hugging Face on first load if you leave the repo fields at their defaults. All told you're pulling roughly 15GB.

cd ComfyUI/custom_nodes
git clone https://github.com/smthemex/ComfyUI_YuE
cd ComfyUI_YuE
pip install -r requirements.txt

Restart ComfyUI. ComfyUI Manager works too - search "ComfyUI_YuE". If descript-audiotools drags in a torch version you don't want, the README suggests pip install --no-deps descript-audiotools.

Common issues

  • Sampler dies instantly because xcodec_ckpt shows only "none". The dropdown filters models/yue files by name - it only lists files containing "36". If ckpt_00360000.pth isn't there or is named differently, the dropdown has nothing and the run fails before it starts.
  • "No module named mmgp". mmgp is an optional dependency the pack deliberately leaves uninstalled - it's only needed if you flip a use_mmgp toggle on. Not using it? Don't install it. Using it? pip install mmgp.
  • First generation is slow. A 30-second song on a mid GPU takes minutes; the README flatly warns the int8 path is thousands of seconds. Start at 30 seconds and iterate on lyrics, not duration.
  • Don't rename the install folder. Some code paths assume the literal custom_nodes/ComfyUI_YuE location for the semantic model. Clone it as-is.
CategoryYUE

Inputs (13)

NameTypeDefaultDescription
modelMODEL_YUE_A
genres_promptSTRINGinspiring female uplifting pop airy vocal electronic bright vocal vocal.
lyrics_promptSTRING[verse] Staring at the sunset, colors paint the sky. Thoughts of you keep swirling, can't deny. I know I let you down, I made mistakes. But I'm here to mend the heart I didn't break. [chorus] Every road you take, I'll be one step behind. Every dream you chase, I'm reaching for the light. You can't fight this feeling now. I won't back down. You know you can't deny it now. I won't back down [verse] They might say I'm foolish, chasing after you. But they don't feel this love the way we do. My heart beats only for you, can't you see? I won't let you slip away from me. [chorus] Every road you take, I'll be one step behind. Every dream you chase, I'm reaching for the light. You can't fight this feeling now. I won't back down. You know you can't deny it now. I won't back down [bridge] No, I won't back down, won't turn around. Until you're back where you belong. I'll cross the oceans wide, stand by your side. Together we are strong. [outro] Every road you take, I'll be one step behind. Every dream you chase, love's the tie that binds. You can't fight this feeling now. I won't back down.
seedINT00–2147483647
run_n_segmentINT21–10
repetition_penaltyFLOAT1.11–2
prompt_start_timeFLOAT0.00–1024
prompt_end_timeFLOAT30.01–1024
max_new_tokensINT30002944–16384
use_dual_tracks_promptBOOLEANtrue
use_audio_promptBOOLEANfalse
offload_modelBOOLEANtrue
stage1_no_guidanceBOOLEANtrue

Outputs (2)

NameTypeDescription
stage1_setSTAGE_SET
infoquantization_model