Batman English TTS (Qwen3-TTS Custom Voice)
This is a fine-tuned Custom Voice model for Qwen3-TTS, trained to sound like Batman. It uses the neural speech codec approach (12Hz) to generate highly expressive, high-fidelity speech.
Usage
1. Installation
First, ensure you have the qwen_tts package installed (or clone the Qwen3-TTS repository):
pip install qwen-tts torch soundfile
2. Python Inference Code
You can generate Batman's voice in just a few lines of code. Make sure to set speaker="batman" exactly as shown below:
import soundfile as sf
import torch
from qwen_tts import Qwen3TTSModel
# 1. Load the fine-tuned model
print("Loading model...")
model = Qwen3TTSModel.from_pretrained(
"Karthikappi0011/batman-english-qwen3-tts",
device_map="cuda", # Change to "cpu" or "mps" if on Mac
torch_dtype=torch.bfloat16,
attn_implementation="sdpa", # Or "flash_attention_2" if supported
)
# 2. Provide the text
text = "I am vengeance. I am the night. I am Batman. The city needs me, and I will not fail."
# 3. Generate the audio
print("Generating audio...")
wavs, sr = model.generate_custom_voice(
text=text,
speaker="batman", # Must be "batman" to trigger the custom voice embedding
language="English", # Or "Auto"
)
# 4. Save to disk
output_path = "batman_output.wav"
sf.write(output_path, wavs[0], sr)
print(f"Saved generated speech to {output_path}")
Model Details
- Base Model: Qwen/Qwen3-TTS-12Hz-1.7B-Base
- Speaker Label:
batman - Language: English
- Architecture: Causal Transformer (Talker) + Neural Speech Codec (12Hz)
- Downloads last month
- 8