VoxCPM_SM_LoraTrainerInit
Point It at Your Audio
- info
- config_path
ComfyUI isn't a trainer. It's a graph renderer, and every training node inside it is a hack that makes the graph renderer train anyway. This node is the first half of that hack for VoxCPM: it doesn't train anything. It reads your dataset manifest, picks the base model, collects your hyperparameters, and writes a config file that the VoxCPM_SM_LoraTrainerLoop node then executes. Think of it as the "new training run" dialog that got split out so the actual gradient work could live in a loop.
Why bother training at all? VoxCPM's zero-shot cloning is already good, but a LoRA makes a specific voice stick - the community reports faithful reproduction with a custom-trained LoRA. The official recipe from the README: 5–10 minutes of clean audio and roughly 2000 steps. That's a small dataset by image-LoRA standards, which makes this corner of the pack genuinely approachable.
The one input you must get right
train_manifest is a path to a JSONL file, and it's the difference between a working run and a confusing error. The repo ships an example at VoxCPM/examples/train_data_example.jsonl. Each line is a JSON object:
{"audio": "examples/example.wav", "text": "This is an example audio transcript for training."}
Four formats are supported - relative paths, absolute paths, and optional duration or dataset_id fields for filtering and multi-dataset runs. Two pieces of advice from the author: use absolute paths, and if you copy the path out of a text editor, strip the surrounding quotes. The node hard-errors with "Invalid train_manifest path" when the file doesn't exist, so that's the first check to clear. Windows backslashes are handled automatically, so don't sweat those.
The rest of the form
dit,vae,version- the same model selection as the VoxCPM_SM_Model loader. Pick the checkpoint you want to fine-tune from.sample_rate- 16000 or 44100. This is where the version difference bites: 1.5's VAE is 44.1 kHz, v2's is 16 kHz only. Match the model or training will be confused about what it's hearing.learning_rate(1e-4 default),weight_decay(0.01),warmup_steps(100),max_steps(2000) - the standard optimizer block, and the defaults are sane for VoxCPM. Change the LR before you touch anything else.batch_sizeandgrad_accum_steps- batch size stays small on modest VRAM; raisegrad_accum_stepsto grow the effective batch without growing memory.lora_rank(16–64, default 32),lora_alpha(8–64, default 16),lora_dropout- the LoRA shape. Note the cap: rank tops out at 64 in the widget, while some community experiments live at 128. If you want to go big, you'll be editing the config or settling for 64.enable_lm/enable_dit/enable_proj- which sub-networks carry the LoRA. The defaults (LM and DiT on, proj off) match the official recipe;enable_projadds the audio-projector layers, which is usually unnecessary.max_batch_tokens- a token-count filter for samples; 0 disables it, which is the fine default.
What comes out
Two string outputs: info (a status message) and config_path - the path to a generated training_config.json that Init wrote into ComfyUI/models/loras/finetune_lora_<timestamp>/. Wire config_path straight into the Loop node's config_path input. That's the entire contract between the pair: Init writes the plan, Loop executes it. The timestamped folder means repeated Init runs won't clobber earlier training.
Install
Same as the rest of the pack - clone https://github.com/smthemex/ComfyUI_VoxCPM_SM into ComfyUI/custom_nodes, pip install -r requirements.txt, restart. You need a VoxCPM checkpoint and VAE in place first (the Model node page has the file layout and the rename step). The dependency stack - torch>=2.5, torchaudio, transformers, funasr, modelscope, a datasets>=3,<4 pin - is heavy, and audio-in-ComfyUI is the corner where dependency conflicts are the default failure mode, so a clean venv is the honest answer if another pack starts throwing version errors.
One honest note the author makes himself: this training path is single-threaded and not performance-optimized - it exists so you don't have to open a separate webui. For a small voice LoRA it's perfectly fine; you'd outgrow it on serious dataset work.
Inputs (20)
| Name | Type | Default | Description |
|---|---|---|---|
| dit | COMBO | 1 options: none | |
| vae | COMBO | 1 options: none | |
| version | COMBO | 2 options: v2, v15 | |
| train_manifest | STRING | train_data_example.jsonl | — |
| sample_rate | COMBO | 2 options: 16000, 44100 | |
| batch_size | INT | 11–1024 | — |
| grad_accum_steps | INT | 11–1024 | — |
| log_interval | INT | 101–1000000 | — |
| valid_interval | INT | 100010–2147483647 | — |
| learning_rate | FLOAT | 0.00010–1 | — |
| weight_decay | FLOAT | 0.0100–1 | — |
| warmup_steps | INT | 1001–1000000 | — |
| max_steps | INT | 20001–1000000 | — |
| max_batch_tokens | INT | 00–2147483647 | — |
| lora_rank | INT | 3216–64 | — |
| lora_alpha | INT | 168–64 | — |
| lora_dropout | FLOAT | 00–1 | — |
| enable_lm | BOOLEAN | true | — |
| enable_dit | BOOLEAN | true | — |
| enable_proj | BOOLEAN | false | — |
Outputs (2)
| Name | Type | Description |
|---|---|---|
| info | STRING | — |
| config_path | STRING | — |