Nodes/YuE2-ComfyUI/YuE2 Plan Batch
ComfyUI Node

YuE2 Plan Batch

Four takes on the same words, for the price of one listen

By pytraveler·Created a day ago·Updated about 22 hours ago· 0
YuE2 Plan Batch
  • options
  • plans
  • scores
styleEnglish, warm piano pop, expressive female voice, acoustic piano, rounded bass and light drums, unhurried phrasing, 88 BPM
lyrics[Verse] Neon fades along the lane Footsteps keep the time of rain [Chorus] Let the day come into view Every road begins with you
seed831001
count4

YuE2's score stage is the cheap part of a song - 2.2 seconds of an 8.9-second run in the pack's own measurement. So the sensible way to hunt for a take is to write a handful of scores for the same words, listen to none of them, and only sing the one you pick.

YuE2 Plan Batch is the first half of that. It's YuE2 Plan with a count bolted on: same style, same lyrics, consecutive seeds, and you get the whole set back as a batch instead of one score.

Inputs and outputs

  • style - a description, not tags. The node ships a filled-in default ("English, warm piano pop, expressive female voice, acoustic piano, rounded bass and light drums, unhurried phrasing, 88 BPM") which is the default of every node in the pack, so you'll be overwriting it.
  • lyrics - the words with [Verse] / [Chorus] markers on their own lines; empty for an instrumental.
  • seed - the starting seed. The batch runs seed, seed + 1, seed + 2… so this is the first take, not a random draw.
  • count - 2 to 8 scores, default 4.
  • options - optional YUE2_OPTIONS socket. The same caveat as everywhere else applies: cot: off is refused, because there's no score to batch when the score stage is skipped.

The outputs are a pair. plans (YUE2_PLANS) is the batch handle, and it's what you wire to YuE2 Select Plan. scores is a single readable string - every take in the batch laid out as one labelled block, === 0 | seed 831001 === and the notation under it - meant for a text preview node so you can eyeball four scores before singing any of them. It is not a list; it's one string.

Why the batch, and why the pick is a separate node

Four scores cost 8.8 seconds against 35.7 for four songs in the pack's own numbers, and the ratio keeps improving as songs get longer, because the singing grows and the planning barely does. That's the whole argument. You spend a few seconds to not spend minutes.

But the reason YuE2 Select Plan is its own node rather than an index widget on this one is worth internalizing, because it's a ComfyUI caching trick you'll reuse. If the index lived here, bumping it from 0 to 1 would mark this node dirty and re-plan the entire batch - new scores, new everything, four songs' worth of planning to hear one take. With selection downstream, the batch node's output is unchanged, so it doesn't re-run. Only what follows the selector does. Trying the next take costs the singing, and nothing else.

Install

It's in the pack, so:

cd ComfyUI/custom_nodes
git clone https://github.com/pytraveler/YuE2-ComfyUI

Restart after. You'll find it under YuE2/Advanced, next to YuE2 Plan, YuE2 Select Plan, YuE2 Render Plan and YuE2 Decode Latents - most people never need any of them, which is why they're one level down. The pack's fourth template, "Four scores, one song", wires the whole chain up for you in the template browser. tiktoken is the only dependency the pack adds, and the 7.26 GB checkpoint arrives on first run into models/checkpoints/.

Where it goes wrong

The cost is linear. Four takes is roughly four score passes on one loaded model, so count: 8 is eight passes and about four times the wait of the default - busy but not free. The saving is real, not infinite.

Consecutive seeds mean correlated takes, in the obvious sense that seeds 831001 through 831004 are neighbours. If all four come back feeling like variations on the same idea, change the style line, not the seed range; that field decides what the record sounds like and the lyrics only decide what's sung. And an index past the end of the batch won't stop your run - YuE2 Select Plan clamps to the last take and warns you, which is friendlier than an error and also means a silently wrong take if you asked for take 5 of 4 without reading the console.

CategoryYuE2/Advanced

Inputs (5)

NameTypeDefaultDescription
styleSTRINGEnglish, warm piano pop, expressive female voice, acoustic piano, rounded bass and light drums, unhurried phrasing, 88 BPMWhat the song should sound like: language, genre, voice, instruments, tempo. This is a description, not a list of tags. 'English, warm piano pop, expressive female voice, 88 BPM' works better than 'pop, piano, female'.
lyricsSTRING[Verse] Neon fades along the lane Footsteps keep the time of rain [Chorus] Let the day come into view Every road begins with youThe words to sing, with section markers on their own lines: [Verse], [Chorus], [Bridge], [Outro]. Leave it empty for an instrumental. Long lyrics eat into the context the song itself needs, so a very long text lowers the ceiling on 'max_seconds'.
seedINT8310010–9223372036854776000The same seed with the same settings gives the same song, byte for byte. That holds only while 'attention_backend' is 'sdpa', which is the default.
countINT42–8How many scores to write, from consecutive seeds starting at 'seed'. Each one is a different take on the same words. Pick between them with 'YuE2 Select Plan' and only the one you pick gets sung.
optionsoptYUE2_OPTIONS

Outputs (2)

NameTypeDescription
plansYUE2_PLANS
scoresSTRING