Nodes/ComfyUI-Easy-SongGeneration/Easy SongGeneration - 加载模型
ComfyUI Node

Easy SongGeneration - 加载模型

The loader that decides whether this music model fits in your VRAM

By eastmoe·Created 3 months ago·Updated 6 days ago· 4
Easy SongGeneration - 加载模型
    • songgen_model
    • 信息
    model
    version
    runtime_rootauto
    gpu_id-1
    use_flash_attntrue
    segmented_loadtrue
    quantization
    quantization_target
    rebuild_quantization_cachefalse
    llm_precisionfloat16
    diffusion_precisionbfloat16
    vae_precisionfloat32
    reload_modelfalse

    Easy SongGeneration - 加载模型 ("Load Model") is the gate every workflow in this pack walks through. It scans ComfyUI/models/SongGeneration/ for checkpoints, loads one into VRAM, and hands you a songgen_model handle that every generate node and the release node plug into. Think of it as the checkpoint loader for a music LLM - except the "checkpoint" is a codec LLM plus an audio diffusion decoder, and the settings on this node decide whether your 4B model runs on a 12GB card or OOMs on a 24GB one.

    How it works

    SongGeneration isn't one model. Upstream it's the Tencent "LeVo 2" stack: a language model that turns structured lyrics and style tags into audio tokens (a codecLM, ~4B for the v2-large checkpoint), then a Flow1dVAE diffusion decoder that turns those tokens into 48kHz audio. The pack caches the loaded stack keyed on everything that affects it - model, version, precision, quantization - so re-running this loader with the same settings is nearly free, and multiple generate nodes can share one handle without reloading. That's the whole "model caching" selling point, and it's real.

    分段加载 (segmented load) is the trick that keeps load-time VRAM sane: instead of materializing the whole 4B model at once, it initializes on the meta device and moves modules to the GPU one at a time. Leave it on unless you hit weird state issues.

    The inputs that matter

    • 模型目录 (model) - dropdown of every folder under models/SongGeneration containing a config.yaml and model.pt. If it says "No local SongGeneration models found", run the download node first.
    • 版本 (version) - auto / v2 / v1. Auto infers from the folder name; leave it.
    • Flash Attention - the pack's own docs say it plain: turn this off if your GPU or env doesn't support it, or the load/forward pass throws.
    • 量化格式 (quantization) - none, fp4, fp8, int4, int8, plus 量化范围 (target: LLM / +Diffusion / +VAE). Quantized weights are cached in models/SongGeneration-cache so you only pay the conversion once. The trap: quantizing the VAE can hurt audio quality and compatibility - the author says so explicitly. If your output sounds off, first suspect VAE quantization.
    • LLM 精度 / Diffusion 精度 / VAE 精度 - per-module dtypes (float16 / bfloat16 / float32). Defaults are LLM=fp16, Diffusion=bf16, VAE=fp32 - a sensible split for a consumer card.
    • 重新加载 (reload_model) - ignore the existing cache and reload weights fresh. For when you've fiddled with settings and want a clean slate.

    Outputs

    • songgen_model - the custom SONGGEN_MODEL type. Wire it to any generate node (they share it freely) and to the release node when you're done.
    • 信息 (info) - a JSON string with what loaded: path, version, sample rate, precisions, quantization details. Handy for debugging and for checking what you actually loaded without trusting your memory.

    Where people get burned

    The two classic failure modes are Flash Attention errors (turn it off) and the LFS pointer error (torch.load on a pointer file) - the latter means weights never actually downloaded, so go back to the download node. And if VRAM is the problem, the order of attack is: segmented load on → lower LLM precision → enable LLM quantization → if you must quantize the VAE, test the output. Then remember the release node exists; this model will happily sit in VRAM forever otherwise.

    Categoryeastmoe/Comfy-Easy-SongGeneration

    Inputs (13)

    NameTypeDefaultDescription
    modelCOMBO包含 config.yaml 和 model.pt 的模型子文件夹。
    versionCOMBOauto 会根据模型目录名推断 v1/v2。
    runtime_rootSTRINGautoauto 会搜索模型目录、ComfyUI/models/SongGeneration 和插件目录。
    gpu_idINT-1-1–16-1 使用当前 CUDA 设备。
    use_flash_attnBOOLEANtrue环境支持时可开启。
    segmented_loadBOOLEANtrue按模块分段加载/移动权重,减少加载时显存峰值。
    quantizationCOMBOLinear 权重量化格式;none 表示不量化。缓存位于 ComfyUI/models/SongGeneration-cache。
    quantization_targetCOMBO选择要量化的模块。VAE 量化可能影响音质或兼容性。
    rebuild_quantization_cacheBOOLEANfalse忽略已有量化缓存并重新生成。
    llm_precisionCOMBOfloat16LLM 推理/权重计算精度。
    diffusion_precisionCOMBObfloat16音频 Diffusion 解码模型计算精度。
    vae_precisionCOMBOfloat32音频 VAE 编解码计算精度。
    reload_modelBOOLEANfalse忽略缓存并重新加载权重。

    Outputs (2)

    NameTypeDescription
    songgen_modelSONGGEN_MODEL
    信息STRING