# Pixelle-Video Text-to-Speech (TTS) Engines: Complete Guide to Edge-TTS, Index-TTS 2, and Custom ComfyUI Nodes

> Explore Pixelle-Video's TTS engines: Edge-TTS for local inference, Index-TTS 2 for voice cloning, and custom ComfyUI nodes, empowering flexible audio generation.

- Repository: [AIDC-AI/Pixelle-Video](https://github.com/AIDC-AI/Pixelle-Video)
- Tags: guide
- Published: 2026-04-23

---

**Pixelle-Video supports three categories of TTS engines: Microsoft Edge-TTS (local inference), Index-TTS 2 (voice cloning via ComfyUI), and any custom ComfyUI-compatible TTS node through workflow-based execution.**

The open-source Pixelle-Video project (AIDC-AI/Pixelle-Video) provides a flexible text-to-speech architecture that routes between local inference and ComfyUI workflow execution. This guide covers all supported TTS engines, their configuration, and implementation details based on the actual source code.

## Edge-TTS: Local Microsoft Speech Synthesis

### How Edge-TTS Works in Pixelle-Video

The **Edge-TTS** engine provides free, local text-to-speech using Microsoft's Edge browser speech service. This is the default TTS method when `inference_mode="local"` is specified.

The implementation resides in [`pixelle_video/utils/tts_util.py`](https://github.com/AIDC-AI/Pixelle-Video/blob/main/pixelle_video/utils/tts_util.py), with voice definitions located in [`pixelle_video/tts_voices.py`](https://github.com/AIDC-AI/Pixelle-Video/blob/main/pixelle_video/tts_voices.py).

### Configuring Edge-TTS Voices

Voice selection uses the `EDGE_TTS_VOICES` catalog. Here's how to use Edge-TTS programmatically:

```python

# Generate speech locally with Edge-TTS

audio_path = await pixelle_video.tts(
    text="Hello, world!",
    inference_mode="local",          # forces Edge-TTS

    voice="en-US-JennyNeural",      # any ID from EDGE_TTS_VOICES

    speed=1.2                        # 20% faster

)
print(f"Audio saved to {audio_path}")

```

The `speed` parameter converts to Edge-TTS's `rate` parameter via the `speed_to_rate` function in [`tts_util.py`](https://github.com/AIDC-AI/Pixelle-Video/blob/main/tts_util.py).

### Edge-TTS Source Files

| File | Purpose |
|------|---------|
| [`pixelle_video/services/tts_service.py`](https://github.com/AIDC-AI/Pixelle-Video/blob/main/pixelle_video/services/tts_service.py) | Routes to `_call_local_tts` (lines 41-68) |
| [`pixelle_video/utils/tts_util.py`](https://github.com/AIDC-AI/Pixelle-Video/blob/main/pixelle_video/utils/tts_util.py) | Async `edge_tts` function with networking and retries |
| [`pixelle_video/tts_voices.py`](https://github.com/AIDC-AI/Pixelle-Video/blob/main/pixelle_video/tts_voices.py) | `EDGE_TTS_VOICES` catalog |

## Index-TTS 2: Voice Cloning via ComfyUI

### How Index-TTS 2 Works in Pixelle-Video

**Index-TTS 2** provides voice cloning capabilities through a self-hosted ComfyUI workflow. This engine requires `inference_mode="comfyui"` with the specific workflow path [`workflows/selfhost/tts_index2.json`](https://github.com/AIDC-AI/Pixelle-Video/blob/main/workflows/selfhost/tts_index2.json).

The workflow contains the `IndexTTS2BaseNode` node, which handles the voice cloning inference.

### Using Index-TTS 2 for Voice Cloning

```python

# Use the built-in Index-TTS 2 workflow (voice cloning)

audio_path = await pixelle_video.tts(
    text="床前明月光，疑是地上霜。",
    inference_mode="comfyui",               # run a ComfyUI workflow

    workflow="selfhost/tts_index2.json",    # explicit workflow path

    voice="zh-CN-YunjianNeural",           # passed to the node (optional)

    speed=1.0
)
print(f"Cloned voice audio: {audio_path}")

```

### Index-TTS 2 Source Files

| File | Purpose |
|------|---------|
| [`workflows/selfhost/tts_index2.json`](https://github.com/AIDC-AI/Pixelle-Video/blob/main/workflows/selfhost/tts_index2.json) | Self-hosted workflow with `IndexTTS2BaseNode` |
| [`pixelle_video/services/tts_service.py`](https://github.com/AIDC-AI/Pixelle-Video/blob/main/pixelle_video/services/tts_service.py) | `_call_comfyui_workflow` method |
| [`config.example.yaml`](https://github.com/AIDC-AI/Pixelle-Video/blob/main/config.example.yaml) | Default workflow configuration under `comfyui.tts.default_workflow` |

## Custom ComfyUI TTS Nodes

### Extending Pixelle-Video with Custom TTS Workflows

Pixelle-Video supports **any ComfyUI-compatible TTS node** through custom workflow files. This provides unlimited extensibility for specialized TTS engines or third-party plugins.

Requirements for custom TTS workflows:
- File must be placed under `workflows/` directory (e.g., `workflows/selfhost/`)
- Must contain a TTS node with the `tts_` prefix
- Must be invoked with `inference_mode="comfyui"`

### Creating and Using Custom TTS Workflows

Create a workflow file [`workflows/selfhost/my_custom_tts.json`](https://github.com/AIDC-AI/Pixelle-Video/blob/main/workflows/selfhost/my_custom_tts.json) with your TTS node:

```python
audio_path = await pixelle_video.tts(
    text="Custom TTS node example",
    inference_mode="comfyui",
    workflow="selfhost/my_custom_tts.json"
)

```

The [`workflows/selfhost/tts_edge.json`](https://github.com/AIDC-AI/Pixelle-Video/blob/main/workflows/selfhost/tts_edge.json) provides a reference implementation for wrapping Edge-TTS as a ComfyUI workflow.

## TTS Service Architecture

### Entry Point and Routing Logic

The [`pixelle_video/services/tts_service.py`](https://github.com/AIDC-AI/Pixelle-Video/blob/main/pixelle_video/services/tts_service.py) file implements the core TTS service with the `__call__` method as the entry point.

Routing logic:
1. Determines `inference_mode` from call arguments or config (`self.config.get("inference_mode")`)
2. Routes to `_call_local_tts` for Edge-TTS
3. Routes to `_call_comfyui_workflow` for any ComfyUI-based engine

### Workflow Resolution

The `_resolve_workflow` method loads workflow JSON files from:
- `workflows/selfhost/` for self-hosted deployments
- `workflows/runninghub/` for cloud (RunningHub) deployments

Default workflow paths are configured in [`config.example.yaml`](https://github.com/AIDC-AI/Pixelle-Video/blob/main/config.example.yaml) under the `comfyui.tts.default_workflow` key.

## Summary

- **Edge-TTS** provides free, local Microsoft speech synthesis via `inference_mode="local"` — implemented in [`pixelle_video/utils/tts_util.py`](https://github.com/AIDC-AI/Pixelle-Video/blob/main/pixelle_video/utils/tts_util.py) with voices defined in [`pixelle_video/tts_voices.py`](https://github.com/AIDC-AI/Pixelle-Video/blob/main/pixelle_video/tts_voices.py)
- **Index-TTS 2** enables voice cloning through the self-hosted ComfyUI workflow [`workflows/selfhost/tts_index2.json`](https://github.com/AIDC-AI/Pixelle-Video/blob/main/workflows/selfhost/tts_index2.json) containing the `IndexTTS2BaseNode`
- **Custom ComfyUI nodes** extend TTS capabilities infinitely — any node with `tts_` prefix in a workflow file under `workflows/` can be invoked via `inference_mode="comfyui"`
- **Central routing** occurs in [`pixelle_video/services/tts_service.py`](https://github.com/AIDC-AI/Pixelle-Video/blob/main/pixelle_video/services/tts_service.py) with `_call_local_tts` and `_call_comfyui_workflow` methods handling engine-specific execution

## Frequently Asked Questions

### How do I switch between TTS engines in Pixelle-Video?

Set the `inference_mode` parameter when calling the TTS service. Use `"local"` for Edge-TTS or `"comfyui"` for Index-TTS 2 and custom workflows. The [`pixelle_video/services/tts_service.py`](https://github.com/AIDC-AI/Pixelle-Video/blob/main/pixelle_video/services/tts_service.py) file routes requests based on this parameter, falling back to configuration values if not specified.

### Can I use my own voice with Pixelle-Video's TTS?

Yes, through **Index-TTS 2** in [`workflows/selfhost/tts_index2.json`](https://github.com/AIDC-AI/Pixelle-Video/blob/main/workflows/selfhost/tts_index2.json). This workflow uses the `IndexTTS2BaseNode` for voice cloning. You can also create custom workflows with other voice cloning nodes by placing them under `workflows/` with the `tts_` prefix and invoking with `inference_mode="comfyui"`.

### Where are TTS voices configured in Pixelle-Video?

Edge-TTS voices are defined in [`pixelle_video/tts_voices.py`](https://github.com/AIDC-AI/Pixelle-Video/blob/main/pixelle_video/tts_voices.py) in the `EDGE_TTS_VOICES` list. For ComfyUI-based engines, voice selection happens within the workflow JSON files under `workflows/selfhost/` or `workflows/runninghub/`. The default workflow path is set in [`config.example.yaml`](https://github.com/AIDC-AI/Pixelle-Video/blob/main/config.example.yaml) under `comfyui.tts.default_workflow`.