Convert Text to Speech with Local KOKORO SDK - n8n Workflow | Neura Market

    Convert Text to Speech with Local KOKORO SDK

    ## Disclaimer The **Execute Command** node is only supported on **self-hosted** (local) instances of n8n. ## Introduction ![1.jpg](fileId:1114) **KOKORO S** - Kokoro S is a compact yet powerful text-to-speech model, currently available on Hugging Face and GitHub. Despite its modest size—trained on less than 100 hours of audio—it delivers impressive results, consistently topping the S leaderboard on Hugging Face. Unlike larger systems, Kokoro S offers the advantage of running locally, even on devices without GPUs, making it accessible for a wide range of users. **Who will benefit from this integration?** This will be useful for video bloggers, TikTokers, and it will also enable the creation of a free voice chat bot. Currently, S models are mostly paid, but this integration will allow for fully free voice generation. The possibilities are limited only by your imagination. #### Note Unfortunately, we can't interact with the KOKORO API via browser URL (GET/POST), **but** we can run a Python script through n8n and pass any variables to it. In the tutorial, the D drive is used, but you can rewrite this for any paths, including the C drive. ## Step 1 You need to have Python installed. [link](https://github.com/PierrunoY/Kokoro-S-Local) Also, download and extract the portable version of KOKORO from GitHub. Create a file named voicegen.py with the following code in the KOKORO folder: (C:\KOKORO). As you can see, the output path is: (D:\output.mp3). ``` import sys import shutil from gradio_client import Client # Set UTF-8 encoding for stdout sys.stdout.reconfigure(encoding='utf-8') # Get arguments from command line text = sys.argv[1] # First argument: input text voice = sys.argv[2] # Second argument: voice speed = float(sys.argv[3]) # Third argument: speed (converted to float) print(f"Received text: {text}") print(f"Voice: {voice}") print(f"Speed: {speed}") # Connect to local Gradio server client = Client("http://localhost:7860/") # Generate speech using the API result = client.predict( text=text, voice=voice, speed=speed, api_name="/generate_speech" ) # Define output path output_path = r"D:\output.mp3" # Move the generated file shutil.move(result[1], output_path) # Print output path print(output_path) ``` ## Step 2 Go to n8n and create the following workflow. ![2.jpg](fileId:1111) ## Step 3 Edit Field Module. ``` { voice: "af_sarah", text: "Hello world!" } ``` ![33.jpg](fileId:1110) ## Step 4 We'll need an Execute Command module with the command: python ``` C:\KOKORO\voicegen.py "{{ $json.text }}" "{{ $json.voice }}" 1 ``` ![44.jpg](fileId:1112) ## Step 5 The script is already working, but to listen to it, you can connect a Binary module with the path to the generated MP3 file ``` D:/output.mp3 ``` ![55.jpg](fileId:1113) ## Step 6 Click “Next workflow” and enjoy the result. There are more voices and accents than in ChatGPT, plus it's free. ### P.S. If you want, there is a [detailed tutorial](https://blog.bswlife.site/2025/04/14/n8n-kokoro-tts-integration-setup/) on my blog.

    Platform
    n8n
    Category
    AI
    Price
    Free
    Creator
    bswlife
    • set
    • manualTrigger
    • executeCommand
    • readBinaryFiles
    Back to MarketplaceMore n8n Workflows

    How to import this workflow into n8n

    1. 1Purchase or download the workflow to get the n8n workflow JSON file.
    2. 2In your n8n instance, open Workflows and choose "Import from File" (or paste the JSON with Ctrl+V on the canvas).
    3. 3Open each node marked with a credential warning and connect your own accounts and API keys.
    4. 4Run the workflow once manually to verify the data flow, then toggle it to Active.

    Related AI workflows

    • Launch Your First AI-Powered Chatbot with Actionable ToolsFree
    • Automate AI Video Creation and YouTube Upload with Google Sheets
    Free
  1. Build a WhatsApp Assistant with Memory, Google Suite, Multi-AI, Research, and ImagingFree
  2. Automate Blog Post Creation and Publishing with GPT, Leonardo AI, and WordPressFree
  3. Email Agent$500.99
  4. Create a Conversational Telegram Bot with GPT-4 for Text and Voice MessagesFree
  5. All AI workflows →All n8n workflows →

    Need help customizing this workflow?

    Our automation experts adapt it to your exact stack, data, and process — or build one from scratch.

    Get a Custom Build
    Neura Market
    Neura Market
    Marketplace
    Directories
    Resources

    Marketplace

    • Prompts
    • Workflows
    • Agents Store
    • Workflow Packs
    • Categories
    • Marketplace

    Directories

    • AI Tools Directory
    • ChatGPT
    • Claude
    • Gemini
    • Cursor
    • Grok
    • DeepSeek
    • Perplexity
    • CoPilot
    • Midjourney
    • Stable Diffusion
    • MCP Servers
    • .md Directory
    • All Directories

    Free Tools

    • AI Text Humanizer
    • AI Content Detector
    • Workflow Generator
    • Model Comparison
    • AI Pricing Calculator
    • AI Benchmarks
    • ROI Calculator
    • All Free Tools

    Resources

    • AI News
    • Blog
    • AI Models
    • Integrations
    • Alternatives
    • n8n vs Zapier
    • Make vs Zapier
    • n8n vs Make
    • Resource Library
    • Documentation

    Community

    • AI Jobs
    • AI Events
    • AI Companies
    • Start Selling
    • Sell n8n Workflows
    • Sell AI Agents
    • Sell Prompts
    • Creator Guide
    • Advertise
    • Affiliates

    Company

    • About
    • Contact
    • Help
    • Careers
    • Pricing
    • Terms
    • Privacy
    • License
    • DMCA

    Stay Updated

    Get the latest AI tools and insights delivered to your inbox.

    Neura Market Logoneuramarket

    © 2026 Neura Market. All rights reserved.