Skip to content

_check_xtts_builtin_speakers() calls non-existent _load_engine(), breaking all non-English XTTS voice conversion #1628

@telltaleatheist

Description

@telltaleatheist

In lib/classes/tts_engines/common/utils.py line 382, after the built-in voice conversion (eng → target language) completes and cleans up the internal model, the code attempts to reload the TTS
engine:

self.engine = loaded_tts.get(self.tts_key, False)
if not self.engine:
self._load_engine()

Two bugs:

  1. self._load_engine() does not exist. The correct method name is self.load_engine() (no underscore prefix). This raises AttributeError: 'XTTSv2' object has no attribute '_load_engine', which is
    silently caught by the except Exception at line 403.
  2. The return value is not assigned to self.engine, so even with the correct method name, the engine would remain None/False.

Fix:
self.engine = self.load_engine()

Impact: Every non-English language using XTTS with a built-in voice fails completely. The voice conversion succeeds and deletes the engine from loaded_tts to free memory, then fails to reload
it. self.engine stays False, and every subsequent convert() call fails with "TTS engine {engine} failed to load!".

English is unaffected because _check_xtts_builtin_speakers() short-circuits at line 270 when the language is eng, so the broken reload path is never reached.

Reproduction:

  • Use XTTS with a built-in English voice
  • Set target language to any non-English language (e.g., deu, spa)
  • Every sentence will fail with "TTS engine xtts failed to load!"

Worker log shows:
_check_xtts_builtin_speakers() error: 'XTTSv2' object has no attribute '_load_engine'
_set_voice() error: Could not create the builtin speaker selected voice in deu
TTS engine xtts failed to load!

Metadata

Metadata

Labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions