Nodes/ComfyUI-VoxCPM/VoxCPM Train Config
ComfyUI Node

VoxCPM Train Config

The hyperparameters behind VoxCPM's LoRA trainer

By wildminder·Created 11 months ago·Updated 4 months ago· 496
VoxCPM Train Config
    • Train Config
    learning_rate0.0001
    lora_rank32
    lora_alpha16
    lora_dropout0.00
    warmup_steps100
    grad_accum_steps1
    max_batch_tokens8192
    sample_rate48000
    weight_decay0.01
    enable_lm_loratrue
    enable_dit_loratrue
    enable_proj_lorafalse

    This is the settings panel for VoxCPM's LoRA training pipeline - a pure config node with no audio in or out, whose whole job is to bundle every training hyperparameter into one place and hand it to VoxCPM LoRA Trainer through its train_config input. You build this once per training run, plug it in, and everything it holds shapes how that run behaves.

    If you've trained a LoRA for an image model before, most of these names will look familiar - rank, alpha, dropout, warmup, gradient accumulation are the same concepts everywhere LoRA shows up. What's specific to VoxCPM is which parts of the model actually get adapted, and that's the more interesting section here.

    The parameters that matter

    • learning_rate (default 1e-4) and weight_decay (default 0.01) - standard optimizer settings.
    • lora_rank (default 32, range 4–128) and lora_alpha (default 16, range 1–128) - rank sets how much capacity the LoRA adapter has; alpha scales how strongly it applies. Higher rank means a more expressive adapter at the cost of a larger file and more compute.
    • lora_dropout (default 0) - regularization for the LoRA layers specifically, separate from the base model's own dropout.
    • warmup_steps (default 100) and grad_accum_steps (default 1) - standard training-loop knobs; gradient accumulation lets you simulate a larger effective batch size without more VRAM.
    • max_batch_tokens (default 8192) - the direct VRAM-management lever. If training runs out of memory, this is the first thing to bring down.
    • sample_rate (default 48000) - and this one is worth reading the tooltip on literally, because it's a real trap: use 48000 for VoxCPM2 and 44100 for VoxCPM1.5. Training against the wrong sample rate for your chosen base model is an easy, invisible-until-it-bites mismatch.
    • enable_lm_lora / enable_dit_lora (both default on) / enable_proj_lora (default off) - these three toggles are the interesting part. VoxCPM's architecture, per the pack's own framing, is an end-to-end diffusion-autoregressive system built on a MiniCPM-4 language-model backbone: there's a language-model component (lm) handling the text/semantic side, a diffusion transformer (dit) handling the continuous-space acoustic generation, and separate projection layers connecting the two. These flags let you choose which of those get LoRA-adapted. LM and DiT are on by default because that's where most of a voice's character lives; projection layers are off by default as the lighter-touch option.

    The output is Train Config (type *, a generic passthrough) - it only matters wired into LoRA Trainer's train_config input.

    Installing it

    Same pack, no separate install. ComfyUI Manager: search ComfyUI-VoxCPM. Manually:

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

    Restart, and it's under audio/tts/training alongside Dataset Maker and LoRA Trainer.

    Common issues & troubleshooting

    Out of VRAM during training. Drop max_batch_tokens first - it's the parameter explicitly meant to manage memory usage. If that's not enough, grad_accum_steps lets you claw back effective batch size without raising memory pressure the same way a literal larger batch would.

    Trained LoRA sounds subtly wrong, or training behaves unpredictably. Double-check sample_rate against base_model_name on the LoRA Trainer node - 48000 for VoxCPM2, 44100 for VoxCPM1.5. A mismatch here is invisible in the config itself; it only shows up as bad results downstream.

    LoRA doesn't seem to be affecting the character of the voice much. Check enable_lm_lora and enable_dit_lora are actually on - if both got flipped off and only enable_proj_lora is active, you're adapting the smallest, least voice-defining part of the model.

    No TTS-specific rank/alpha guidance to lean on. Unlike image-model LoRA training, where the community has settled on well-tested rank/alpha/learning-rate conventions, there isn't an equivalent, widely-agreed playbook for VoxCPM specifically yet - the defaults here are a reasonable starting point, but treat any specific number as a starting point to experiment from rather than a proven recipe.

    Categoryaudio/tts/training

    Inputs (12)

    NameTypeDefaultDescription
    learning_rateFLOAT0.00010.000001–0.01Learning rate for the optimizer.
    lora_rankINT324–128Rank (dimension) of the LoRA adapter.
    lora_alphaINT161–128Alpha scaling factor for LoRA.
    lora_dropoutFLOAT0.000–0.5Dropout probability for LoRA layers.
    warmup_stepsINT1000–1000Number of warmup steps for learning rate scheduler.
    grad_accum_stepsINT11–64Number of steps to accumulate gradients before updating weights.
    max_batch_tokensINT81921024–32768Maximum number of tokens per batch to manage VRAM usage.
    sample_rateINT4800016000–48000Sample rate of the training audio. Use 48000 for VoxCPM2, 44100 for VoxCPM1.5.
    weight_decayFLOAT0.010–0.1Weight decay for regularization.
    enable_lm_loraBOOLEANtrueApply LoRA to the Language Model backbone.
    enable_dit_loraBOOLEANtrueApply LoRA to the Diffusion Transformer.
    enable_proj_loraBOOLEANfalseApply LoRA to projection layers.

    Outputs (1)

    NameTypeDescription
    Train Config*