Nodes/ComfyUI_YuE/YUE_Stage_A_Loader
ComfyUI Node

YUE_Stage_A_Loader

The 7B door you open first

By smthemex·Created 2 years ago·Updated about a year ago· 190
YUE_Stage_A_Loader
    • model
    stage_A_repom-a-p/YuE-s1-7B-anneal-en-cot
    xcodec_ckpt
    quantization_model
    use_mmgptrue
    stage1_cache_size16384
    exllamav2_cache_mode
    mmgp_profile

    Every YuE workflow starts here, and it's where most people get stuck before a single note is generated. YUE_Stage_A_Loader is the first node in the ComfyUI_YuE graph: it loads the Stage A language model - by default m-a-p/YuE-s1-7B-anneal-en-cot, ~11.5G - plus the xcodec audio codec, and hands the whole bundle to YUE_Stage_A_Sampler as one model wire. Think of it as the "load checkpoint" step of a music pipeline.

    What it actually loads

    Stage A is a ~7B causal language model trained on interleaved music codec tokens - the thing that reads your lyrics and writes the song's scratch track. Alongside it the loader sets up the xcodec codec that turns reference audio into codec tokens, and the mm tokenizer that turns your lyrics into model input. All three get packed into a single MODEL_YUE_A output.

    The quantization menu is where it gets real

    quantization_model is the big decision: fp16, int8, int4, or exllamav2. Your GPU decides which is sane:

    • ≥24G VRAM - keep fp16, leave use_mmgp off. Best quality, simplest. The README's recommended default.
    • ≤16G VRAM - two viable paths. Either keep fp16 with use_mmgp on and mmgp_profile set to 2 (works, but slow and wants lots of system RAM), or point stage_A_repo at an exllamav2 Q8 quantized repo and pick exllamav2 mode, which the README calls very fast. The bitsandbytes int8 path exists, but the README is blunt: very slow, "don't try it" - a 30-second clip measured in thousands of seconds.

    If you go exllamav2, you also pick exllamav2_cache_mode (FP16/Q8/Q6/Q4). If you go bitsandbytes (int8/int4), the loader requests flash_attention_2 explicitly in code - so a "FlashAttention2 is not installed" error means that's your missing piece.

    The rest of the inputs: xcodec_ckpt should resolve to ckpt_00360000.pth in ComfyUI/models/yue - the dropdown only lists files containing "36", so if it shows only "none", you haven't placed that file. stage1_cache_size (default 16384) is the KV cache size for exllamav2 mode. mmgp_profile (0–5) only matters with use_mmgp on: profiles 3–5 auto-quantize the model, and higher numbers trade RAM for VRAM at the cost of speed.

    Install and models

    Shared pack install - clone, install requirements, restart:

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

    (Or ComfyUI Manager → "ComfyUI_YuE".) The Stage A repo auto-downloads from Hugging Face on first load. You must place ckpt_00360000.pth (xcodec) in ComfyUI/models/yue, and the semantic model's pytorch_model.bin in the pack's inference/xcodec_mini_infer/semantic_ckpts/hf_1_325000/ folder. bitsandbytes comes via requirements; mmgp and exllamav2 are optional and uninstalled by default - install only the one you actually select, or you're pulling big GPU libraries for nothing.

    Gotchas

    • xcodec_ckpt stuck on "none" - the file isn't where the dropdown looks. Drop ckpt_00360000.pth in ComfyUI/models/yue and refresh.
    • mmgp errors when you didn't install mmgp - expected; the pack ships it uninstalled on purpose. Either pip install mmgp or turn use_mmgp off.
    • First load downloads 11.5G. The UI looks frozen; it isn't. Let it finish once and the repo stays local from then on.
    • Don't rename the install folder. The semantic model is loaded from a hardcoded custom_nodes/ComfyUI_YuE/... path, so the folder name matters.
    CategoryYUE

    Inputs (7)

    NameTypeDefaultDescription
    stage_A_repoSTRINGm-a-p/YuE-s1-7B-anneal-en-cot
    xcodec_ckptCOMBO1 options: none
    quantization_modelCOMBO4 options: fp16, int8, int4, exllamav2
    use_mmgpBOOLEANtrue
    stage1_cache_sizeINT163848192–2147483647
    exllamav2_cache_modeCOMBO4 options: FP16, Q8, Q6, Q4
    mmgp_profileCOMBO6 options: 0, 1, 2, 3, 4, 5

    Outputs (1)

    NameTypeDescription
    modelMODEL_YUE_A