myshell-aiOpenVoiceV2
OpenVoice¶
Runs OpenVoice tone-color transfer from a source utterance to an authorized target-speaker recording.
Parameter metadata: Exact learned-parameter total for VoiceHub's audited native primary graph at the registered default selection; separately loaded auxiliary models are excluded.
Usage¶
Complete the VoiceHub installation once, then run this repository-authored example. Model pages intentionally contain no package-install command.
This example is maintained against VoiceHub's public API; it is not copied from an upstream demo or package README.
Model-specific path: Runs OpenVoice tone-color transfer from a source utterance to an authorized target-speaker recording.
Inputs and controls: base.wav must contain the utterance to convert; reference.wav supplies only the target tone color.
from pathlib import Path
from voicehub import AutoModelForTextToSpeech, TTSGenerationConfig
BASE_AUDIO = Path("base.wav")
REFERENCE_AUDIO = Path("reference.wav")
for audio_file in (BASE_AUDIO, REFERENCE_AUDIO):
if not audio_file.is_file():
raise FileNotFoundError(audio_file)
model = AutoModelForTextToSpeech.from_pretrained(
'myshell-ai/OpenVoiceV2',
model_type='openvoice',
device="cuda",
lazy_load=True,
)
output = model.generate(
'VoiceHub keeps model integrations explicit and reproducible.',
generation_config=TTSGenerationConfig(
seed=42,
output_file=Path("output.wav"),
),
base_audio=str(BASE_AUDIO),
speaker_audio_path=str(REFERENCE_AUDIO),
tau=0.3,
)
print(output.file_path, output.sample_rate, output.metadata)
Use authorized recordings. Verify hardware needs and pin a revision in production.
Overview¶
openvoice is a VoiceHub text to speech
integration. This page is generated from its registry contract. Open the openvoice Colab notebook.
| Property | Value |
|---|---|
| Task | Text to speech |
| Architecture | openvoice-v2-converter |
| Runtime | VoiceHub-native |
| Languages | en, es, fr, zh, ja, ko |
| Capabilities | text-to-speech, voice-cloning, multilingual, fine-tuning, safetensors, voicehub-native, native-runtime, paired-waveform-training, explicit-base-waveform |
| Reusable components | wavmark |
| Normalized output | TTSOutput |
Language support¶
Supported language abbreviations
en, es, fr, zh, ja, ko
Paper and GitHub¶
- Paper: OpenVoice: Versatile Instant Voice Cloning
- Upstream GitHub: OpenVoice
- VoiceHub source: VoiceHub model implementation
Configuration¶
Load configuration without constructing the model:
| Property | Value |
|---|---|
| Canonical model type | openvoice |
| Configuration class | OpenVoiceConfig |
| Architecture class | OpenVoiceForTextToSpeech |
Processing¶
Create the registered processor without allocating model weights:
from voicehub import AutoProcessor
processor = AutoProcessor.from_pretrained(
'myshell-ai/OpenVoiceV2',
model_type='openvoice',
)
print(type(processor).__name__)
Inference¶
The Usage example returns TTSOutput through AutoModelForTextToSpeech.
Input and output contract¶
| Property | Value |
|---|---|
| Readiness | integrated-raw |
| Data architecture | vits |
| Sample rate | 22,050 Hz |
| Contract getter | get_tts_dataset_spec('openvoice') |
| Variant | Required fields | One of | Boundary | Other rules |
|---|---|---|---|---|
paired-waveforms |
source_audio, target_audio |
— | Source | — |
paired-waveform-aliases |
audio, target_waveform |
— | Source | — |
VITS/GAN text, waveform, spectrogram, and adversarial data. See the data workflow.
Training and optimization¶
Use available_optimization_passes() to discover reversible public passes.
Unsupported runtime or hardware fails closed before mutation.
Training contract¶
| Property | Value |
|---|---|
| Support | custom |
| Family | vits |
| Recipe | single-phase |
| Default phase | generator |
| Training checkpoint | myshell-ai/OpenVoiceV2 |
| Native training graph | yes |
| Phase | Kind | Components | Required inputs | Loss keys |
|---|---|---|---|---|
generator |
generator | model.enc_q, model.flow, model.dec, model.ref_enc |
source_spectrogram, source_lengths, target_waveform, target_lengths |
loss |
This profile uses model-specific phases; inspect and honor each phase boundary. Call model.validate_training_support() first, then follow the
training workflow.
Checkpoints, provenance, license, and limitations¶
| Property | Value |
|---|---|
| Default checkpoint | myshell-ai/OpenVoiceV2 |
| Hugging Face ID | myshell-ai/OpenVoiceV2Repository availability verified through the Hugging Face model API on 2026-08-11; pin a revision before production use. |
| Checkpoint status | Registry default; pin an immutable revision for production and reproducible evidence |
| Optional dependency extra | Core package |
| Hardware and runtime | Usage selects cuda; verify checkpoint-specific requirements |
| Real-checkpoint evidence | Release evidence; a registry default alone is not execution evidence |
| Implementation | voicehub.models.openvoice.modeling_openvoice.OpenVoiceForTextToSpeech |
| Configuration | voicehub.models.openvoice.configuration_openvoice.OpenVoiceConfig |
| Source provenance | voicehub/models/openvoice/source/SOURCE.json |
| License | Checkpoint-specific |
No VoiceHub-specific license override is registered. Verify the checkpoint and upstream source terms before use.
Confirm the checkpoint revision, access terms, provenance, and license.
Limitations¶
- No integration-specific checkpoint limitation is registered. Verify the selected checkpoint revision and its documented runtime requirements.
- Validate memory, precision, and optional dependencies on the target system.
- Public optimizations fail closed when the runtime or hardware cannot satisfy their validation contract; an unavailable pass is not reported as applied.
- Contract tests do not replace the linked released-checkpoint evidence.
Public API¶
Use the stable configuration, processor, and task-model facades below.
Configuration
OpenVoiceConfig¶
Parameters¶
**config_kwargs— Configuration fields validated by OpenVoiceConfig.
Model
OpenVoiceForTextToSpeech¶
Parameters¶
pretrained_model_name_or_path— Hub ID or compatible local directory.model_type— Canonical model type; use 'openvoice'.config— Optional preloaded OpenVoiceConfig instance.**model_kwargs— Model-specific loading arguments.
from voicehub import get_model_spec
spec = get_model_spec('openvoice')
print(spec.display_name, spec.task.value)
| Purpose | Public object |
|---|---|
| Discover | get_model_spec('openvoice') |
| Load and run | AutoModelForTextToSpeech |
| Configure | OpenVoiceConfig |
| Process | AutoProcessor |
| Model implementation | OpenVoiceForTextToSpeech |
| Normalized output | TTSOutput |
| Training contract | get_training_spec('openvoice') |
| Optimization lifecycle | available_optimization_passes, apply_optimization_plan, optimization_manifest, restore_optimization_plan |
See all model guides, inference, and the training matrix.