VoxCPM2 Train Config
All Your LoRA Hyperparameters, In One Dictionary
- Train Config
VoxCPM2 Train Config is not a glamorous node. It takes eleven hyperparameters, bundles them into a dictionary, and hands that dictionary to the LoRA Trainer. It does exactly one thing and does it transparently. But since the whole training run lives or dies on what you set here, it's worth five minutes of your attention before you hit queue.
How it works
It's a pure config aggregator - every input is collected and passed through as a Train Config (*) output, which you wire into the matching train_config input on VoxCPM2 LoRA Trainer. No model loading, no downloads, instant. Think of it as a settings panel that happens to be a node.
The knobs that decide your run
lora_rank(default 32) - the dimension of the low-rank matrices. Higher captures more voice detail at the cost of VRAM and data. 32 is the sensible start; people chasing faithful clones report rank 64–128 gets genuinely impressive results, if you have the card for it.lora_alpha(default 16) - scaling factor. The old rule of thumb here isalpha = rank / 2, and it still holds for this pack.learning_rate(default1e-4) - if loss explodes to NaN, halve it to5e-5and retry.grad_accum_steps(default 1) - this one's a trap. The physical batch size is locked to 1 for stability, so gradient accumulation is how you fake a bigger batch. Raising this to 4–8 stabilizes gradients a lot more than it slows training.max_batch_tokens(default 8192) - the VRAM governor. OOM during training? Lower this before you touch anything else.warmup_steps(default 100) - the README suggests roughly 5–10% of your total steps.sample_rate(default 16000) - must match the AudioVAE encoder. The trainer auto-detects the right value and will warn-plus-override if you disagree with it, so leave this alone unless you know better.weight_decay(default 0.01),lora_dropout(default 0) - regularization; defaults are fine to start.enable_lm_lora/enable_dit_lora(both on) - apply LoRA to the language-model backbone and the diffusion transformer.enable_proj_lora(off) covers projection layers; only flip it on if you have a specific reason.
What to actually run
For a ~5-minute dataset, the guide's recipe is rank 32–64, LR 1e-4, grad_accum_steps 4–8, max_steps 1000–2000, save_every_steps 200. That's a solid first run - you want checkpoints to compare, not one final file. You'll almost always pick an intermediate checkpoint over the last one, because the last step is usually where overfitting creeps in.
Install and gotchas
Same pack as the rest: install ComfyUI-VoxCPM2 via Manager or clone into custom_nodes. This node itself is dependency-free, but the training chain needs argbind and datasets, which are not in the base requirements.txt - expect the Trainer node to nag you until you run pip install argbind datasets. And remember: configs are cheap. Tweak, rerun, compare. The expensive thing is the training that follows, not this node.
Inputs (12)
| Name | Type | Default | Description |
|---|---|---|---|
| learning_rate | FLOAT | 0.00010.000001–0.01 | Learning rate for the optimizer. |
| lora_rank | INT | 324–128 | Rank (dimension) of the LoRA adapter. |
| lora_alpha | INT | 161–128 | Alpha scaling factor for LoRA. |
| lora_dropout | FLOAT | 0.000–0.5 | Dropout probability for LoRA layers. |
| warmup_steps | INT | 1000–1000 | Number of warmup steps for learning rate scheduler. |
| grad_accum_steps | INT | 11–64 | Number of steps to accumulate gradients before updating weights. |
| max_batch_tokens | INT | 81921024–32768 | Maximum number of tokens per batch to manage VRAM usage. |
| sample_rate | INT | 1600016000–48000 | Sample rate must match AudioVAE encoder (16000 for VoxCPM2). |
| weight_decay | FLOAT | 0.010–0.1 | Weight decay for regularization. |
| enable_lm_lora | BOOLEAN | true | Apply LoRA to the Language Model backbone. |
| enable_dit_lora | BOOLEAN | true | Apply LoRA to the Diffusion Transformer. |
| enable_proj_lora | BOOLEAN | false | Apply LoRA to projection layers. |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| Train Config | * | — |