Vaja Synthesis Api
Thai text-to-speech that's secretly a cloud API call
- audio
The name is the tell. "Vaja Synthesis Api" - despite the pack's "Vaja TextToSpeech" branding, this node doesn't synthesize a thing locally. It's a thin wrapper around Vaja 9, the neural Thai TTS served by Thailand's NECTEC through its AI for Thai API. You paste in a key, type some Thai, and the node goes out to a government cloud service and brings back an audio waveform. No key, no audio. The README glosses over that; the code doesn't.
So why reach for it? Because Thai TTS is the hard part, and this is the standard Thai neural voice without you running or fine-tuning anything. If your workflow is Thai content, dubbing, or a lip-synced talking head, this is a legit shortcut. The pack even ships a reference workflow wiring Vaja → VHS_VideoCombine from the VHS pack for LatentSync-style lip sync, so the intended use is pretty clear: generate Thai speech, animate a face to it.
How it works
Every run is a network round trip. The node POSTs your text to https://api.aiforthai.in.th/vaja9/synth_audiovisual with your key in an Apikey header and a JSON body of {input_text, speaker, phrase_break: 0, audiovisual: 0}. The response contains a wav_url; the node downloads that wav, saves it to output/vaja_sync_out.wav, loads it with librosa, and returns a standard ComfyUI AUDIO dict - a waveform tensor plus a sample rate.
One mechanism detail worth knowing: librosa.load() resamples everything to 22.05 kHz by default, so that's the sample rate you get regardless of what the API sends back. Fine for speech and video, but don't expect a 44.1 kHz master. It's also fully online - if your internet is down, the node is a paperweight.
The three inputs that matter
There are only three, and they're all required:
apikey- empty by default. This is the one you must fill. Register a free account at aiforthai.in.th, grab a key, paste it in. Free keys come with a daily call quota, so budget your runs.input_text- the text to speak. The default is Thai (it reads "test speech synthesis"). Vaja is Thai-first; don't expect a lot from other languages.speaker- an integer voice pick, default1, which the README describes as a woman's voice. There's no dropdown; the API expects a number.
That's it. No optional inputs, no hidden settings.
Output
One output: audio, type AUDIO. That plugs straight into anything that eats ComfyUI audio - VHS_VideoCombine (as in the shipped workflow), audio save nodes, or whatever else you have in your chain.
Installing it
Manager may or may not have this indexed (there's no requirements.txt for it to parse), so the reliable path is the clone from the README:
cd ComfyUI/custom_nodes
git clone https://github.com/bablueza/ComfyUI-Vaja-Ai4thai
Then restart ComfyUI. The catch: there's no requirements.txt, so nothing auto-installs. requests ships with ComfyUI, but librosa doesn't, and the node imports it at the top of the file. Install it or the node won't even load:
cd ComfyUI
python -m pip install librosa requests
librosa drags in numba and scipy, so the install is chunky but one-time.
Where people get burned
- No error handling. A bad or expired key gets you a response without
wav_url, and the node just throws aKeyErrorinstead of telling you your key is dead. If it crashes instantly, check the key first. - The hardcoded file path. It always writes
output/vaja_sync_out.wavrelative to ComfyUI's working directory. If that folder doesn't exist you'll hit aFileNotFoundError, and running two of these in parallel means they clobber each other's file. - Quota exhaustion. The free aiforthai tier is rate-limited per day. Mid-batch failures are usually the quota, not your workflow.
It's a fiddly little node - no local model, no error messages, one shared temp file. But for getting real Thai neural speech into a ComfyUI audio pipeline, it's the only game in town. Get a key, wire it to VHS, and keep your runs under quota.
Inputs (3)
| Name | Type | Default | Description |
|---|---|---|---|
| apikey | STRING | — | |
| input_text | STRING | ทดสอบการสังเคราะห์เสียงพูด | — |
| speaker | INT | 1 | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| audio | AUDIO | — |