Files
filliptmandClaude Opus 4.6 60f6897263 Initial implementation of Voxtral-4B TTS direct inference for ComfyUI
Custom node pack implementing Mistral's Voxtral-4B-TTS-2603 model with
direct PyTorch inference (no vLLM dependency), enabling native MPS/Mac
support alongside CUDA.

Three-component architecture:
- Mistral LLM backbone (26 layers, 3072 dim, GQA, RoPE)
- Flow-matching acoustic transformer (3 layers, 8-step Euler ODE, CFG)
- Neural audio codec decoder (4-stage ALiBi transformer + conv upsampling)

Features:
- 20 preset voices across 9 languages
- 24 kHz mono output
- BF16/FP16/FP32 dtype support
- HuggingFace Hub auto-download with caching
- ComfyUI AUDIO output format

Nodes:
- FL_VoxtralTTS_ModelLoader: download and load model
- FL_VoxtralTTS_Generate: text + voice → audio

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-26 20:09:20 -05:00

46 lines
788 B
Python

MODEL_REPO_ID = "mistralai/Voxtral-4B-TTS-2603"
VOICES = [
"casual_female",
"casual_male",
"cheerful_female",
"neutral_female",
"neutral_male",
"fr_female",
"fr_male",
"es_female",
"es_male",
"de_female",
"de_male",
"it_female",
"it_male",
"pt_female",
"pt_male",
"nl_female",
"nl_male",
"ar_male",
"hi_female",
"hi_male",
]
LANGUAGES = [
"English",
"French",
"Spanish",
"German",
"Italian",
"Portuguese",
"Dutch",
"Arabic",
"Hindi",
]
# Device detection
def get_default_device():
import torch
if torch.cuda.is_available():
return "cuda"
if hasattr(torch.backends, "mps") and torch.backends.mps.is_available():
return "mps"
return "cpu"