Recipe: Text to speech
Goal: turn a script into spoken audio — for narration, voiceovers, or accessibility.
Nodes you'll use: Text Input → a TTS node (ChatterboxTTS, or the OpenVoice nodes for voice cloning/conversion) → an audio output.
In the Workflow Builder
- Add a Text Input node and paste your script (or wire it to a file).
- Add a ChatterboxTTS node.
- Connect Text Input → ChatterboxTTS, Save, and Run.
- Download the generated audio.
Want a specific voice? The OpenVoice nodes do voice cloning / conversion — feed a reference clip plus your text.
Pass the text at runtime (API)
The text doesn't have to be baked into the node — pass it per-run with extra_variables:
# $AUTH is "Authorization: Bearer <token>" — get it from your sk_ key,
# see /api-reference#authentication
curl -s -X POST "$BASE/workflows/workflow-versions/<your_version_id>/run" -H "$AUTH" \
-H "Content-Type: application/json" \
-d '{"cog_ids": [], "extra_variables": {"text_content": "Welcome to MOD. Let'\''s build something."}}'
The extra_variables keys are workflow-specific. Call GET /workflows/workflow-versions/{id}/variables to see which keys your workflow accepts — a Text Input typically exposes text_content. Passing it overrides the node at run time, handy for generating many clips from one workflow. See the API Reference.
Related
- Node Library → Audio & speech
- Batch-process a folder — generate audio for many scripts at once.