ComfyUI Node

Text to Speech

Text to Speech with Bark

By kadirnar·Created 3 years ago·Updated 7 months ago· 25
Text to Speech
    • audio_path
    text
    model_namesuno/bark-small

    Text to Speech is how you get a voice out of ComfyUI. Type a line, run the node, and you get a .wav file on disk with a synthetic voice speaking it. For a video or animation workflow it's the missing half of the equation - most people building talking-head or narration pipelines in ComfyUI end up bolting on an external TTS service or a separate script. This node keeps the whole thing inside the graph.

    It wraps Hugging Face's text-to-speech pipeline, defaulting to suno/bark-small. Bark is the text-to-audio model from Suno (yes, that Suno) - it's a generative model rather than a classic concatenative TTS, which means it can do expressive speech, and its [laughter], [laughs] and [music] token tricks actually work. The node runs the pipeline on your text, converts the float audio to 16-bit PCM, and writes it with scipy.io.wavfile to comfyui_tts_output.wav in your system temp directory.

    The inputs and output

    • text - a multiline string. Whatever you want spoken.
    • model_name - the Hub model ID, typed as a string. Default suno/bark-small; the full suno/bark is bigger and slower with better quality.

    Output is a single STRING called audio_path - and this is the part that trips everyone up. It is not an audio signal. It's the filesystem path to the WAV the node just wrote. To actually play it, you need a node that loads audio from a file path - any audio-loader node that accepts a path string works - and you'll want to copy the file out of temp before it gets overwritten on the next run.

    How to install it

    Same pack install as every node here - ComfyUI Manager (search "ComfyUI-Transformers") or:

    cd ComfyUI/custom_nodes
    git clone https://github.com/kadirnar/ComfyUI-Transformers
    

    Restart, done. requirements.txt covers the pieces this node needs beyond the usual transformers stack: scipy for writing the WAV and soundfile for audio I/O. Bark-small is a few hundred MB to download on first run.

    Where people get burned

    Two things. First, Bark is heavy at inference - the small variant still wants a GPU and will crawl on CPU, so budget VRAM and patience. Second, the path-string output means a beginner's first instinct - connect audio_path to an audio player node expecting an AUDIO type - won't connect. There's no type conversion built in, so you need that path-loading node in between. It's a real design wart, but it's also the pattern the whole audio side of this pack uses: ASR and audio classification also take a path string rather than an audio blob. Once you've got one path-loading node in your graph, all three click into place.

    CategoryTransformers/Audio/TextToSpeech

    Inputs (2)

    NameTypeDefaultDescription
    textSTRING
    model_nameSTRINGsuno/bark-small

    Outputs (1)

    NameTypeDescription
    audio_pathSTRING