Nodes/ComfyUI-ZoeyTool/Zoey - 音乐生成
ComfyUI Node

Zoey - 音乐生成

YuE2 Crammed Into a Single ComfyUI Node

By liangzoey·Created about a year ago·Updated 2 days ago· 5
Zoey - 音乐生成
  • ref_audio
  • 音频
  • 结果说明
mode文生音乐
desc
duration120
takes1
seed0
languageChinese
vocalhusky male vocal
genrefolk
bpm78
instrument_1fingerstyle acoustic guitar
instrument_2harmonica
instrument_3
productionwarm analog production
style
lyrics
ai_lyricsfalse
llm_model
ref_audio_file
ckpt_name
lora_name
formatflac
vc_enabledfalse
vc_semitones0
vc_steps30
asr_enabledfalse

ComfyUI's audio story is thin, and music generation is the corner where the ecosystem just points at ACE-Step - good at instrumentals, weak at vocals. YuE2 goes the other way: it's a lyrics-forward music model, and ZoeyYue2Studio (「Zoey - 音乐生成」) is one node that takes a one-line description and a duration slider and hands you a finished song.

The whole YuE2 graph is normally eight wired nodes. This collapses it into a single execute() - loading, scoring, sampling, decoding and saving all happen inside. There are no required connections. You type a sentence, drag the slider, hit Run.

It's backend-only: no frontend JS, which is why the style selectors are plain server-side dropdowns.

The one input you actually set

desc is a one-line description of the song. duration is 30–300 seconds, and its tooltip is the most useful sentence on the node: it's an upper bound, not a promise. YuE2 turns it into a token budget at 25 tokens/second, silently shrinks that budget if your style string or lyrics are long, and may finish early on its own. Budget roughly 7 seconds per lyric line - past that, the tail gets truncated. The real length only comes back from the model, so the node prints each take's actual duration in 结果说明.

mode toggles between 文生音乐 (text-to-music) and 翻唱 (cover: transcribe a reference song's melody, then re-sing it with new style and lyrics). Cover needs reference audio - either the optional ref_audio AUDIO input (which wins) or ref_audio_file. No reference, no cover: it fails early rather than wasting a run.

takes (1–4) gives you multiple versions, seeds spaced base + i × 7919 - one take isn't enough to judge vocals.

Then the style selectors: language, vocal, genre, bpm, instrument_1instrument_3 and production, composed server-side into one style string, same formula as YuE Studio. Two details matter: the language must be explicitly selected or you'll get Chinese lyrics sung with an English accent, and the BPM needs its unit. style overrides the whole thing if you fill it in. lyrics takes [Verse]/[Chorus] tags; leave it blank with ai_lyrics on and a local llama.cpp server writes it from desc. Priority everywhere is manual over automatic: your style and lyrics always win, and the AI only fills what's empty.

ckpt_name picks the YuE2 checkpoint, lora_name an optional adapter (applied to both MODEL and CLIP - style and melody tokens come out of the CLIP half), and format is flac or mp3.

Two outputs. 音频 (AUDIO) is the take; wire it to a save-audio node. 结果说明 (STRING) carries per-take durations plus warnings - send it to Show Text instead of leaving it dangling.

Three optional extras: vc_enabled swaps the lead vocal for the reference audio's timbre, asr_enabled transcribes the finished song to check the words landed, and llm_model picks the GGUF used for lyric writing.

Install

ComfyUI Manager, or:

cd ComfyUI/custom_nodes
git clone https://github.com/liangzoey/comfyui-ZoeyTool.git
cd comfyui-ZoeyTool
pip install -r requirements.txt

Restart. Torch, Pillow, numpy and opencv come from that; the YuE2 model itself is core ComfyUI, supplied separately.

The traps, in order of how often they'll bite you

1. It needs a ComfyUI new enough to have YuE2 in core. run() imports comfy_extras.nodes_yue2, the SheetSage2 encoder from nodes_audio_encoder and comfy_api.latest.UI. It's registered unconditionally, so on an older build it appears in the menu and dies with an ImportError on Run. Update ComfyUI first.

2. Non-Windows users: the helper engines are hardcoded to the author's machine. Absolute Windows paths for llama-server, the CUDA bin directory, the ASR environment and Seed-VC's Python sit at the top of nodes/zoey_yue2_studio.py. On Linux or macOS the llm_model dropdown shows 「(没找到 GGUF 模型)」 and AI lyrics, voice conversion and transcription can't run until you edit those constants. Text-to-music doesn't need them.

3. Name your files so the dropdown can find them. ckpt_name filters for checkpoints with yue2 in the filename, then falls back to listing every checkpoint if nothing matches - so it's easy to pick a Qwen-Image checkpoint and get a nonsense error. Same fallback on the LoRA list, and cover mode wants a SheetSage2 audio encoder in models/audio_encoders.

4. Pin the seed and it silently does nothing. No IS_CHANGED anywhere in this pack. With seed on control_after_generate (the default) each Run regenerates; pin it and ComfyUI serves cached audio, skipping the AI-writing and voice-conversion subprocesses entirely.

5. The CPU fallback has no error message. llama.cpp needs the CUDA bin directory on PATH; without it the server silently falls back to CPU - ten times slower, and it just looks like the node is being slow.

With ai_lyrics or vc_enabled on, GPU work is serialized so two models are never resident at once. Takes land in output/yue/<timestamp>/ with an mp3/ subfolder, lyrics.txt and meta.json.

CategoryZoey Tool/音乐生成

Inputs (26)

NameTypeDefaultDescription
modeCOMBO文生音乐2 options: 文生音乐, 翻唱
descSTRING一句话描述你想要的歌。开了「AI 写词」时由它生成风格和歌词。
durationINT12030–300时长上限(秒),按每行歌词约 7 秒折算。注意这是上限不是承诺:歌词太长会挤占预算,模型也可能提前收尾。真实长度会写在「结果说明」里。
takesINT11–4一次出几版。每版种子不同,挑一首满意的。
seedINT00–18446744073709550000
languageCOMBOChinese唱词语言。必须显式选,漏了会用英文口音唱中文。
vocalCOMBOhusky male vocal6 options: warm female vocal, ethereal female vocal, husky male vocal, clear male vocal, gritty male vocal with raspy edge, soft child vocal
genreCOMBOfolk8 options: folk, contemporary pop, alternative rock, synthwave, chinese traditional, hip hop, +2
bpmINT7860–180慢歌 60-90,中速 90-120,快歌 120-160。
instrument_1COMBOfingerstyle acoustic guitar11 options: 无, fingerstyle acoustic guitar, piano, electric guitar, bass, live drums, +5
instrument_2COMBOharmonica11 options: 无, fingerstyle acoustic guitar, piano, electric guitar, bass, live drums, +5
instrument_3COMBO11 options: 无, fingerstyle acoustic guitar, piano, electric guitar, bass, live drums, +5
productionCOMBOwarm analog production5 options: warm analog production, clean modern production, raw live-room production, retro 80s production, lo-fi intimate
styleSTRING手填风格提示词。留空则由上面几个选择器自动拼。填了就以这里为准。
lyricsSTRING歌词,用 [Verse] [Chorus] 分段。留空时若开了 AI 写词则由模型写。
ai_lyricsBOOLEANfalse用本地大模型写歌词。只补空着的字段,手填的一律优先。
llm_modelCOMBO1 options: (没找到 GGUF 模型)
ref_audio_fileCOMBO翻唱 / 变声用的参考音频。也可以直接连 AUDIO 输入口,那边优先。
ckpt_nameCOMBO1 options: (没找到 YuE2 模型)
lora_nameCOMBO1 options:
formatCOMBOflac2 options: flac, mp3
vc_enabledBOOLEANfalse生成后把主唱换成参考音频的音色。
vc_semitonesINT0-12–12
vc_stepsINT3010–100
asr_enabledBOOLEANfalse把成品转写成文本,方便核对唱对没有。
ref_audiooptAUDIO

Outputs (2)

NameTypeDescription
音频AUDIO
结果说明STRING