Skip to content

feat: add German (de) language support#317

Open
semidark wants to merge 2 commits into
hexgrad:mainfrom
semidark:main
Open

feat: add German (de) language support#317
semidark wants to merge 2 commits into
hexgrad:mainfrom
semidark:main

Conversation

@semidark
Copy link
Copy Markdown

@semidark semidark commented Apr 17, 2026

Summary

Register German as a supported language in Kokoro's pipeline, CLI, and kokoro.js voice list.

Changes

  • Add 'de': 'd' to ALIASES and d='de' to LANG_CODES in pipeline.py
  • Add a dedicated elif lang_code == 'd': branch that uses misaki.de.DEG2P() instead of the generic espeak fallback
  • Add "d" (German) to the CLI language choices in __main__.py
  • Add commented-out German voice stubs (df_anna, dm_daniel) to kokoro.js/src/voices.js

German follows the same dedicated-G2P pattern as Japanese (JAG2P) and Chinese (ZHG2P).

See also:

Usage

This PR enables lang_code='d' / lang_code='de' in upstream Kokoro's pipeline and CLI.

pipeline = KPipeline(lang_code='d', repo_id='...')
# or equivalently:
pipeline = KPipeline(lang_code='de', repo_id='...')

German synthesis depends on a compatible German-trained model family and matching voice assets.

Context: Training Recipe and German Model Work

This PR comes out of kokoro-deutsch, a community project that reverse-engineered a working Kokoro fine-tuning pipeline using a patched StyleTTS2. The repo contains:

  • End-to-end training recipe (dataset prep -> Stage 1 -> Stage 2 -> voicepack extraction)
  • Patched StyleTTS2 submodule with critical fixes for stable Stage 2 training
  • A forked misaki with German text normalization (misaki.de.DEG2P)
  • Full documentation (training guide, troubleshooting, architecture notes)

A German multi-speaker base model has been published by the community:

Important technical note: German voicepacks extracted from this work are tied to the German-trained model family, not to upstream hexgrad/Kokoro-82M. Because of that, this PR is intentionally limited to upstream language enablement, while the trained German model assets currently live in the external community project.

Timeline

  • April 10: Published kokoro-deutsch
  • April 10-14: Fixed critical Stage 2 bugs
  • April 11: Community contributors began training runs
  • April 14: Published the initial fork commit adding German language code support
  • April 17: Added dedicated German text normalization via misaki.de.DEG2P and opened upstream misaki PR Docker compose error #97

Relates to #290

@semidark
Copy link
Copy Markdown
Author

/claim #290

@semidark
Copy link
Copy Markdown
Author

Status update: Voice .pt files are in progress. We have a trained multi-speaker base model and are currently extracting and validating individual voicepacks. I'll update this PR with at least one German voice file (following the d{f,m}_name naming convention) once quality validation is complete.

Happy to adjust the implementation based on any feedback in the meantime.

@semidark
Copy link
Copy Markdown
Author

Small technical clarification after reviewing model compatibility more carefully:

the German-trained assets coming out of kokoro-deutsch are tied to the German-trained checkpoint family, not automatically to upstream hexgrad/Kokoro-82M. So standalone German voice .pt files are not enough by themselves unless paired with a compatible German-trained model.

Because of that, this PR is intentionally scoped to upstream language enablement and related plumbing:

  • register d / de
  • remove the stale espeak chunking warning
  • add German voice stubs on the JS side

The trained German model work continues in the external community project:
https://github.com/semidark/kokoro-deutsch

If upstream wants German support wired in at the code level first, this PR keeps that change minimal and technically accurate.

Register German as a supported language:
- Add 'de': 'd' to ALIASES in pipeline.py
- Add d='de' to LANG_CODES (espeak-ng section) in pipeline.py
- Add 'd' (German) to CLI language choices in __main__.py
- Add commented-out German voice stubs (df_anna, dm_daniel) to
  kokoro.js/src/voices.js

German uses the existing espeak.EspeakG2P fallback path. No new files,
no new dependencies.
@semidark
Copy link
Copy Markdown
Author

Split out the stale chunking warning fix into its own PR (#318) since it's an independent bugfix that benefits all espeak-ng languages. This PR now contains only the German language registration and kokoro.js voice stubs.

German now uses misaki.de.DEG2P which normalizes text (numbers, dates,
times, currency, abbreviations) before phonemization via espeak-ng.
This matches how Japanese and Chinese use dedicated G2P modules.

Requires: pip install misaki[de]
@semidark
Copy link
Copy Markdown
Author

Update: German is now wired through a dedicated misaki.de.DEG2P() path instead of the generic EspeakG2P(language='de') fallback.

This matches the architecture used for Japanese (JAG2P) and Chinese (ZHG2P):

  • dedicated G2P module in misaki
  • language branch in KPipeline
  • normalization before phonemization

Upstream misaki PR for the German module is here:
hexgrad/misaki#97

That PR adds German text normalization for numbers, dates, times, currency, and abbreviations before espeak-ng phonemization.

@TheMasterOfDisasters
Copy link
Copy Markdown

@semidark
Hi, I started wiring experimental German support into our KokoroTTS Docker/UI/API fork and wanted to test the Eva-K assets mentioned here.

I was able to find references to dida-80b/kokoro-deutsch-eva-k, and at one point the model page appeared visible, but programmatic access now seems unavailable:

  • https://huggingface.co/api/models/dida-80b/kokoro-deutsch-eva-k returns {"error":"Invalid username or password."}
  • direct file access to eva_k.pt returns 401 Unauthorized
  • searching models for dida-80b + kokoro returns no model results
  • I only see the public dataset dida-80b/hui-german-51speakers-synthetic

I would like to test and possibly integrate the German voice path, but without a publicly downloadable Kokoro-compatible model/voicepack I cannot really validate it.

Is dida-80b/kokoro-deutsch-eva-k intentionally private now, renamed, or temporarily unavailable? If there is a new public repo or asset location for kokoro_german_converted.pth and eva_k.pt, I would be happy to try it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants