Nodes/MOSS-TTS/MOSS-TTS Loader
ComfyUI Node

MOSS-TTS Loader

The 13 GB download and the transformers trap

By Eutectico·Created 4 months ago·Updated 4 months ago· 0
MOSS-TTS Loader
    • model
    model_idOpenMOSS-Team/MOSS-TTS-Local-Transformer
    deviceauto
    dtypefp16
    attn_implementationsdpa
    keep_loadedtrue
    audio_tokenizer_deviceauto

    This is the node that downloads ~13 GB of weights the first time you run it, and it's also where the pack's biggest gotcha lives. Every MOSS-TTS workflow starts here: MOSSTTSLoader loads the 1.7B parameter model plus its processor, holds them in a module-level cache, and hands you the MOSS_TTS_MODEL handle that MOSSTTSGenerate consumes. Loader → Generate → Save Audio is the whole pack in a nutshell.

    How it works

    Behind the scenes it calls get_or_load(), which caches the loaded model keyed on (model_id, device, dtype, attention implementation). The cache survives across workflow runs and is cleared on ComfyUI exit, so you don't pay the load cost every run - only on first load and after an unload.

    It also ships compatibility shims that monkey-patch the transformers namespace to satisfy MOSS-TTS's remote code (trust_remote_code=True). MOSS-TTS expects a specific transformers API (MODALITY_TO_BASE_CLASS_MAPPING, PreTrainedConfig, ProcessorMixin attributes, _get_initial_cache_position), and the shims paper over the gaps across the 4.50 → 5.x range. They work - mostly.

    The inputs that matter

    • model_id - defaults to OpenMOSS-Team/MOSS-TTS-Local-Transformer. That's the 13 GB download. You will almost never change this.
    • dtype - auto / fp16 / bf16 / fp32. Default fp16 is right for T4-class cards (~16 GB VRAM). If you have ≥24 GB, the README suggests bf16 and a higher max_tokens on Generate.
    • device and audio_tokenizer_device - both auto/cuda/cpu. The audio tokenizer can be parked on CPU separately if VRAM is tight.
    • attn_implementation - defaults to sdpa, which is what you want. flash_attention_2 is offered but the package doesn't install flash-attn, so that option only works if you've added it yourself.
    • keep_loaded - default true means the model stays in VRAM after your run. Set it false and Generate frees the model after every run - which is exactly what the MOSSTTSUnload node does manually at the end of a graph.

    The single output, model (MOSS_TTS_MODEL), goes to Generate.

    Installing and the transformers trap

    Install is the standard two-step:

    cd ComfyUI/custom_nodes
    git clone https://github.com/Eutectico/ComfyUI-MOSS-TTS.git
    pip install -r ComfyUI-MOSS-TTS/requirements.txt
    

    ...or search "MOSS-TTS" in ComfyUI Manager and let it do both. The requirements pin transformers>=4.50,<4.58, alongside accelerate, torchaudio, librosa, soundfile, einops, omegaconf, sentencepiece, and protobuf.

    Here's the trap: ComfyUI installs all custom nodes into one shared Python environment. If another node you run pulls in transformers 5.x, MOSS-TTS's shims try to smooth it over, but the cleanest result is inside the pinned range. This is the classic ComfyUI dependency hell in miniature - the ecosystem doc could've told you - and it's the first thing to check when things break.

    Troubleshooting

    • Output sounds like noise, not speech - this is the pack's #1 failure mode, and it's almost always the wrong transformers version. Check with pip show transformers and pin to a 4.5x if you're outside the range.
    • OOM on load or generate - the 1.7B model wants ~16 GB with defaults. Drop to 8 RVQ on Generate or lower max_tokens before buying a new GPU.
    • Model seems to "disappear" - if keep_loaded is false, the previous Generate run freed it; the loader's IS_CHANGED hook forces a reload, so the second run is just slower, not broken.
    CategoryMOSS-TTS/loaders

    Inputs (6)

    NameTypeDefaultDescription
    model_idSTRINGOpenMOSS-Team/MOSS-TTS-Local-Transformer
    deviceCOMBOauto3 options: auto, cuda, cpu
    dtypeCOMBOfp164 options: auto, fp16, bf16, fp32
    attn_implementationCOMBOsdpa4 options: auto, sdpa, flash_attention_2, eager
    keep_loadedBOOLEANtrue
    audio_tokenizer_deviceCOMBOauto3 options: auto, cuda, cpu

    Outputs (1)

    NameTypeDescription
    modelMOSS_TTS_MODEL