A custom node for ComfyUI that integrates ElevenLabs' text-to-speech API, enabling high-quality voice synthesis within your ComfyUI workflows.
- Pulls your ElevenLabs voices on demand (cached for 1 hour) and maps names → IDs automatically
- Built-in support for the shipped models:
eleven_multilingual_v2,eleven_english_sts_v2,eleven_turbo_v2 - Voice tuning controls: stability, similarity boost, style, and speaker boost
- Voice changer node powered by the ElevenLabs speech-to-speech API (with background noise removal toggle)
- Text input flexibility: type in the node UI or feed text from another node (
input_textoverride) - Returns a ComfyUI
AUDIOdict with waveform tensor + sample rate decoded from ElevenLabs MP3 responses
- Clone this repository into your ComfyUI
custom_nodesfolder:
cd ComfyUI/custom_nodes
git clone https://github.com/yourusername/ComfyUI-ElevenLabs- Install dependencies:
pip install -r requirements.txt- Restart ComfyUI.
You'll need an ElevenLabs API key (ELEVENLABS_API_KEY) set in your environment. Example for a shell session:
export ELEVENLABS_API_KEY=your_keyThe node reads this variable automatically; there is no API key input inside the UI.
- Add the "ElevenLabs TTS Node" to your workflow.
- Type text in the node or wire a string input into
input_text(wired input takes priority). - Pick a voice from the dropdown (list is fetched from your ElevenLabs account and cached).
- Choose a model (defaults to multilingual v2).
- Adjust stability, similarity boost, style, and speaker boost as desired.
- Connect the audio output to preview or save nodes.
- text: Text box content to synthesize.
- input_text (optional): Upstream string input; overrides the text box when connected.
- voice: Dropdown of your ElevenLabs voices (deduped names, numbered when repeated).
- model: One of
eleven_multilingual_v2,eleven_english_sts_v2,eleven_turbo_v2. - stability: 0.0–1.0.
- similarity_boost: 0.0–1.0.
- style: 0.0–1.0.
- speed: Playback speed multiplier (0.25–4.0, default 1.0).
- use_speaker_boost: Boolean toggle.
- previous_text (optional): Context text preceding the current segment (sent to API when provided).
- next_text (optional): Context text following the current segment (sent to API when provided).
- AUDIO:
{"waveform": torch.Tensor(shape: 1 x channels x samples), "sample_rate": int}
Add the "ElevenLabs Voice Changer" node to convert an existing audio clip to another voice using the speech-to-speech API.
- audio: ComfyUI
AUDIOdict (waveform + sample_rate) to convert. - voice: Target voice selection (list fetched from your ElevenLabs account).
- model: One of
eleven_english_sts_v2,eleven_multilingual_sts_v2(speech-to-speech capable). - stability: 0.0–1.0.
- similarity_boost: 0.0–1.0.
- style: 0.0–1.0.
- speed: Playback speed multiplier (0.25–4.0, default 1.0).
- use_speaker_boost: Boolean toggle.
- remove_background_noise: Toggle to run ElevenLabs' background noise removal on input audio.
- seed (optional): Integer seed (0 leaves it unset).
- output_format (optional): MP3 output format variant (default
mp3_44100_128).
- AUDIO: Converted audio in the selected voice (decoded from API response).
- Voices are fetched from
https://api.elevenlabs.io/v2/voices(paginated, 100 per page) and cached for 1 hour. Missing/expired API keys log an error and return a silent placeholder waveform. - Failures in TTS requests or MP3 decoding also return a 1-sample silent waveform and log the error.
- Some voices or models may depend on your ElevenLabs subscription tier.
- ComfyUI
- Python packages: requests, torch, numpy
- ElevenLabs API key
- Internet connection for API calls
MIT License
Copyright (c) 2024
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.