ayousanz/piper-plus-base
Piper Plus Base Model (Multilingual 6-Language) — MB-iSTFT-VITS2
6言語対応 TTS の事前学習済みベースモデルです。ファインチューニング用のチェックポイントとして提供しています。Decoder は MB-iSTFT (Multi-Band inverse STFT) + PQMF に統一済みで、HiFi-GAN ベースの旧モデルから置き換えられています。prosody_features (A1/A2/A3) に対応しています。
⚠️ Breaking change (2026-05): このモデルは MB-iSTFT-VITS2 アーキテクチャで再学習された新世代版です。旧 HiFi-GAN ベースの ckpt から `--resume_from_checkpoint` で本モデルにつなぐことは出来ません。逆に本モデルを base にした FT は piper-plus PR #320 以降の最新コードでのみ動作します。詳しくは piper-plus PR #320 / Issue #268。
Model Details
Features
MB-iSTFT-VITS2 Decoder
VITS の Decoder を Multi-Band iSTFT + PQMF に置き換えたバージョン。HiFi-GAN Generator を完全に廃止し、トータルの upsample 倍率 256x を維持しつつ Decoder の計算コストを大幅削減。
C++/Rust/C#/Go/WASM ランタイム側は 修正不要 で本モデルを使用できます (出力形状互換のため)。
6言語対応
MultilingualPhonemizer により、文内コードスイッチング(言語混合テキスト)に対応:
Prosody Features (A1/A2/A3)
OpenJTalk から抽出されるプロソディ特徴量をサポート:
拡張音素
- 疑問詞マーカー:
?!,?.,?~ - 文脈依存「ん」バリアント:
N_m,N_n,N_ng,N_uvular
Usage
シングル話者ファインチューニング (推奨)
# Step 1: データセット前処理
uv run python -m piper_train.preprocess \
--input-dir /path/to/your-ljspeech-data \
--output-dir /path/to/dataset \
--language ja \
--dataset-format ljspeech \
--sample-rate 22050 \
--single-speaker \
--phoneme-type multilingual
# Step 2: Prosody Features 追加 (日本語の場合、推奨)
uv run python add_prosody_features.py \
--input-dataset /path/to/dataset/dataset.jsonl \
--output-dir /path/to/dataset-prosody \
--workers 4
# Step 3: ファインチューニング
uv run python -m piper_train \
--dataset-dir /path/to/dataset-prosody \
--prosody-dim 16 \
--accelerator gpu \
--devices 1 \
--precision 32-true \
--max_epochs 500 \
--batch-size 4 \
--samples-per-speaker 4 \
--checkpoint-epochs 50 \
--base_lr 2e-5 \
--disable_auto_lr_scaling \
--ema-decay 0.9995 \
--max-phoneme-ids 400 \
--no-wavlm \
--resume-from-multispeaker-checkpoint /path/to/model.ckpt \
--default_root_dir /path/to/output--resume-from-multispeaker-checkpoint は以下を自動的に行います:
emb_g(話者埋め込み) の処理emb_langへの conditioning 分布補正--freeze-dpの自動有効化 (Duration Predictor の catastrophic forgetting 防止)
マルチ話者ファインチューニング
uv run python -m piper_train \
--dataset-dir /path/to/multi-speaker-dataset \
--prosody-dim 16 \
--accelerator gpu \
--devices 4 \
--precision 32-true \
--max_epochs 150 \
--batch-size 20 \
--samples-per-speaker 2 \
--base_lr 2e-4 \
--disable_auto_lr_scaling \
--ema-decay 0.9995 \
--max-phoneme-ids 400 \
--no-wavlm \
--resume_from_checkpoint /path/to/model.ckpt \
--default_root_dir /path/to/outputONNX Export
MB-iSTFT モデルでもエクスポート手順は変わりません (Decoder は ONNX 互換 iSTFT 経由で展開):
CUDA_VISIBLE_DEVICES="" uv run python -m piper_train.export_onnx \
/path/to/checkpoint.ckpt \
/path/to/output.onnxFP16 変換がデフォルト (モデルサイズ ~50% 削減)。FP32 が必要な場合は --no-fp16 を指定。
推論
CUDA_VISIBLE_DEVICES="" uv run python -m piper_train.infer_onnx \
--model /path/to/output.onnx \
--config /path/to/config.json \
--output-dir /path/to/output \
--text "こんにちは、今日は良い天気ですね。" \
--language ja-en-zh-es-fr-pt \
--speaker-id 0 --noise-scale 0.667Recommended Parameters
シングル話者ファインチューニング
emb_lang 後処理 (シングル話者 FT 後)
シングル話者ファインチューニング後、ONNX エクスポート前に emb_lang[0] を他の全言語スロットにコピーすることを推奨します (export_onnx が自動実行):
CUDA_VISIBLE_DEVICES="" uv run python -m piper_train.export_onnx \
--unify-emb-lang \
/path/to/checkpoint.ckpt \
/path/to/output.onnx--unify-emb-lang は num_speakers <= 1 and num_languages > 1 で自動有効化されるので通常は明示不要です。
Origin
このベースモデルは以下のデータから学習されました:
- アーキテクチャ: MB-iSTFT-VITS2 (Decoder: Multi-Band inverse STFT + PQMF, upsample (4,4) × 4 × 4 = 256x)
- 学習設定: 75 epoch, batch-size 20, 4 GPU (V100 16GB), prosody_dim=16
- gradient steps: ~282K
- 学習形態: スクラッチ学習 (HiFi-GAN ベースからの転移ではない)
emb_g(話者埋め込み) は除去済み、optimizer states は除去済み
Files
model.ckpt- PyTorch Lightning チェックポイント (EMA state 含む、emb_g/ optimizer 除去済み)config.json- モデル設定 (173 音素マップ、6 言語、prosody 設定、num_speakers=0)voice/mei_normal.htsvoice- OpenJTalk 日本語音素化用 voice ファイル
Citation
@software{piper_plus,
title = {Piper Plus: Multilingual TTS with VITS, Prosody Features, MB-iSTFT Decoder},
author = {ayousanz},
year = {2024},
url = {https://github.com/ayutaz/piper-plus}
}References
- MB-iSTFT-VITS: Kawamura et al., 2023
- VITS: Kim et al., 2021
- piper-plus PR #320 (本モデルのリリース): GitHub
