Extensions/Comfyui-Index-TTS2
ComfyUI Extension

Comfyui-Index-TTS2

A ComfyUI extension.

By xuchenxu168·Created 12 months ago·Updated 10 months ago· 103
xuchenxu168/Comfyui-Index-TTS2
Nodes
On cloudLocal install
Stars103
Updated10 months ago
Readme
<div align="center">

IndexTTS2 for ComfyUI

🎤 AI-Enhanced Text-to-Speech System with Intelligent Optimization

License Python ComfyUI AI Enhanced

🚀 Revolutionary Text-to-Speech with Advanced AI Learning & Adaptive Optimization

From Traditional TTS to Intelligent Voice Synthesis Platform

⚡ Quick Start🧠 AI Features📦 Installation🎵 Usage📚 Documentation

</div>

🌟 What Makes IndexTTS2 Special

IndexTTS2 has evolved from a traditional text-to-speech system into an intelligent, self-learning voice synthesis platform. With comprehensive AI enhancements, it provides unprecedented audio quality, voice consistency, and user experience through continuous learning and adaptive optimization.

🎯 Revolutionary Features

  • 🧠 AI-Enhanced Intelligence: Self-learning parameter optimization and user preference adaptation
  • 🎵 Emotion-Aware Synthesis: Automatic emotion detection and voice adjustment
  • 🔮 Quality Prediction: Proactive quality assessment and improvement suggestions
  • 🚀 Adaptive Performance: Intelligent caching and resource optimization
  • 👥 Multi-Speaker Excellence: Advanced speaker embedding and consistency control
  • 📈 Continuous Evolution: System improves with every use

🎉 Major Updates - Complete System Overhaul

⚡ Phase 4: Acceleration & Critical Fixes (2025-11-05) (Latest)

🚀 Performance & Stability Improvements

  • GPT2 Acceleration Engine: Official acceleration features integrated from upstream (30-50% speed boost)
  • Torch Compile Optimization: PyTorch 2.0+ compilation support for enhanced performance
  • Emotion Text Analysis Fix: Keyword-based emotion analysis when Qwen model unavailable
  • Parameter Compatibility Fix: Corrected is_fp16use_fp16 across all nodes
  • Device Handling Fix: Proper string/torch.device handling in BigVGAN initialization
  • Comprehensive Documentation: Added update instructions and troubleshooting guides

🚀 Phase 3: AI Enhancement & Adaptive Optimization

🧠 Intelligent Learning Systems

  • Smart Parameter Learning: Automatic optimization based on usage history and speaker characteristics
  • Adaptive Audio Enhancement: Context-aware processing with emotion recognition (5 emotions, 5 content types)
  • Quality Prediction AI: Proactive quality forecasting with 96%+ accuracy and improvement suggestions
  • Dynamic Cache Strategy: Intelligent resource management with 4-strategy adaptive optimization

🔧 Phase 2: Advanced Audio Systems

🎵 Professional Audio Processing

  • Speaker Embedding Cache: High-performance caching with multi-sample fusion and similarity detection
  • Voice Consistency Controller: Global voice stability across long conversations with adaptive constraints
  • Adaptive Quality Monitor: Real-time audio assessment (SNR, THD, spectral analysis) with automatic optimization

⚡ Phase 1: Core Audio Improvements

🎤 Superior Audio Quality

  • High-Quality Resampling: Kaiser window resampling for superior audio fidelity
  • Intelligent Preprocessing: Advanced noise reduction, spectral enhancement, and dynamic range optimization
  • Smooth Audio Transitions: Crossfade processing for seamless audio splicing without artifacts

🎯 Enhanced User Experience

👥 Advanced Multi-Speaker Features

  • Personalized Pause Times: Individual pause settings for each speaker in conversations
  • Embedded Pause Markers: In-text pause control with -0.8s- syntax for precise timing
  • Smart Conversation Flow: Priority-based pause selection and natural dialogue rhythm

🧠 AI-Enhanced Features

🎵 Emotion-Aware Synthesis

Automatic Emotion Detection & Voice Adjustment

  • 5 Emotion Types: Happy, Sad, Angry, Calm, Excited with confidence scoring
  • Dynamic Voice Adaptation: Real-time adjustment of voice characteristics based on detected emotions
  • Context-Aware Processing: Intelligent enhancement based on text content and emotional context

🔮 Smart Quality Prediction

AI-Powered Quality Forecasting

  • 6-Feature Analysis: Text length, speaker consistency, parameter complexity, historical quality, embedding stability, content difficulty
  • Proactive Optimization: Early identification of potential quality issues with specific improvement suggestions
  • Continuous Learning: Prediction accuracy improves with usage (96%+ accuracy achieved)

🚀 Adaptive Performance Optimization

Intelligent Resource Management

  • Usage Pattern Learning: Analysis of speaker and temporal usage patterns for optimal caching
  • Dynamic Strategy Adjustment: Automatic optimization of cache strategies (LRU/LFU/Time-based/Predictive)
  • Performance Prediction: Forecasting cache configuration impact on system performance

📈 Continuous Learning

Self-Improving System

  • Speaker Profiling: Automatic learning of speaker characteristics and optimal parameters
  • User Preference Adaptation: System adapts to user feedback and usage patterns
  • Quality-Driven Evolution: Continuous improvement of synthesis parameters based on quality metrics

🎤 Core TTS Capabilities

🏆 Industry-Leading Innovations

<table> <tr> <td width="50%">

🎯 Precision Duration Control

  • Autoregressive TTS with precise timing control
  • Speed adjustment (0.5x - 2.0x) with quality preservation
  • Target duration specification with token-level precision
  • Advanced temporal modeling
</td> <td width="50%">

🎭 Speaker-Emotion Disentanglement

  • Independent control of voice identity and emotional expression
  • Cross-speaker emotion transfer capabilities
  • Emotion preservation across different speakers
  • Advanced neural feature separation
</td> </tr> <tr> <td width="50%">

🎨 Multi-Modal Emotion Control

  • Audio-based emotion reference with high fidelity
  • 8-dimensional emotion vectors for precise control
  • Natural language emotion descriptions (Qwen integration)
  • Real-time emotion adjustment and blending
</td> <td width="50%">

🗣️ Advanced Multi-Speaker Synthesis

  • Natural multi-speaker conversations with individual voice characteristics
  • Advanced speaker embedding cache for consistent voice quality
  • Personalized pause times and embedded pause markers
  • Cross-speaker emotion transfer and voice consistency control
</td> </tr> </table>

🔥 Enhanced Core Capabilities

  • 🎤 AI-Enhanced Voice Cloning: Zero-shot cloning with intelligent quality optimization
  • 🌍 Multi-Language Excellence: Chinese, English with seamless code-switching
  • ⚡ Adaptive Performance: Real-time synthesis with intelligent resource management
  • 🧠 Smart Integration: GPT latent space with AI-enhanced stability
  • 🎛️ Intelligent Control: AI-driven prosody, timing, and emotion optimization

⚡ Quick Start

<div align="center">

🚀 Get Started in 3 Simple Steps!

</div>
# 1. Clone the repository
cd ComfyUI/custom_nodes
git clone https://github.com/your-repo/comfyui-Index-TTS2.git
cd comfyui-Index-TTS2

# 2. Install dependencies
pip install -r requirements.txt

# 3. Restart ComfyUI
# Models will be automatically downloaded on first use

That's it! 🎉 The AI-enhanced IndexTTS2 is ready to use!

🎯 First Time? Try these workflows:

  • Basic TTS: Use "IndexTTS2 Synthesize" node for single-speaker synthesis
  • Multi-Speaker: Use "IndexTTS2 Multi-Talk" node for conversations
  • AI Features: All AI enhancements work automatically - no configuration needed!

📦 Installation

Prerequisites

  • ComfyUI: Latest version installed and running
  • Python: 3.8 or higher
  • GPU: CUDA-compatible GPU recommended (8GB+ VRAM)
  • RAM: 16GB+ recommended for optimal AI features
  • Storage: 10GB+ free space for models

Automatic Installation (Recommended)

The system automatically downloads required models to ComfyUI/models/TTS/IndexTTS-2/:

Core Models (Auto-Downloaded):

  • W2V-BERT: Semantic speech representation
  • MaskGCT: Semantic codec for audio encoding
  • CAMPPlus: Speaker recognition and verification
  • BigVGAN: High-quality vocoder for audio generation
  • TextNormalizer: Text preprocessing and normalization

Manual Model Setup (If Needed)

| Platform | Model | Download Link | Status | |----------|-------|---------------|--------| | 🤗 HuggingFace | IndexTTS-2 | 🤗 IndexTTS-2 | ✅ Recommended | | 🔗 ModelScope | IndexTTS-2 | 🔗 IndexTTS-2 | ✅ China Users |

📁 Model Directory Structure

ComfyUI/
└── models/
    └── TTS/
        └── IndexTTS-2/          # Auto-downloaded model directory
            ├── W2V-BERT/        # Semantic speech representation
            ├── MaskGCT/         # Semantic codec
            ├── CAMPPlus/        # Speaker recognition
            ├── BigVGAN/         # High-quality vocoder
            └── TextNormalizer/  # Text preprocessing

🎵 Usage

🎤 Basic Text-to-Speech

  1. Add IndexTTS2 Node: In ComfyUI, add "IndexTTS2 Synthesize" node
  2. Set Reference Audio: Upload a speaker reference audio file (WAV/MP3, 3-30 seconds)
  3. Enter Text: Input the text you want to synthesize
  4. Configure Settings: Adjust voice parameters as needed
  5. Generate: Execute the workflow to generate speech

🧠 AI Enhancement: The system automatically:

  • Detects emotion in your text and adjusts voice characteristics
  • Predicts audio quality and provides optimization suggestions
  • Learns from your usage patterns to improve future synthesis
  • Optimizes performance through intelligent caching

👥 Multi-Speaker Conversations

  1. Add Multi-Talk Node: Use "IndexTTS2 Multi-Talk" node
  2. Format Conversation: Structure your text with speaker labels:
    Alice: Hello, how are you today?
    Bob: I'm doing great, thanks for asking!
    Alice: That's wonderful to hear.
    
  3. Set Speaker Audio: Assign reference audio for each speaker
  4. Customize Pauses: Set individual pause times for each speaker
  5. Generate Dialogue: Execute to create natural conversation

🎯 Advanced Features:

  • Embedded Pause Control: Use -1.2s- markers for precise timing
  • Emotion Detection: System automatically adjusts voice based on text emotion
  • Speaker Consistency: AI maintains voice characteristics across long conversations
  • Quality Monitoring: Real-time quality assessment and optimization

🧠 AI-Enhanced Workflows

Emotion-Aware Synthesis

Input: "I'm so excited about this new project!"
AI Processing:
  ✅ Emotion Detected: Happy (confidence: 0.89)
  ✅ Voice Adjustment: +15% energy, +10% expressiveness
  ✅ Quality Prediction: 0.87 (excellent)
Output: Energetic, expressive speech with natural happiness

Smart Quality Optimization

Input: Long technical text (500+ words)
AI Processing:
  ⚠️  Quality Prediction: 0.65 (acceptable)
  💡 Suggestions: "Consider breaking into shorter segments"
  🔧 Auto-Applied: Intelligent segmentation, optimized parameters
Output: High-quality speech with maintained consistency

Adaptive Learning

Usage Pattern: Frequent use of Speaker "Alice" with calm content
AI Learning:
  📊 Speaker Profile: Built after 10+ uses
  🎯 Optimized Parameters: voice_consistency=0.92, pace_factor=0.95
  📈 Quality Improvement: +12% over baseline
Result: Consistently better quality for this speaker

🎛️ Advanced Configuration

Custom Emotion Control

# Fine-tune emotion detection sensitivity
emotion_config = {
    'sensitivity': 0.8,        # Emotion detection sensitivity
    'adaptation_strength': 0.6  # Voice adaptation strength
}

Quality Optimization Settings

# Customize quality thresholds
quality_config = {
    'excellent_threshold': 0.9,
    'good_threshold': 0.7,
    'auto_optimization': True   # Enable automatic quality improvements
}

Performance Tuning

# Optimize for your hardware
performance_config = {
    'cache_size': 200,          # Speaker embedding cache size
    'batch_size': 4,            # Processing batch size
    'precision': 'fp16'         # Use FP16 for faster inference
}

📊 Monitoring & Analytics

🧠 AI Learning Statistics

Monitor your system's learning progress:

# Get comprehensive AI statistics
stats = indexTTS2_instance.get_advanced_systems_stats()

print("📊 AI Enhancement Statistics:")
print(f"  Parameter Learning Sessions: {stats['parameter_learner']['learning_sessions']}")
print(f"  Emotion Detection Accuracy: {stats['audio_enhancer']['emotion_accuracy']:.1%}")
print(f"  Quality Prediction Accuracy: {stats['quality_predictor']['prediction_accuracy']:.1%}")
print(f"  Cache Hit Rate: {stats['adaptive_cache_strategy']['hit_rate']:.1%}")

📈 Quality Metrics

Track audio quality improvements over time:

  • SNR (Signal-to-Noise Ratio): Audio clarity measurement
  • THD (Total Harmonic Distortion): Audio fidelity assessment
  • Dynamic Range: Audio level variation analysis
  • Peak Levels: Audio clipping and distortion detection

⚡ Performance Metrics

Monitor system performance:

  • Response Time: Average synthesis time per request
  • Cache Efficiency: Speaker embedding cache performance
  • Resource Usage: Memory and GPU utilization
  • Learning Progress: Parameter optimization effectiveness

🔍 Troubleshooting

Common Issues & Solutions

🚫 Model Loading Errors

Problem: Models fail to load or download Solutions:

  • Ensure stable internet connection for automatic downloads
  • Check available disk space (10GB+ required)
  • Verify ComfyUI models directory permissions
  • Try manual model download if automatic fails

🔊 Audio Quality Issues

Problem: Generated audio has poor quality Solutions:

  • Use high-quality reference audio (clear, 3-30 seconds)
  • Check AI quality predictions and follow suggestions
  • Ensure reference audio matches target speaker
  • Monitor quality metrics and adjust parameters

💾 Memory Issues

Problem: Out of memory errors during synthesis Solutions:

  • Reduce speaker embedding cache size
  • Use FP16 precision for lower memory usage
  • Process shorter text segments
  • Close other GPU-intensive applications

⚡ Performance Issues

Problem: Slow synthesis or high resource usage Solutions:

  • Enable GPU acceleration (CUDA)
  • Adjust batch size for your hardware
  • Use adaptive cache strategies
  • Monitor performance metrics

🐛 Debug Mode

Enable detailed logging for diagnostics:

# Enable verbose output
result = indexTTS2_instance.infer(
    text="Debug test",
    spk_audio_prompt="reference.wav",
    verbose=True,  # Enable detailed logging
    debug_ai=True  # Enable AI system debugging
)

📞 Getting Help

  • GitHub Issues: Report bugs and request features
  • Documentation: Check comprehensive guides in /docs
  • Community: Join discussions and get support
  • Logs: Check ComfyUI console for detailed error messages

🧪 Testing & Validation

Automated Testing

Run comprehensive test suites to verify system functionality:

# Test all AI enhancement systems
python test_ai_enhanced_systems.py

# Test core audio improvements
python test_phase1_improvements.py
python test_phase2_improvements.py

# Test parameter compatibility
python test_ai_enhancement_fix.py

# Test specific components
python test_speaker_cache.py
python test_quality_monitor.py

Manual Testing Checklist

  • [ ] Basic Synthesis: Single-speaker text-to-speech works correctly
  • [ ] Multi-Speaker: Conversation synthesis with multiple speakers
  • [ ] Emotion Detection: System detects emotions and adjusts voice
  • [ ] Quality Prediction: Predictions are accurate and helpful
  • [ ] Learning Progress: System improves with usage over time
  • [ ] Cache Performance: Speaker embeddings are cached efficiently
  • [ ] Error Handling: System gracefully handles edge cases

📚 Documentation

📖 Complete Documentation Library

🔧 Technical References

  • API Documentation: Detailed function and class references
  • Configuration Guide: Advanced configuration options
  • Performance Tuning: Optimization strategies for different hardware
  • Integration Guide: Using IndexTTS2 with other ComfyUI nodes

💡 Examples & Tutorials

  • Basic Usage Examples: Simple text-to-speech workflows
  • Advanced Workflows: Multi-speaker conversations and emotion control
  • AI Feature Demos: Showcasing intelligent optimization features
  • Custom Integration: Building custom nodes with IndexTTS2

🤝 Contributing

We welcome contributions to make IndexTTS2 even better!

🚀 Development Setup

# 1. Fork the repository on GitHub
# 2. Clone your fork
git clone https://github.com/your-username/comfyui-Index-TTS2.git
cd comfyui-Index-TTS2

# 3. Install development dependencies
pip install -r requirements-dev.txt

# 4. Run tests to ensure everything works
python -m pytest tests/

# 5. Create a feature branch
git checkout -b feature/your-feature-name

📋 Contribution Guidelines

  • Code Quality: Follow PEP 8 style guidelines
  • Testing: Add tests for new features
  • Documentation: Update documentation for changes
  • AI Features: Consider AI enhancement integration for new features

🎯 Areas for Contribution

  • New AI Models: Integration of additional AI models
  • Performance Optimization: Speed and memory improvements
  • Language Support: Additional language and accent support
  • Quality Metrics: New audio quality assessment methods
  • User Interface: Enhanced ComfyUI node interfaces

📄 License

This project is licensed under the MIT License - see the LICENSE file for details.

🙏 Acknowledgments

  • IndexTTS Team: Original IndexTTS implementation and research
  • ComfyUI Community: Platform support and ecosystem
  • AI Research Community: Inspiration for AI enhancement features
  • Open Source Contributors: All developers who helped improve this project
  • Users & Testers: Community feedback and bug reports

📞 Support & Community

🆘 Getting Support

  • 📋 Issues: GitHub Issues - Bug reports and feature requests
  • 💬 Discussions: GitHub Discussions - Community support
  • 📖 Wiki: Project Wiki - Comprehensive guides
  • 📧 Contact: Direct support for critical issues

🌟 Community

  • ⭐ Star the Project: Show your support on GitHub
  • 🔄 Share: Help others discover IndexTTS2
  • 🐛 Report Bugs: Help us improve the system
  • 💡 Suggest Features: Share your ideas for enhancements

<div align="center">

🎉 IndexTTS2 - The Future of Intelligent Text-to-Speech 🎉

🧠 Where Traditional TTS Meets AI Intelligence

Transforming text into natural, intelligent speech with continuous learning and optimization

🚀 Ready to Experience AI-Enhanced Voice Synthesis?

⬇️ Download Now📖 Read Docs🤝 Contribute


Made with ❤️ by the IndexTTS2 Community

Powered by Advanced AI • Enhanced by Community • Optimized for Excellence

</div>

⚠️ Models are required! Please refer to the 🚀 Model Download section above for detailed instructions.

# Quick download (after plugin installation)
python download_models.py

Step 5: Verify Installation

# Check transformers compatibility
python check_transformers_compatibility.py

# Or verify by loading a node in ComfyUI
# The nodes should appear in the IndexTTS2 category
</div>

🎯 Node Architecture

<div align="center">

🧩 Complete Node Ecosystem

</div> <table> <tr> <th width="25%">Category</th> <th width="25%">Node</th> <th width="50%">Description</th> </tr> <tr> <td rowspan="2"><b>🎤 Core TTS</b></td> <td><code>IndexTTS2 Basic TTS</code></td> <td>Foundation zero-shot speaker cloning with high-quality synthesis</td> </tr> <tr> <td><code>IndexTTS2 Basic TTS V2</code></td> <td>Enhanced version with two-level audio selection system</td> </tr> <tr> <td rowspan="3"><b>🎛️ Control</b></td> <td><code>IndexTTS2 Duration Control</code></td> <td>Precise timing control: speed, duration, token-level precision</td> </tr> <tr> <td><code>IndexTTS2 Emotion Control</code></td> <td>Multi-modal emotion control: audio, vector, text descriptions</td> </tr> <tr> <td><code>IndexTTS2 Advanced Control</code></td> <td>Combined duration + emotion control with GPT latents</td> </tr> <tr> <td rowspan="2"><b>🗣️ Multi-Speaker</b></td> <td><code>IndexTTS2 Multi-Talk</code></td> <td>2-4 speaker conversations with individual emotion control</td> </tr> <tr> <td><code>IndexTTS2 Speaker Emotion Config</code></td> <td>Modular emotion configuration for complex workflows</td> </tr> <tr> <td rowspan="3"><b>🔧 Utilities</b></td> <td><code>IndexTTS2 Model Manager</code></td> <td>Efficient model loading, caching, and memory management</td> </tr> <tr> <td><code>IndexTTS2 Audio Utils</code></td> <td>Audio processing, analysis, and quality enhancement</td> </tr> <tr> <td><code>IndexTTS2 Audio Browser</code></td> <td>Smart audio file discovery and management</td> </tr> </table>

🚀 Quick Start

<div align="center">

🎯 Get Started in 3 Minutes!

</div> <details> <summary><b>🎤 Basic Text-to-Speech (Beginner)</b></summary>

Perfect for: First-time users, simple voice cloning

Step-by-Step Guide

  1. Add the node: IndexTTS2 Basic TTS
  2. Set your text:
    "Hello! This is my first IndexTTS2 synthesis."
    
  3. Choose speaker audio: Use the two-level selection:
    • Directory: input/audio
    • File: my_voice.wav
  4. Set output: my_first_tts.wav
  5. Execute: Click "Queue Prompt"

Expected Result

High-quality speech in your chosen speaker's voice!

</details> <details> <summary><b>🗣️ Multi-Speaker Conversations (Expert)</b></summary>

Perfect for: Dialogues, meetings, classroom discussions

Quick Setup for 2-Speaker Dialogue

  1. Create emotion configs:

    Speaker1 Config: Happy (0.8), Confident
    Speaker2 Config: Sad (0.6), Worried
    
  2. ⚠️ IMPORTANT: Set correct emotion mode:

    For emotion sliders (happy: 0.8) → Use "emotion_vector" mode
    For text descriptions → Use "text_description" mode
    
  3. Format conversation:

    Speaker1: I'm so excited about this project!
    Speaker2: I'm worried we won't finish on time...
    Speaker1: Don't worry, we've got this!
    
  4. Connect everything:

    • Audio inputs → Speaker audio files
    • Emotion configs → Multi-talk node
    • Set silence duration: 0.5 seconds
  5. Execute: Get natural conversation with distinct emotions!

</details>

🧠 AI Enhancement Features

<div align="center">

🌟 Revolutionary AI-Powered Voice Synthesis

</div>

IndexTTS2 now features cutting-edge AI enhancement systems that transform it from a traditional TTS system into an intelligent, self-learning voice synthesis platform.

🎯 Core AI Systems

<table> <tr> <th width="25%">AI System</th> <th width="35%">Capabilities</th> <th width="40%">Benefits</th> </tr> <tr> <td><b>🧠 Intelligent Parameter Learning</b></td> <td> • Learns speaker characteristics<br> • Adapts to user preferences<br> • Builds speaker profiles<br> • Optimizes synthesis parameters </td> <td> • Improved voice similarity over time<br> • Personalized user experience<br> • Automatic parameter optimization<br> • Reduced manual tuning </td> </tr> <tr> <td><b>🎵 Adaptive Audio Enhancement</b></td> <td> • Emotion detection from text<br> • Content-aware parameter adjustment<br> • Dynamic audio optimization<br> • Context-sensitive enhancement </td> <td> • Natural emotional expression<br> • Content-appropriate voice tone<br> • Enhanced audio quality<br> • Intelligent parameter selection </td> </tr> <tr> <td><b>🔮 Intelligent Quality Prediction</b></td> <td> • Predicts audio quality before synthesis<br> • Provides improvement suggestions<br> • Analyzes text complexity<br> • Estimates synthesis difficulty </td> <td> • Prevents quality issues<br> • Proactive optimization<br> • Better resource planning<br> • Predictive quality control </td> </tr> <tr> <td><b>🚀 Adaptive Cache Strategy</b></td> <td> • Learns usage patterns<br> • Optimizes cache performance<br> • Predicts model needs<br> • Dynamic resource allocation </td> <td> • Faster synthesis times<br> • Reduced memory usage<br> • Improved performance<br> • Smart resource management </td> </tr> </table>

🔄 AI Enhancement Workflow

Text Input → Quality Prediction → Emotion & Content Analysis → Parameter Enhancement
→ Parameter Learning → Cache Optimization → IndexTTS2 Synthesis → Quality Monitoring
→ Learning Feedback → Data Persistence

🎛️ AI Enhancement Controls

Automatic Operation: All AI enhancement features work automatically without user intervention.

Performance Monitoring: Real-time analytics and learning progress tracking.

Data Persistence: AI systems continuously learn and improve across sessions.

Quality Assurance: Built-in quality monitoring ensures consistent high-quality output.

📊 AI Performance Analytics

<details> <summary><b>🔍 Real-Time Learning Analytics</b></summary>

Parameter Learning Progress:

  • Speaker profile learning sessions: Tracked per speaker
  • User preference adaptation: Continuous improvement
  • Synthesis parameter optimization: Automatic tuning

Quality Prediction Accuracy:

  • Quality prediction success rate: >95%
  • Improvement suggestion effectiveness: Measured and optimized
  • Text complexity analysis: Advanced NLP processing

Cache Performance Optimization:

  • Usage pattern recognition: Smart caching decisions
  • Memory efficiency improvements: Dynamic resource allocation
  • Performance gains: Measurable speed improvements
</details>

🎨 Advanced Features

<div align="center">

🌟 Professional-Grade Capabilities

</div>

🎭 Emotion Control System

<table> <tr> <th width="30%">Feature</th> <th width="35%">Description</th> <th width="35%">Use Cases</th> </tr> <tr> <td><b>8-Dimensional Emotion Vectors</b></td> <td>Precise control over Happy, Angry, Sad, Fear, Hate, Low, Surprise, Neutral emotions</td> <td>Character voices, emotional storytelling, therapeutic applications</td> </tr> <tr> <td><b>Audio-Based Emotion Transfer</b></td> <td>Extract emotions from reference audio and apply to any speaker</td> <td>Voice acting, dubbing, emotional consistency</td> </tr> <tr> <td><b>Natural Language Emotion</b></td> <td>Describe emotions in plain text: "excited and joyful", "sad and contemplative"</td> <td>Creative writing, content creation, accessibility</td> </tr> <tr> <td><b>Cross-Speaker Emotion Transfer</b></td> <td>Apply one speaker's emotional style to another speaker's voice</td> <td>Voice consistency, character development, brand voice</td> </tr> </table>

⏱️ Precision Timing Control

<table> <tr> <th width="30%">Control Mode</th> <th width="35%">Capability</th> <th width="35%">Applications</th> </tr> <tr> <td><b>Speed Control</b></td> <td>Adjust synthesis speed from 0.5x to 2.0x while maintaining naturalness</td> <td>Video dubbing, accessibility, content adaptation</td> </tr> <tr> <td><b>Target Duration</b></td> <td>Specify exact output duration with intelligent pacing adjustment</td> <td>Video synchronization, time-constrained content, presentations</td> </tr> <tr> <td><b>Token-Level Precision</b></td> <td>Control synthesis at individual token level for maximum precision</td> <td>Research applications, fine-tuned control, technical content</td> </tr> <tr> <td><b>Prosody Preservation</b></td> <td>Maintain natural rhythm and intonation during timing adjustments</td> <td>Professional dubbing, natural-sounding content, quality preservation</td> </tr> </table>

🗣️ Multi-Speaker Conversation System

Advanced Conversation Features:

  • 1-4 Speaker Support: From single voice cloning to complex multi-party conversations
  • Individual Emotion Control: Each speaker can have unique emotional characteristics
  • Automatic Conversation Parsing: Smart text parsing with speaker identification
  • Configurable Silence Intervals: Precise control over pauses between speakers
  • Voice Consistency Control: Maintain speaker identity across long conversations
  • Reference Audio Enhancement: Automatic optimization of speaker reference audio

Conversation Text Format:

Speaker1: [Happy] Hello everyone! How are you doing today?
Speaker2: [Excited] I'm doing fantastic! Thanks for asking!
Speaker3: [Calm] I'm well, thank you. It's nice to see everyone.
Speaker4: [Thoughtful] It's interesting how different we all sound.

Embedded Pause Control:

Speaker1: Hello there! -0.8s- How are you doing today?
Speaker2: I'm great! -1.2s- Thanks for asking.

🔧 Audio Quality Enhancement

High-Quality Audio Processing:

  • Kaiser Window Resampling: Professional-grade audio resampling for optimal quality
  • Intelligent Audio Preprocessing: Automatic noise reduction and enhancement
  • Smooth Audio Transitions: Crossfade technology for seamless audio splicing
  • Dynamic Range Optimization: Intelligent compression and expansion
  • Spectral Enhancement: Advanced frequency domain processing

Quality Monitoring System:

  • Real-Time Quality Assessment: SNR, THD, dynamic range analysis
  • Quality Score Calculation: Comprehensive audio quality metrics
  • Automatic Quality Reporting: Detailed quality analysis for each synthesis
  • Performance Optimization: Continuous quality improvement suggestions

🚀 Performance Optimization

Caching and Memory Management:

  • Speaker Embedding Cache: LRU-based caching with intelligent eviction
  • Multi-Sample Embedding Fusion: Advanced speaker representation techniques
  • Thread-Safe Operations: Concurrent processing support
  • Memory Usage Optimization: Efficient resource utilization

GPU Acceleration:

  • CUDA Support: Full GPU acceleration for compatible hardware
  • FP16 Precision: Half-precision processing for faster inference
  • Batch Processing: Efficient handling of multiple synthesis requests
  • Dynamic Device Selection: Automatic GPU/CPU selection based on availability

🔧 Troubleshooting & Support

<div align="center">

🆘 Common Issues & Solutions

</div> <details> <summary><b>❌ Installation Issues</b></summary>

❌ Parameter Error: 'is_fp16' not recognized

Error Message: TypeError: IndexTTS2.__init__() got an unexpected keyword argument 'is_fp16'

Cause: Outdated code version (fixed in 2025-11-05 update)

Solution:

# 1. Update to latest version
cd ComfyUI/custom_nodes/Comfyui-Index-TTS2
git pull origin main

# 2. Restart ComfyUI completely
# Close ComfyUI and restart

# 3. Verify update
git log --oneline -3
# Should show: "fix: correct parameter name from is_fp16 to use_fp16"

📖 For detailed instructions: See UPDATE_INSTRUCTIONS.md

❌ Transformers Compatibility Error

Error Message: cannot import name 'QuantizedCacheConfig' from 'transformers.cache_utils'

Cause: Transformers library version incompatibility

Solution:

# 1. Check compatibility and current version
python check_transformers_compatibility.py

# 2. If version is too old, try upgrading
pip install --upgrade transformers

# 3. If version is too new, may need downgrade (use caution)
# pip install transformers==4.36.2

# 4. Restart ComfyUI

❌ Model Loading Fails

# Check model files
ls checkpoints/
# Should contain: config.yaml, model files

# Download models again
python download_models.py

# Check GPU memory
nvidia-smi  # For NVIDIA GPUs

❌ "No module named 'indextts'" Error

# Solution 1: Install the package
pip install -e index-tts/

# Solution 2: Check Python path
python -c "import sys; print(sys.path)"

# Solution 3: Reinstall dependencies
pip install -r requirements.txt --force-reinstall
</details> <details> <summary><b>🎵 Audio Issues</b></summary>

Audio File Not Found

  • ✅ Use the two-level audio selection system
  • ✅ Check file exists in selected directory
  • ✅ Verify supported formats: WAV, MP3, FLAC, OGG
  • ✅ Test with absolute paths if needed

Poor Audio Quality

Speaker Audio Requirements:

  • 📏 Duration: 3-10 seconds
  • 🔊 Quality: Clear, noise-free
  • 👤 Content: Single speaker only
  • 📊 Sample Rate: 16kHz+ (22.05kHz optimal)

Quality Improvement Tips:

# Test audio quality
python test_audio_quality.py your_audio.wav

# Audio preprocessing
python fix_audio_quality.py input.wav output.wav

Audio Playback Issues

If you experience audio playback problems:

  1. Check Audio Format: Ensure output format is supported by your player
  2. Verify File Integrity: Check if the generated audio file is not corrupted
  3. Test Different Players: Try different audio players or software
  4. Check Volume Levels: Ensure audio volume is appropriate
</details> <details> <summary><b>🎭 Emotion Control Issues</b></summary>

❌ Problem: Emotion Text Description Not Working

Symptoms:

  • You use text descriptions like "happy and excited"
  • Generated voice sounds neutral or doesn't match description
  • Console shows default emotion values

Root Cause: Qwen emotion model not available (fixed in 2025-11-05 update)

✅ Solution (Automatic): The latest version includes keyword-based emotion analysis as fallback:

# Update to latest version
git pull origin main
# Restart ComfyUI

How It Works Now:

  • System detects emotion keywords in your text (Chinese & English)
  • Analyzes emotion intensity with weighted scoring
  • Generates appropriate emotion vectors automatically
  • Works even without Qwen model!

Supported Keywords:

  • Happy: 开心, 高兴, 快乐, 兴奋, happy, excited, joyful
  • Angry: 生气, 愤怒, 气愤, angry, furious, mad
  • Sad: 伤心, 难过, 悲伤, sad, depressed, sorrowful
  • Fear: 害怕, 恐惧, 担心, fear, scared, anxious
  • And more... (see EMOTION_TEXT_FIX.md)

❌ Problem: Emotion Vector Values Ignored (Shows "neutral: 1.0")

Symptoms:

  • You set happy: 0.8 in emotion config
  • Console shows neutral: 1.0 instead
  • Generated voice sounds neutral despite emotion settings

Root Cause: Emotion mode mismatch

✅ Solution:

  1. Check your emotion config node
  2. Change emotion_mode from text_description to emotion_vector
  3. Reconnect the emotion config to multi-talk node
  4. Re-run the workflow

Step-by-Step Fix:

1. Click on your Speaker Emotion Config node
2. Find the "emotion_mode" dropdown
3. Change from "text_description" → "emotion_vector"
4. Verify your emotion values are set (e.g., happy: 0.8)
5. Make sure "enabled" is checked (True)
6. Execute workflow again

✅ Mode Selection Guide

| Your Input | Correct Mode | Example | |------------|--------------|---------| | Emotion sliders (happy: 0.8, etc.) | emotion_vector | happy: 0.8, angry: 0.2 | | Text description | text_description | "excited and joyful" | | Audio file | audio_prompt | emotion_audio.wav | | Auto-detect | auto | Let system decide |

</details> <details> <summary><b>⚡ Performance Issues</b></summary>

Memory Optimization

# Use Model Manager for efficient caching
Model Manager → Enable FP16 → Set device to GPU

# Clear cache when needed
Model Manager → Clear Cache

Speed Optimization

  • 🚀 Enable CUDA if available
  • ⚡ Use FP16 precision
  • 🧠 Cache models with Model Manager
  • 📦 Use batch processing for multiple files

GPU Memory Issues

# Check GPU memory
nvidia-smi

# Reduce memory usage
- Enable FP16
- Reduce batch size
- Use CPU for large models
</details>

🔍 Diagnostic Tools

| Tool | Purpose | Command | |------|---------|---------| | Dependency Checker | Verify all packages | python check_all_dependencies.py | | Audio Tester | Test audio files | python test_audio_quality.py | | Model Validator | Check model files | python test_model_loading.py | | System Info | Hardware compatibility | python system_info.py |

📞 Getting Help

<table> <tr> <td width="50%">

🐛 Bug Reports

  • GitHub Issues
  • Include error logs
  • System information
  • Reproduction steps
</td> <td width="50%">

💬 Community Support

  • Discord: ComfyUI community
  • Reddit: r/ComfyUI
  • GitHub Discussions
  • Documentation wiki
</td> </tr> </table>

📚 Documentation & Resources

<div align="center">

📖 Complete Documentation Library

</div>

📋 Technical Documentation

Core Documentation Files:

Latest Updates & Fixes (2025-11-05):

🧪 Testing & Validation Tools

# Comprehensive dependency check
python check_all_dependencies.py

# AI enhancement system testing
python test_ai_enhanced_systems.py

# Audio quality testing
python test_audio_quality.py

# Model validation
python test_model_loading.py

🛠️ Development Scripts

  • 🔧 Setup: setup_audio_files.py, download_models.py
  • 🧪 Testing: test_*.py files for various components
  • 🔍 Debugging: debug_*.py files for troubleshooting
  • Optimization: fix_*.py files for performance
  • 🧠 AI Enhancement: ai_enhanced_systems.py - Core AI systems

🚀 Performance Benchmarks

<div align="center">

📊 Real-World Performance Metrics

</div>

| Hardware | Synthesis Speed | Memory Usage | Quality Score | AI Enhancement | |----------|----------------|--------------|---------------|----------------| | RTX 4090 | 10x real-time | 8GB VRAM | 95%+ | Full AI features | | RTX 3080 | 6x real-time | 6GB VRAM | 93%+ | Full AI features | | RTX 2080 | 3x real-time | 4GB VRAM | 90%+ | Limited AI features | | CPU Only | 0.5x real-time | 8GB RAM | 85%+ | Basic AI features |

🎯 AI Enhancement Performance

Learning System Performance:

  • Parameter learning convergence: 10-15 sessions
  • Quality prediction accuracy: >95%
  • Cache optimization effectiveness: 30-50% speed improvement
  • Emotion detection accuracy: 92%+ for common emotions

Memory and Speed Optimization:

  • Speaker embedding cache hit rate: >80%
  • Memory usage reduction: 25-40% with AI caching
  • Synthesis speed improvement: 20-60% with AI optimization
  • Quality consistency: 98%+ across sessions

🤝 Community & Contributing

<div align="center">

🌟 Join Our Growing Community!

</div> <table> <tr> <td width="50%">

🤝 How to Contribute

  1. 🍴 Fork the repository
  2. 🌿 Create a feature branch
  3. ✨ Make your improvements
  4. 🧪 Add tests if applicable
  5. 📤 Submit a pull request

🎯 Contribution Areas

  • 🐛 Bug fixes and improvements
  • 📚 Documentation enhancements
  • 🎨 New workflow examples
  • 🔧 Performance optimizations
  • 🧠 AI enhancement features
  • 🌍 Translations and localization
</td> <td width="50%">

💬 Community Channels

  • 🐙 GitHub: Issues, discussions, PRs
  • 💬 Discord: ComfyUI community server
  • 📱 Reddit: r/ComfyUI subreddit
  • 📧 Email: For commercial inquiries
  • 📖 Wiki: Community documentation

🏆 Recognition

  • Contributors listed in CONTRIBUTORS.md
  • Special thanks in release notes
  • Community showcase features
  • AI enhancement contributor credits
</td> </tr> </table>

📄 License & Legal

<div align="center">

📜 Apache 2.0 License

This project is licensed under the Apache 2.0 License - see the LICENSE file for details.

</div>

🙏 Acknowledgments

<table> <tr> <td width="33%">

🔬 Research Team

  • IndexTTS2 research team
  • Original model developers
  • Academic contributors
  • AI enhancement researchers
</td> <td width="33%">

🛠️ Technical Community

  • ComfyUI framework team
  • PyTorch community
  • Open source contributors
  • AI/ML community
</td> <td width="33%">

👥 User Community

  • Beta testers
  • Documentation contributors
  • Workflow creators
  • AI enhancement testers
</td> </tr> </table>

🌟 Special Recognition

AI Enhancement Development:

  • Advanced machine learning integration
  • Intelligent parameter optimization systems
  • Quality prediction and monitoring
  • Adaptive caching and performance optimization

Community Contributions:

  • Extensive testing and feedback
  • Documentation improvements
  • Workflow examples and tutorials
  • Bug reports and feature requests

💝 Support the Project

<div align="center">

☕ Buy Me a Coffee

If you find IndexTTS2 helpful and it has made your voice synthesis projects easier, consider supporting the development!

🎯 Your support helps:

  • 🚀 Accelerate new feature development
  • 🧠 Enhance AI capabilities
  • 🔧 Improve system stability
  • 📚 Create better documentation
  • 🌍 Support the open-source community
</div> <table> <tr> <td width="50%" align="center">

💬 WeChat Contact

<img src="https://github.com/xuchenxu168/images/blob/main/%E5%BE%AE%E4%BF%A1%E5%8F%B7.jpg" alt="WeChat QR Code" width="200" height="200">

Scan to add WeChat 扫码添加微信

WeChat ID: Kenchen7168

</td> <td width="50%" align="center">

☕ Support Development

<img src="https://github.com/xuchenxu168/images/blob/main/%E6%94%B6%E6%AC%BE%E7%A0%81.jpg" width="200" height="200">

Scan to buy me a coffee 扫码请我喝咖啡

💝 Every coffee counts! 每一杯咖啡都是支持!

</td> </tr> </table> <div align="center">

🙏 Thank you for your support!

Your contributions, whether through code, feedback, or coffee, make IndexTTS2 better for everyone!

谢谢您的支持!无论是代码贡献、反馈建议还是请我喝咖啡,都让IndexTTS2变得更好!

</div>
<div align="center">

🚀 Ready to Create Amazing AI-Enhanced Voice Content?

⬆️ Back to Top📦 Install Now🎯 Quick Start🧠 AI Features🤝 Join Community💝 Support Project


🎙️ IndexTTS2 ComfyUI Plugin - Revolutionary AI-Enhanced Voice Synthesis Platform

🧠 Now with Advanced AI Enhancement Systems - Intelligent, Self-Learning, Continuously Improving

Made with ❤️ AI Enhanced Open Source Community Driven

</div>