Difference between revisions of "ComfyUI: Text to Speech"
Onnowpurbo (talk | contribs) (Created page with "Saya sudah membuat workflow **Text-to-Speech Bahasa Indonesia** paling sederhana: [Download workflow JSON ComfyUI TTS Indonesia](sandbox:/mnt/data/comfyui_tts_bahasa_indonesi...") |
Onnowpurbo (talk | contribs) |
||
| Line 1: | Line 1: | ||
| − | + | Berikut catatan instalasi yang telah dibersihkan dari langkah percobaan yang tidak diperlukan. Prosedur ini khusus untuk konfigurasi server Anda. | |
| − | + | # Instalasi ComfyUI EdgeTTS Bahasa Indonesia di Docker | |
| − | Workflow | + | ## 1. Tujuan |
| + | |||
| + | Menambahkan kemampuan *text-to-speech* Bahasa Indonesia pada ComfyUI menggunakan custom node `ComfyUI-EdgeTTS`. | ||
| + | |||
| + | Workflow yang digunakan terdiri dari: | ||
| + | |||
| + | ```text | ||
| + | EdgeTTS → SaveAudio | ||
| + | ``` | ||
| + | |||
| + | Pengaturan awal workflow: | ||
| + | |||
| + | ```text | ||
| + | Teks : Halo, selamat datang. Ini adalah contoh text to speech Bahasa Indonesia menggunakan ComfyUI. | ||
| + | Suara : [Indonesian] id-ID Gadis | ||
| + | Speed : 1.0 | ||
| + | Pitch : 0 | ||
| + | Output : audio/tts_indonesia | ||
| + | ``` | ||
| + | |||
| + | Workflow menggunakan nama internal node: | ||
```text | ```text | ||
| − | + | EdgeTTS | |
| + | SaveAudio | ||
``` | ``` | ||
| − | + | `EdgeTTS` merupakan custom node, sedangkan `SaveAudio` merupakan node bawaan ComfyUI. | |
| + | |||
| + | --- | ||
| + | |||
| + | ## 2. Lingkungan yang digunakan | ||
| + | |||
| + | Konfigurasi yang telah terverifikasi pada server: | ||
| − | + | ```text | |
| + | Folder Docker Compose : /opt/ai-stack | ||
| + | Nama service : comfyui | ||
| + | Folder ComfyUI : /opt/ComfyUI | ||
| + | Folder custom node : /opt/ComfyUI/custom_nodes | ||
| + | Python virtual env : /opt/venv/bin/python | ||
| + | Port ComfyUI : 8188 | ||
| + | PyTorch : 2.11.0+cu128 | ||
| + | Torchaudio : 2.11.0+cu128 | ||
| + | ``` | ||
| − | + | Masuk ke folder proyek: | |
```bash | ```bash | ||
cd /opt/ai-stack | cd /opt/ai-stack | ||
``` | ``` | ||
| + | |||
| + | Pastikan container ComfyUI aktif: | ||
| + | |||
| + | ```bash | ||
| + | docker compose ps comfyui | ||
| + | ``` | ||
| + | |||
| + | Pastikan endpoint ComfyUI dapat diakses: | ||
| + | |||
| + | ```bash | ||
| + | curl -fsS http://127.0.0.1:8188/system_stats \ | ||
| + | | python3 -m json.tool | ||
| + | ``` | ||
| + | |||
| + | --- | ||
| + | |||
| + | ## 3. Penyebab error awal | ||
| + | |||
| + | Workflow awal menampilkan: | ||
| + | |||
| + | ```text | ||
| + | Missing node type | ||
| + | |||
| + | Node 'Edge TTS 🔊' not found. | ||
| + | The custom node may not be installed. | ||
| + | class_type: EdgeTTS | ||
| + | ``` | ||
| + | |||
| + | Artinya backend ComfyUI belum mendaftarkan node dengan nama internal: | ||
| + | |||
| + | ```text | ||
| + | EdgeTTS | ||
| + | ``` | ||
| + | |||
| + | Baris log seperti berikut: | ||
| + | |||
| + | ```text | ||
| + | 0.0 seconds: /opt/ComfyUI/custom_nodes/ComfyUI-EdgeTTS | ||
| + | ``` | ||
| + | |||
| + | hanya menunjukkan bahwa folder custom node telah diperiksa saat startup. Registrasi node harus dipastikan melalui endpoint: | ||
| + | |||
| + | ```text | ||
| + | /object_info/EdgeTTS | ||
| + | ``` | ||
| + | |||
| + | Setelah instalasi selesai, server telah mengembalikan definisi lengkap `EdgeTTS`, termasuk suara Bahasa Indonesia `id-ID Gadis` dan `id-ID Ardi`. Ini membuktikan node sudah terdaftar dengan benar. | ||
| + | |||
| + | --- | ||
| + | |||
| + | # BAGIAN A — INSTALASI | ||
| + | |||
| + | ## 4. Instal dependency sistem | ||
| + | |||
| + | Custom node menggunakan pemrosesan audio. Instal `git`, `ffmpeg`, dan sertifikat CA di dalam container: | ||
| + | |||
| + | ```bash | ||
| + | cd /opt/ai-stack | ||
| + | |||
| + | docker compose exec -u root -T comfyui bash -lc ' | ||
| + | set -e | ||
| + | |||
| + | apt-get update | ||
| + | |||
| + | DEBIAN_FRONTEND=noninteractive apt-get install -y \ | ||
| + | --no-install-recommends \ | ||
| + | git \ | ||
| + | ffmpeg \ | ||
| + | ca-certificates | ||
| + | |||
| + | rm -rf /var/lib/apt/lists/* | ||
| + | ' | ||
| + | ``` | ||
| + | |||
| + | Verifikasi FFmpeg: | ||
| + | |||
| + | ```bash | ||
| + | docker compose exec -T comfyui \ | ||
| + | ffmpeg -version | head -1 | ||
| + | ``` | ||
| + | |||
| + | TorchCodec menggunakan instalasi FFmpeg yang tersedia pada sistem. Dokumentasi resminya menyatakan dukungan untuk FFmpeg versi 4 sampai 8. ([GitHub][1]) | ||
| + | |||
| + | --- | ||
| + | |||
| + | ## 5. Clone custom node ComfyUI-EdgeTTS | ||
Jalankan: | Jalankan: | ||
```bash | ```bash | ||
| − | docker compose exec -u root comfyui bash -lc ' | + | cd /opt/ai-stack |
| + | |||
| + | docker compose exec -u root -T comfyui bash -lc ' | ||
set -e | set -e | ||
cd /opt/ComfyUI/custom_nodes | cd /opt/ComfyUI/custom_nodes | ||
| − | if [ | + | if [ -d ComfyUI-EdgeTTS/.git ]; then |
| − | git clone https://github.com/1038lab/ComfyUI-EdgeTTS.git | + | echo "ComfyUI-EdgeTTS sudah ada. Melakukan update." |
| + | git -C ComfyUI-EdgeTTS pull --ff-only | ||
| + | else | ||
| + | rm -rf ComfyUI-EdgeTTS | ||
| + | |||
| + | git clone --depth 1 \ | ||
| + | https://github.com/1038lab/ComfyUI-EdgeTTS.git | ||
fi | fi | ||
| − | + | echo | |
| − | + | echo "Isi direktori plugin:" | |
| + | ls -lah /opt/ComfyUI/custom_nodes/ComfyUI-EdgeTTS | ||
| + | ' | ||
| + | ``` | ||
| + | |||
| + | Repository resmi memang meminta plugin ditempatkan di dalam folder: | ||
| + | |||
| + | ```text | ||
| + | ComfyUI/custom_nodes | ||
| + | ``` | ||
| + | |||
| + | Plugin menyediakan node `EdgeTTS`, dukungan banyak bahasa, pengaturan kecepatan, pengaturan pitch, dan output audio ComfyUI. ([GitHub][2]) | ||
| + | |||
| + | Pastikan file utama tersedia: | ||
| + | |||
| + | ```bash | ||
| + | docker compose exec -T comfyui bash -lc ' | ||
| + | test -f /opt/ComfyUI/custom_nodes/ComfyUI-EdgeTTS/__init__.py | ||
| + | test -f /opt/ComfyUI/custom_nodes/ComfyUI-EdgeTTS/ailab_edgeTTS.py | ||
| + | test -f /opt/ComfyUI/custom_nodes/ComfyUI-EdgeTTS/config.json | ||
| + | |||
| + | echo "File utama ComfyUI-EdgeTTS tersedia." | ||
' | ' | ||
``` | ``` | ||
| − | + | --- | |
| + | |||
| + | ## 6. Periksa versi PyTorch sebelum memasang TorchCodec | ||
| + | |||
| + | Jalankan: | ||
| + | |||
| + | ```bash | ||
| + | docker compose exec -T comfyui /opt/venv/bin/python - <<'PY' | ||
| + | import torch | ||
| + | import torchaudio | ||
| + | |||
| + | print("torch :", torch.__version__) | ||
| + | print("torchaudio :", torchaudio.__version__) | ||
| + | PY | ||
| + | ``` | ||
| + | |||
| + | Pada server ini hasil yang telah diperoleh adalah: | ||
| + | |||
| + | ```text | ||
| + | torch : 2.11.0+cu128 | ||
| + | torchaudio : 2.11.0+cu128 | ||
| + | ``` | ||
| + | |||
| + | TorchCodec harus disesuaikan dengan versi PyTorch. | ||
| + | |||
| + | Matriks kompatibilitas resmi menyatakan: | ||
| + | |||
| + | ```text | ||
| + | torch 2.11 → torchcodec 0.11 | ||
| + | torch 2.10 → torchcodec 0.10 | ||
| + | torch 2.9 → torchcodec 0.9 | ||
| + | ``` | ||
| + | |||
| + | Karena server menggunakan PyTorch 2.11, gunakan TorchCodec seri `0.11`, bukan `0.9`. ([GitHub][1]) | ||
| + | |||
| + | --- | ||
| + | |||
| + | ## 7. Instal dependency Python untuk EdgeTTS | ||
| + | |||
| + | Untuk workflow TTS ini, instal: | ||
| + | |||
| + | ```bash | ||
| + | cd /opt/ai-stack | ||
| + | |||
| + | docker compose exec -u root -T comfyui \ | ||
| + | /opt/venv/bin/python -m pip install \ | ||
| + | --no-cache-dir \ | ||
| + | --upgrade \ | ||
| + | "edge-tts>=7.0.0" \ | ||
| + | "torchcodec>=0.11,<0.12" | ||
| + | ``` | ||
| + | |||
| + | Jangan menjalankan: | ||
| + | |||
| + | ```bash | ||
| + | pip install -r requirements.txt | ||
| + | ``` | ||
| + | |||
| + | secara langsung pada konfigurasi ini tanpa memeriksa isinya. | ||
| + | |||
| + | `requirements.txt` repository saat ini mencantumkan: | ||
| + | |||
| + | ```text | ||
| + | edge-tts>=7.0.0 | ||
| + | torchaudio | ||
| + | torchcodec==0.9 | ||
| + | openai-whisper | ||
| + | numpy | ||
| + | torch | ||
| + | googletrans-py | ||
| + | deep-translator | ||
| + | ``` | ||
| + | |||
| + | Pin `torchcodec==0.9` ditujukan untuk PyTorch 2.9, sedangkan server menggunakan PyTorch 2.11. Menginstal seluruh file tersebut juga dapat mencoba mengubah instalasi `torch` dan `torchaudio` yang sudah berfungsi. ([GitHub][3]) | ||
| + | |||
| + | Node `EdgeTTS` sendiri mengimpor: | ||
| + | |||
| + | ```text | ||
| + | edge_tts | ||
| + | torch | ||
| + | torchaudio | ||
| + | ``` | ||
| + | |||
| + | dan menggunakan `torchaudio.load()` untuk membaca hasil audio. ([GitHub][4]) | ||
| + | |||
| + | --- | ||
| + | |||
| + | ## 8. Verifikasi dependency Python | ||
| + | |||
| + | Jalankan: | ||
| + | |||
| + | ```bash | ||
| + | docker compose exec -T comfyui /opt/venv/bin/python - <<'PY' | ||
| + | import importlib.metadata as metadata | ||
| + | import torch | ||
| + | import torchaudio | ||
| + | import torchcodec | ||
| + | import edge_tts | ||
| + | |||
| + | packages = [ | ||
| + | "torch", | ||
| + | "torchaudio", | ||
| + | "torchcodec", | ||
| + | "edge-tts", | ||
| + | ] | ||
| + | |||
| + | for package in packages: | ||
| + | try: | ||
| + | print(f"{package:12}: {metadata.version(package)}") | ||
| + | except metadata.PackageNotFoundError: | ||
| + | print(f"{package:12}: NOT INSTALLED") | ||
| + | |||
| + | print() | ||
| + | print("Semua modul utama berhasil di-import.") | ||
| + | PY | ||
| + | ``` | ||
| + | |||
| + | Hasil yang diharapkan kurang lebih: | ||
| + | |||
| + | ```text | ||
| + | torch : 2.11.0 | ||
| + | torchaudio : 2.11.0 | ||
| + | torchcodec : 0.11.x | ||
| + | edge-tts : 7.x.x | ||
| + | |||
| + | Semua modul utama berhasil di-import. | ||
| + | ``` | ||
| + | |||
| + | Nomor revisi kecil dapat berbeda, tetapi kombinasi utamanya harus: | ||
| + | |||
| + | ```text | ||
| + | torch 2.11.x | ||
| + | torchcodec 0.11.x | ||
| + | ``` | ||
| + | |||
| + | --- | ||
| + | |||
| + | ## 9. Restart ComfyUI | ||
```bash | ```bash | ||
| + | cd /opt/ai-stack | ||
| + | |||
docker compose restart comfyui | docker compose restart comfyui | ||
``` | ``` | ||
| − | + | Pantau startup: | |
| + | |||
| + | ```bash | ||
| + | docker compose logs -f comfyui | ||
| + | ``` | ||
| + | |||
| + | Hentikan tampilan log dengan: | ||
| − | Periksa | + | ```text |
| + | Ctrl+C | ||
| + | ``` | ||
| + | |||
| + | Periksa error terbaru: | ||
```bash | ```bash | ||
| − | docker compose logs -- | + | docker compose logs --since=5m comfyui \ |
| + | | grep -Ei \ | ||
| + | 'EdgeTTS|ComfyUI-EdgeTTS|torchcodec|error loading|import failed|traceback|exception' | ||
``` | ``` | ||
| − | + | Baris berikut bukan error: | |
```text | ```text | ||
| − | EdgeTTS | + | 0.0 seconds: /opt/ComfyUI/custom_nodes/ComfyUI-EdgeTTS |
| − | |||
``` | ``` | ||
| − | + | Baris tersebut merupakan informasi waktu pemuatan plugin. | |
| − | + | --- | |
| + | |||
| + | # BAGIAN B — VERIFIKASI | ||
| + | |||
| + | ## 10. Pastikan node EdgeTTS terdaftar | ||
| + | |||
| + | Jalankan: | ||
| + | |||
| + | ```bash | ||
| + | curl -fsS http://127.0.0.1:8188/object_info/EdgeTTS \ | ||
| + | | python3 -c ' | ||
| + | import json | ||
| + | import sys | ||
| + | |||
| + | data = json.load(sys.stdin) | ||
| + | |||
| + | if "EdgeTTS" not in data: | ||
| + | raise SystemExit("GAGAL: EdgeTTS belum terdaftar") | ||
| + | |||
| + | node = data["EdgeTTS"] | ||
| + | |||
| + | print("STATUS : OK") | ||
| + | print("NAME :", node.get("name")) | ||
| + | print("DISPLAY NAME :", node.get("display_name")) | ||
| + | print("MODULE :", node.get("python_module")) | ||
| + | print("OUTPUT :", node.get("output")) | ||
| + | ' | ||
| + | ``` | ||
| + | |||
| + | Hasil yang benar: | ||
```text | ```text | ||
| − | + | STATUS : OK | |
| + | NAME : EdgeTTS | ||
| + | DISPLAY NAME : Edge TTS 🔊 | ||
| + | MODULE : custom_nodes.ComfyUI-EdgeTTS | ||
| + | OUTPUT : ['AUDIO'] | ||
``` | ``` | ||
| − | + | Ini merupakan pemeriksaan paling penting. | |
| + | |||
| + | Jika endpoint tersebut mengembalikan definisi node, backend ComfyUI sudah mengenali `EdgeTTS`. | ||
| + | |||
| + | --- | ||
| + | |||
| + | ## 11. Pastikan SaveAudio tersedia | ||
| + | |||
| + | Jalankan: | ||
| + | |||
| + | ```bash | ||
| + | curl -fsS http://127.0.0.1:8188/object_info/SaveAudio \ | ||
| + | | python3 -c ' | ||
| + | import json | ||
| + | import sys | ||
| + | |||
| + | data = json.load(sys.stdin) | ||
| + | |||
| + | if "SaveAudio" not in data: | ||
| + | raise SystemExit("GAGAL: SaveAudio tidak tersedia") | ||
| + | |||
| + | print("STATUS : OK") | ||
| + | print("NODE : SaveAudio") | ||
| + | ' | ||
| + | ``` | ||
| + | |||
| + | `SaveAudio` merupakan node bawaan ComfyUI yang menerima input `AUDIO` dan menyimpan hasil sebagai file FLAC. ([ComfyUI][5]) | ||
| + | |||
| + | --- | ||
| + | |||
| + | ## 12. Verifikasi suara Bahasa Indonesia | ||
| + | |||
| + | Karena Edge TTS menggunakan layanan online, container harus dapat mengakses internet. | ||
| + | |||
| + | Jalankan: | ||
| + | |||
| + | ```bash | ||
| + | docker compose exec -T comfyui \ | ||
| + | /opt/venv/bin/edge-tts --list-voices \ | ||
| + | | grep -E 'id-ID-(Gadis|Ardi)Neural' | ||
| + | ``` | ||
| + | |||
| + | Hasil harus memuat suara seperti: | ||
```text | ```text | ||
| − | + | id-ID-ArdiNeural | |
| + | id-ID-GadisNeural | ||
| + | ``` | ||
| + | |||
| + | Program resmi `edge-tts` menyediakan opsi `--list-voices` untuk memperoleh daftar suara yang tersedia dari layanan Edge TTS. ([GitHub][6]) | ||
| + | |||
| + | Jika perintah ini gagal akibat koneksi, periksa: | ||
| + | |||
| + | ```bash | ||
| + | docker compose exec -T comfyui \ | ||
| + | getent hosts speech.platform.bing.com | ||
| + | ``` | ||
| + | |||
| + | Edge TTS bukan TTS lokal atau offline. Plugin menggunakan layanan text-to-speech online Microsoft Edge. ([GitHub][4]) | ||
| + | |||
| + | --- | ||
| + | |||
| + | # BAGIAN C — PENGUJIAN | ||
| + | |||
| + | ## 13. Uji EdgeTTS langsung melalui ComfyUI API | ||
| + | |||
| + | Jalankan: | ||
| + | |||
| + | ```bash | ||
| + | curl -fsS \ | ||
| + | -X POST \ | ||
| + | http://127.0.0.1:8188/prompt \ | ||
| + | -H 'Content-Type: application/json' \ | ||
| + | -d '{ | ||
| + | "prompt": { | ||
| + | "1": { | ||
| + | "class_type": "EdgeTTS", | ||
| + | "inputs": { | ||
| + | "text": "Halo, ini adalah pengujian text to speech Bahasa Indonesia menggunakan ComfyUI.", | ||
| + | "voice": "[Indonesian] id-ID Gadis", | ||
| + | "speed": 1.0, | ||
| + | "pitch": 0 | ||
| + | } | ||
| + | }, | ||
| + | "2": { | ||
| + | "class_type": "SaveAudio", | ||
| + | "inputs": { | ||
| + | "audio": [ | ||
| + | "1", | ||
| + | 0 | ||
| + | ], | ||
| + | "filename_prefix": "audio/tts_indonesia_test" | ||
| + | } | ||
| + | } | ||
| + | } | ||
| + | }' \ | ||
| + | | python3 -m json.tool | ||
``` | ``` | ||
| − | + | Respons yang benar akan memuat: | |
| + | |||
| + | ```json | ||
| + | { | ||
| + | "prompt_id": "...", | ||
| + | "number": 1, | ||
| + | "node_errors": {} | ||
| + | } | ||
| + | ``` | ||
| − | + | `prompt_id` akan berbeda pada setiap eksekusi. | |
| − | + | Pantau proses: | |
| + | |||
| + | ```bash | ||
| + | docker compose logs -f comfyui | ||
| + | ``` | ||
| + | |||
| + | --- | ||
| + | |||
| + | ## 14. Cari hasil audio | ||
| + | |||
| + | Jalankan: | ||
| + | |||
| + | ```bash | ||
| + | docker compose exec -T comfyui \ | ||
| + | find /opt/ComfyUI/output \ | ||
| + | -type f \ | ||
| + | -iname '*tts_indonesia_test*' \ | ||
| + | -printf '%TY-%Tm-%Td %TH:%TM:%TS %p\n' \ | ||
| + | | sort | ||
| + | ``` | ||
| + | |||
| + | Lokasi hasil umumnya berada di bawah: | ||
```text | ```text | ||
| − | + | /opt/ComfyUI/output/audio/ | |
``` | ``` | ||
| − | + | Karena prefix yang digunakan adalah: | |
| + | |||
| + | ```text | ||
| + | audio/tts_indonesia_test | ||
| + | ``` | ||
| + | |||
| + | File hasil `SaveAudio` menggunakan format FLAC. | ||
| + | |||
| + | Untuk melihat file terakhir: | ||
| + | |||
| + | ```bash | ||
| + | docker compose exec -T comfyui bash -lc ' | ||
| + | find /opt/ComfyUI/output/audio \ | ||
| + | -type f \ | ||
| + | -iname "*tts_indonesia_test*" \ | ||
| + | -printf "%T@ %p\n" \ | ||
| + | | sort -n \ | ||
| + | | tail -1 \ | ||
| + | | cut -d" " -f2- | ||
| + | ' | ||
| + | ``` | ||
| + | |||
| + | --- | ||
| + | |||
| + | # BAGIAN D — MENJALANKAN WORKFLOW DI BROWSER | ||
| + | |||
| + | ## 15. Buka ComfyUI | ||
| + | |||
| + | Buka dari komputer pengguna: | ||
| + | |||
| + | ```text | ||
| + | http://IP-SERVER5:8188 | ||
| + | ``` | ||
| + | |||
| + | Ganti `IP-SERVER5` dengan alamat IP server. | ||
| + | |||
| + | Setelah plugin baru dipasang: | ||
| + | |||
| + | 1. Tutup tab ComfyUI lama. | ||
| + | 2. Buka kembali ComfyUI. | ||
| + | 3. Tekan `Ctrl+Shift+R`. | ||
| + | 4. Load ulang workflow JSON. | ||
| + | 5. Pastikan node `Edge TTS 🔊` tidak berwarna merah. | ||
| + | 6. Pilih suara: | ||
```text | ```text | ||
| Line 87: | Line 586: | ||
``` | ``` | ||
| − | + | atau: | |
```text | ```text | ||
| Line 93: | Line 592: | ||
``` | ``` | ||
| − | + | 7. Hubungkan output `AUDIO` dari `EdgeTTS` ke input `audio` pada `SaveAudio`. | |
| + | 8. Klik **Queue Prompt** atau **Run**. | ||
| + | |||
| + | Node `EdgeTTS` resmi menghasilkan output bertipe `AUDIO`, sehingga dapat langsung dihubungkan ke `SaveAudio`. ([GitHub][4]) | ||
| + | |||
| + | --- | ||
| + | |||
| + | # BAGIAN E — TROUBLESHOOTING | ||
| + | |||
| + | ## 16. Error “Missing node type” masih terlihat di log | ||
| + | |||
| + | Perintah: | ||
| + | |||
| + | ```bash | ||
| + | docker compose logs --tail=200 comfyui | ||
| + | ``` | ||
| + | |||
| + | dapat menampilkan peringatan lama yang tercatat sebelum node berhasil dipasang. | ||
| + | |||
| + | Gunakan log berdasarkan waktu: | ||
| + | |||
| + | ```bash | ||
| + | docker compose logs --since=2m comfyui \ | ||
| + | | grep -Ei \ | ||
| + | 'missing_node_type|EdgeTTS|error|exception|traceback' | ||
| + | ``` | ||
| + | |||
| + | Jika: | ||
| + | |||
| + | ```bash | ||
| + | curl -fsS http://127.0.0.1:8188/object_info/EdgeTTS | ||
| + | ``` | ||
| + | |||
| + | sudah mengembalikan definisi lengkap `EdgeTTS`, backend sudah benar. Peringatan lama di log tidak berarti error masih aktif. Kondisi inilah yang terverifikasi pada server setelah instalasi. | ||
| + | |||
| + | --- | ||
| + | |||
| + | ## 17. Backend mengenali EdgeTTS, tetapi browser masih menampilkan node hilang | ||
| + | |||
| + | Kemungkinan browser masih menyimpan definisi node lama atau browser membuka instance ComfyUI yang berbeda. | ||
| + | |||
| + | Lakukan: | ||
| + | |||
| + | ```text | ||
| + | Ctrl+Shift+R | ||
| + | ``` | ||
| + | |||
| + | Kemudian pastikan alamat browser menggunakan server dan port yang benar: | ||
| + | |||
| + | ```text | ||
| + | http://IP-SERVER5:8188 | ||
| + | ``` | ||
| + | |||
| + | Bila masih bermasalah: | ||
| + | |||
| + | 1. Tekan `F12`. | ||
| + | 2. Buka tab **Application**. | ||
| + | 3. Pilih **Storage**. | ||
| + | 4. Klik **Clear site data**. | ||
| + | 5. Tutup tab. | ||
| + | 6. Buka kembali ComfyUI. | ||
| + | |||
| + | Tidak perlu mengubah workflow apabila backend sudah mengembalikan: | ||
| + | |||
| + | ```text | ||
| + | /object_info/EdgeTTS | ||
| + | ``` | ||
| + | |||
| + | --- | ||
| + | |||
| + | ## 18. Node tersedia tetapi audio kosong atau sangat pendek | ||
| + | |||
| + | Periksa log: | ||
| + | |||
| + | ```bash | ||
| + | docker compose logs --since=5m comfyui \ | ||
| + | | grep -Ei \ | ||
| + | 'TTS Error|NoAudioReceived|torchcodec|ffmpeg|audio|exception|traceback' | ||
| + | ``` | ||
| + | |||
| + | Kode plugin menangkap error TTS dan, pada kondisi gagal, dapat mengembalikan waveform kosong sepanjang satu detik. Karena itu workflow bisa terlihat selesai walaupun layanan TTS sebenarnya gagal. ([GitHub][4]) | ||
| + | |||
| + | Penyebab yang harus diperiksa: | ||
| + | |||
| + | ```text | ||
| + | Koneksi internet dari container | ||
| + | DNS container | ||
| + | Layanan Edge TTS tidak dapat dijangkau | ||
| + | TorchCodec tidak cocok dengan PyTorch | ||
| + | FFmpeg tidak tersedia | ||
| + | Voice ID sudah berubah atau tidak tersedia | ||
| + | ``` | ||
| + | |||
| + | Uji layanan Edge TTS secara langsung: | ||
| + | |||
| + | ```bash | ||
| + | docker compose exec -T comfyui \ | ||
| + | /opt/venv/bin/edge-tts \ | ||
| + | --voice id-ID-GadisNeural \ | ||
| + | --text "Halo, ini adalah pengujian suara Bahasa Indonesia." \ | ||
| + | --write-media /tmp/edgetts-test.mp3 | ||
| + | ``` | ||
| + | |||
| + | Periksa file: | ||
| + | |||
| + | ```bash | ||
| + | docker compose exec -T comfyui \ | ||
| + | ls -lh /tmp/edgetts-test.mp3 | ||
| + | ``` | ||
| + | |||
| + | Jika file terbentuk dan ukurannya lebih dari nol, layanan Edge TTS berfungsi. | ||
| + | |||
| + | Hapus file uji: | ||
| + | |||
| + | ```bash | ||
| + | docker compose exec -T comfyui \ | ||
| + | rm -f /tmp/edgetts-test.mp3 | ||
| + | ``` | ||
| + | |||
| + | --- | ||
| + | |||
| + | ## 19. TorchCodec gagal di-import | ||
| + | |||
| + | Periksa versi: | ||
| + | |||
| + | ```bash | ||
| + | docker compose exec -T comfyui /opt/venv/bin/python - <<'PY' | ||
| + | import importlib.metadata as metadata | ||
| + | import torch | ||
| + | import torchaudio | ||
| + | |||
| + | print("torch :", torch.__version__) | ||
| + | print("torchaudio :", torchaudio.__version__) | ||
| + | |||
| + | try: | ||
| + | print("torchcodec :", metadata.version("torchcodec")) | ||
| + | except metadata.PackageNotFoundError: | ||
| + | print("torchcodec : NOT INSTALLED") | ||
| + | PY | ||
| + | ``` | ||
| + | |||
| + | Untuk server ini, instal ulang seri yang sesuai: | ||
| + | |||
| + | ```bash | ||
| + | docker compose exec -u root -T comfyui \ | ||
| + | /opt/venv/bin/python -m pip uninstall -y torchcodec | ||
| + | ``` | ||
| + | |||
| + | ```bash | ||
| + | docker compose exec -u root -T comfyui \ | ||
| + | /opt/venv/bin/python -m pip install \ | ||
| + | --no-cache-dir \ | ||
| + | "torchcodec>=0.11,<0.12" | ||
| + | ``` | ||
| + | |||
| + | Kemudian restart: | ||
| + | |||
| + | ```bash | ||
| + | docker compose restart comfyui | ||
| + | ``` | ||
| + | |||
| + | Jangan memasang `torchcodec==0.9` pada PyTorch 2.11 karena matriks kompatibilitas resmi memasangkan TorchCodec 0.9 dengan PyTorch 2.9. ([GitHub][1]) | ||
| + | |||
| + | --- | ||
| + | |||
| + | ## 20. Plugin tidak muncul pada object_info | ||
| + | |||
| + | Periksa isi plugin: | ||
| + | |||
| + | ```bash | ||
| + | docker compose exec -T comfyui bash -lc ' | ||
| + | ls -lah /opt/ComfyUI/custom_nodes/ComfyUI-EdgeTTS | ||
| + | |||
| + | grep -Rni "EdgeTTS" \ | ||
| + | /opt/ComfyUI/custom_nodes/ComfyUI-EdgeTTS \ | ||
| + | --include="*.py" \ | ||
| + | | head -30 | ||
| + | ' | ||
| + | ``` | ||
| + | |||
| + | Uji modul node secara langsung: | ||
| + | |||
| + | ```bash | ||
| + | docker compose exec -T comfyui /opt/venv/bin/python - <<'PY' | ||
| + | import sys | ||
| + | import traceback | ||
| + | |||
| + | plugin_path = "/opt/ComfyUI/custom_nodes/ComfyUI-EdgeTTS" | ||
| + | sys.path.insert(0, plugin_path) | ||
| + | |||
| + | try: | ||
| + | import ailab_edgeTTS | ||
| + | |||
| + | print("Import ailab_edgeTTS: OK") | ||
| + | print( | ||
| + | "Node mappings:", | ||
| + | list(ailab_edgeTTS.NODE_CLASS_MAPPINGS.keys()) | ||
| + | ) | ||
| + | except Exception: | ||
| + | print("Import ailab_edgeTTS: GAGAL") | ||
| + | traceback.print_exc() | ||
| + | raise | ||
| + | PY | ||
| + | ``` | ||
| + | |||
| + | Hasil yang benar: | ||
| + | |||
| + | ```text | ||
| + | Import ailab_edgeTTS: OK | ||
| + | Node mappings: ['EdgeTTS'] | ||
| + | ``` | ||
| + | |||
| + | Kode resmi plugin mendaftarkan: | ||
| + | |||
| + | ```python | ||
| + | NODE_CLASS_MAPPINGS = { | ||
| + | "EdgeTTS": EdgeTTS | ||
| + | } | ||
| + | ``` | ||
| + | |||
| + | Karena itu nama internal workflow harus tetap: | ||
| + | |||
| + | ```text | ||
| + | EdgeTTS | ||
| + | ``` | ||
| + | |||
| + | bukan: | ||
```text | ```text | ||
| − | + | Edge TTS | |
| + | Edge TTS 🔊 | ||
| + | ComfyUI-EdgeTTS | ||
| + | ``` | ||
| + | |||
| + | ([GitHub][4]) | ||
| + | |||
| + | --- | ||
| + | |||
| + | # BAGIAN F — PEMELIHARAAN | ||
| + | |||
| + | ## 21. Update plugin | ||
| + | |||
| + | Untuk memperbarui plugin: | ||
| + | |||
| + | ```bash | ||
| + | cd /opt/ai-stack | ||
| + | |||
| + | docker compose exec -u root -T comfyui bash -lc ' | ||
| + | set -e | ||
| + | |||
| + | git -C /opt/ComfyUI/custom_nodes/ComfyUI-EdgeTTS \ | ||
| + | pull --ff-only | ||
| + | ' | ||
| + | ``` | ||
| + | |||
| + | Setelah update, jangan langsung menjalankan seluruh `requirements.txt` tanpa mengecek perubahan versi. | ||
| + | |||
| + | Tampilkan isi dependency terbaru: | ||
| + | |||
| + | ```bash | ||
| + | docker compose exec -T comfyui bash -lc ' | ||
| + | cat /opt/ComfyUI/custom_nodes/ComfyUI-EdgeTTS/requirements.txt | ||
| + | ' | ||
| + | ``` | ||
| + | |||
| + | Periksa kembali kompatibilitas: | ||
| + | |||
| + | ```bash | ||
| + | docker compose exec -T comfyui /opt/venv/bin/python - <<'PY' | ||
| + | import importlib.metadata as metadata | ||
| + | import torch | ||
| + | |||
| + | print("torch :", torch.__version__) | ||
| + | print("torchcodec :", metadata.version("torchcodec")) | ||
| + | print("edge-tts :", metadata.version("edge-tts")) | ||
| + | PY | ||
| + | ``` | ||
| + | |||
| + | Restart: | ||
| + | |||
| + | ```bash | ||
| + | docker compose restart comfyui | ||
| + | ``` | ||
| + | |||
| + | Verifikasi: | ||
| + | |||
| + | ```bash | ||
| + | curl -fsS http://127.0.0.1:8188/object_info/EdgeTTS \ | ||
| + | | python3 -m json.tool \ | ||
| + | | head -50 | ||
| + | ``` | ||
| + | |||
| + | --- | ||
| + | |||
| + | ## 22. Catatan persistensi Docker | ||
| + | |||
| + | Perintah instalasi di atas memasang plugin dan paket ke dalam filesystem container yang sedang berjalan. | ||
| + | |||
| + | Perubahan dalam writable layer container dapat hilang ketika container dihapus dan dibuat ulang. Volume atau bind mount diperlukan agar file bertahan di luar lifecycle container, atau instalasi harus dimasukkan ke dalam Dockerfile. ([Docker Documentation][7]) | ||
| + | |||
| + | Periksa apakah folder custom node memakai mount: | ||
| + | |||
| + | ```bash | ||
| + | docker inspect "$(docker compose ps -q comfyui)" \ | ||
| + | --format '{{range .Mounts}}{{println .Source "->" .Destination}}{{end}}' | ||
| + | ``` | ||
| + | |||
| + | Cari tujuan: | ||
| + | |||
| + | ```text | ||
| + | /opt/ComfyUI/custom_nodes | ||
| + | ``` | ||
| + | |||
| + | Jika folder tersebut tidak menggunakan volume atau bind mount, plugin harus dimasukkan ke Dockerfile agar tidak hilang setelah container dibuat ulang. | ||
| + | |||
| + | Hal yang sama berlaku untuk paket Python di: | ||
| + | |||
| + | ```text | ||
| + | /opt/venv | ||
| + | ``` | ||
| + | |||
| + | Instalasi permanen harus memasukkan langkah berikut ke proses build image, setelah `/opt/venv` dan `/opt/ComfyUI` tersedia: | ||
| + | |||
| + | ```dockerfile | ||
| + | RUN apt-get update \ | ||
| + | && apt-get install -y --no-install-recommends \ | ||
| + | git \ | ||
| + | ffmpeg \ | ||
| + | ca-certificates \ | ||
| + | && rm -rf /var/lib/apt/lists/* | ||
| + | |||
| + | RUN git clone --depth 1 \ | ||
| + | https://github.com/1038lab/ComfyUI-EdgeTTS.git \ | ||
| + | /opt/ComfyUI/custom_nodes/ComfyUI-EdgeTTS | ||
| + | |||
| + | RUN /opt/venv/bin/python -m pip install \ | ||
| + | --no-cache-dir \ | ||
| + | "edge-tts>=7.0.0" \ | ||
| + | "torchcodec>=0.11,<0.12" | ||
| + | ``` | ||
| + | |||
| + | Setelah Dockerfile diperbarui: | ||
| + | |||
| + | ```bash | ||
| + | cd /opt/ai-stack | ||
| + | |||
| + | docker compose build comfyui | ||
| + | docker compose up -d comfyui | ||
| + | ``` | ||
| + | |||
| + | Verifikasi ulang: | ||
| + | |||
| + | ```bash | ||
| + | curl -fsS http://127.0.0.1:8188/object_info/EdgeTTS \ | ||
| + | | python3 -m json.tool \ | ||
| + | | head -50 | ||
| + | ``` | ||
| + | |||
| + | --- | ||
| + | |||
| + | # BAGIAN G — RINGKASAN PERINTAH UTAMA | ||
| + | |||
| + | ## 23. Instalasi ringkas | ||
| + | |||
| + | ```bash | ||
| + | cd /opt/ai-stack | ||
| + | ``` | ||
| + | |||
| + | ```bash | ||
| + | docker compose exec -u root -T comfyui bash -lc ' | ||
| + | set -e | ||
| + | |||
| + | apt-get update | ||
| + | |||
| + | DEBIAN_FRONTEND=noninteractive apt-get install -y \ | ||
| + | --no-install-recommends \ | ||
| + | git \ | ||
| + | ffmpeg \ | ||
| + | ca-certificates | ||
| + | |||
| + | rm -rf /var/lib/apt/lists/* | ||
| + | |||
| + | cd /opt/ComfyUI/custom_nodes | ||
| + | |||
| + | if [ -d ComfyUI-EdgeTTS/.git ]; then | ||
| + | git -C ComfyUI-EdgeTTS pull --ff-only | ||
| + | else | ||
| + | rm -rf ComfyUI-EdgeTTS | ||
| + | |||
| + | git clone --depth 1 \ | ||
| + | https://github.com/1038lab/ComfyUI-EdgeTTS.git | ||
| + | fi | ||
| + | ' | ||
| + | ``` | ||
| + | |||
| + | ```bash | ||
| + | docker compose exec -u root -T comfyui \ | ||
| + | /opt/venv/bin/python -m pip install \ | ||
| + | --no-cache-dir \ | ||
| + | --upgrade \ | ||
| + | "edge-tts>=7.0.0" \ | ||
| + | "torchcodec>=0.11,<0.12" | ||
| + | ``` | ||
| + | |||
| + | ```bash | ||
| + | docker compose restart comfyui | ||
| + | ``` | ||
| + | |||
| + | ```bash | ||
| + | curl -fsS http://127.0.0.1:8188/object_info/EdgeTTS \ | ||
| + | | python3 -m json.tool \ | ||
| + | | head -80 | ||
``` | ``` | ||
| − | + | --- | |
| − | # | + | # 24. Kondisi akhir yang benar |
| − | + | Instalasi dinyatakan berhasil jika seluruh kondisi berikut terpenuhi: | |
```text | ```text | ||
| − | /opt/ComfyUI/output/ | + | Container comfyui aktif. |
| + | FFmpeg tersedia di dalam container. | ||
| + | edge-tts berhasil di-import. | ||
| + | torchcodec 0.11.x terpasang. | ||
| + | PyTorch tetap 2.11.x. | ||
| + | Torchaudio tetap 2.11.x. | ||
| + | Endpoint /object_info/EdgeTTS mengembalikan node EdgeTTS. | ||
| + | Endpoint /object_info/SaveAudio mengembalikan SaveAudio. | ||
| + | Daftar suara memuat id-ID-GadisNeural dan id-ID-ArdiNeural. | ||
| + | Workflow tidak lagi menghasilkan missing_node_type. | ||
| + | File audio tersimpan di /opt/ComfyUI/output/audio. | ||
``` | ``` | ||
| − | + | Pada pemeriksaan terakhir server Anda, endpoint `object_info/EdgeTTS` sudah mengembalikan node lengkap dengan: | |
```text | ```text | ||
| − | + | name : EdgeTTS | |
| − | + | display_name : Edge TTS 🔊 | |
| − | + | python_module : custom_nodes.ComfyUI-EdgeTTS | |
| + | output : AUDIO | ||
``` | ``` | ||
| − | + | Dengan demikian masalah `Missing node type` pada backend telah selesai. | |
| − | ** | + | Catatan ini memakai prosedur minimal untuk **TTS Bahasa Indonesia**, tanpa memasang ulang PyTorch, Torchaudio, Whisper, atau dependency lain yang tidak diperlukan oleh workflow tersebut. |
| − | [1]: https://github.com/ | + | [1]: https://github.com/meta-pytorch/torchcodec "GitHub - meta-pytorch/torchcodec: PyTorch media decoding and encoding · GitHub" |
[2]: https://github.com/1038lab/ComfyUI-EdgeTTS "GitHub - 1038lab/ComfyUI-EdgeTTS: ComfyUI-EdgeTTS is a powerful text-to-speech node for ComfyUI, leveraging Microsoft's Edge TTS capabilities. It enables seamless conversion of text into natural-sounding speech, supporting multiple languages and voices. Ideal for enhancing user interactions, this node is easy to integrate and customize, making it perfect for various applications. · GitHub" | [2]: https://github.com/1038lab/ComfyUI-EdgeTTS "GitHub - 1038lab/ComfyUI-EdgeTTS: ComfyUI-EdgeTTS is a powerful text-to-speech node for ComfyUI, leveraging Microsoft's Edge TTS capabilities. It enables seamless conversion of text into natural-sounding speech, supporting multiple languages and voices. Ideal for enhancing user interactions, this node is easy to integrate and customize, making it perfect for various applications. · GitHub" | ||
| − | [3]: https:// | + | [3]: https://github.com/1038lab/ComfyUI-EdgeTTS/blob/main/requirements.txt "ComfyUI-EdgeTTS/requirements.txt at main · 1038lab/ComfyUI-EdgeTTS · GitHub" |
| − | [4]: https://github.com/1038lab/ComfyUI-EdgeTTS/blob/main/ | + | [4]: https://github.com/1038lab/ComfyUI-EdgeTTS/blob/main/ailab_edgeTTS.py "ComfyUI-EdgeTTS/ailab_edgeTTS.py at main · 1038lab/ComfyUI-EdgeTTS · GitHub" |
| − | [5]: https://github.com/rany2/edge-tts?utm_source=chatgpt.com " | + | [5]: https://docs.comfy.org/built-in-nodes/SaveAudio?utm_source=chatgpt.com "SaveAudio - ComfyUI Built-in Node Documentation" |
| + | [6]: https://github.com/rany2/edge-tts/blob/master/README.md?utm_source=chatgpt.com "README.md - rany2/edge-tts" | ||
| + | [7]: https://docs.docker.com/get-started/docker-concepts/running-containers/persisting-container-data/?utm_source=chatgpt.com "Persisting container data | Docker Docs" | ||
Latest revision as of 09:38, 24 July 2026
Berikut catatan instalasi yang telah dibersihkan dari langkah percobaan yang tidak diperlukan. Prosedur ini khusus untuk konfigurasi server Anda.
- Instalasi ComfyUI EdgeTTS Bahasa Indonesia di Docker
- 1. Tujuan
Menambahkan kemampuan *text-to-speech* Bahasa Indonesia pada ComfyUI menggunakan custom node `ComfyUI-EdgeTTS`.
Workflow yang digunakan terdiri dari:
```text EdgeTTS → SaveAudio ```
Pengaturan awal workflow:
```text Teks : Halo, selamat datang. Ini adalah contoh text to speech Bahasa Indonesia menggunakan ComfyUI. Suara : [Indonesian] id-ID Gadis Speed : 1.0 Pitch : 0 Output : audio/tts_indonesia ```
Workflow menggunakan nama internal node:
```text EdgeTTS SaveAudio ```
`EdgeTTS` merupakan custom node, sedangkan `SaveAudio` merupakan node bawaan ComfyUI.
---
- 2. Lingkungan yang digunakan
Konfigurasi yang telah terverifikasi pada server:
```text Folder Docker Compose : /opt/ai-stack Nama service : comfyui Folder ComfyUI : /opt/ComfyUI Folder custom node : /opt/ComfyUI/custom_nodes Python virtual env : /opt/venv/bin/python Port ComfyUI : 8188 PyTorch : 2.11.0+cu128 Torchaudio : 2.11.0+cu128 ```
Masuk ke folder proyek:
```bash cd /opt/ai-stack ```
Pastikan container ComfyUI aktif:
```bash docker compose ps comfyui ```
Pastikan endpoint ComfyUI dapat diakses:
```bash curl -fsS http://127.0.0.1:8188/system_stats \
| python3 -m json.tool
```
---
- 3. Penyebab error awal
Workflow awal menampilkan:
```text Missing node type
Node 'Edge TTS 🔊' not found. The custom node may not be installed. class_type: EdgeTTS ```
Artinya backend ComfyUI belum mendaftarkan node dengan nama internal:
```text EdgeTTS ```
Baris log seperti berikut:
```text 0.0 seconds: /opt/ComfyUI/custom_nodes/ComfyUI-EdgeTTS ```
hanya menunjukkan bahwa folder custom node telah diperiksa saat startup. Registrasi node harus dipastikan melalui endpoint:
```text /object_info/EdgeTTS ```
Setelah instalasi selesai, server telah mengembalikan definisi lengkap `EdgeTTS`, termasuk suara Bahasa Indonesia `id-ID Gadis` dan `id-ID Ardi`. Ini membuktikan node sudah terdaftar dengan benar.
---
- BAGIAN A — INSTALASI
- 4. Instal dependency sistem
Custom node menggunakan pemrosesan audio. Instal `git`, `ffmpeg`, dan sertifikat CA di dalam container:
```bash cd /opt/ai-stack
docker compose exec -u root -T comfyui bash -lc ' set -e
apt-get update
DEBIAN_FRONTEND=noninteractive apt-get install -y \
--no-install-recommends \ git \ ffmpeg \ ca-certificates
rm -rf /var/lib/apt/lists/* ' ```
Verifikasi FFmpeg:
```bash docker compose exec -T comfyui \
ffmpeg -version | head -1
```
TorchCodec menggunakan instalasi FFmpeg yang tersedia pada sistem. Dokumentasi resminya menyatakan dukungan untuk FFmpeg versi 4 sampai 8. ([GitHub][1])
---
- 5. Clone custom node ComfyUI-EdgeTTS
Jalankan:
```bash cd /opt/ai-stack
docker compose exec -u root -T comfyui bash -lc ' set -e
cd /opt/ComfyUI/custom_nodes
if [ -d ComfyUI-EdgeTTS/.git ]; then
echo "ComfyUI-EdgeTTS sudah ada. Melakukan update." git -C ComfyUI-EdgeTTS pull --ff-only
else
rm -rf ComfyUI-EdgeTTS
git clone --depth 1 \
https://github.com/1038lab/ComfyUI-EdgeTTS.git
fi
echo echo "Isi direktori plugin:" ls -lah /opt/ComfyUI/custom_nodes/ComfyUI-EdgeTTS ' ```
Repository resmi memang meminta plugin ditempatkan di dalam folder:
```text ComfyUI/custom_nodes ```
Plugin menyediakan node `EdgeTTS`, dukungan banyak bahasa, pengaturan kecepatan, pengaturan pitch, dan output audio ComfyUI. ([GitHub][2])
Pastikan file utama tersedia:
```bash docker compose exec -T comfyui bash -lc ' test -f /opt/ComfyUI/custom_nodes/ComfyUI-EdgeTTS/__init__.py test -f /opt/ComfyUI/custom_nodes/ComfyUI-EdgeTTS/ailab_edgeTTS.py test -f /opt/ComfyUI/custom_nodes/ComfyUI-EdgeTTS/config.json
echo "File utama ComfyUI-EdgeTTS tersedia." ' ```
---
- 6. Periksa versi PyTorch sebelum memasang TorchCodec
Jalankan:
```bash docker compose exec -T comfyui /opt/venv/bin/python - <<'PY' import torch import torchaudio
print("torch :", torch.__version__) print("torchaudio :", torchaudio.__version__) PY ```
Pada server ini hasil yang telah diperoleh adalah:
```text torch : 2.11.0+cu128 torchaudio : 2.11.0+cu128 ```
TorchCodec harus disesuaikan dengan versi PyTorch.
Matriks kompatibilitas resmi menyatakan:
```text torch 2.11 → torchcodec 0.11 torch 2.10 → torchcodec 0.10 torch 2.9 → torchcodec 0.9 ```
Karena server menggunakan PyTorch 2.11, gunakan TorchCodec seri `0.11`, bukan `0.9`. ([GitHub][1])
---
- 7. Instal dependency Python untuk EdgeTTS
Untuk workflow TTS ini, instal:
```bash cd /opt/ai-stack
docker compose exec -u root -T comfyui \
/opt/venv/bin/python -m pip install \ --no-cache-dir \ --upgrade \ "edge-tts>=7.0.0" \ "torchcodec>=0.11,<0.12"
```
Jangan menjalankan:
```bash pip install -r requirements.txt ```
secara langsung pada konfigurasi ini tanpa memeriksa isinya.
`requirements.txt` repository saat ini mencantumkan:
```text edge-tts>=7.0.0 torchaudio torchcodec==0.9 openai-whisper numpy torch googletrans-py deep-translator ```
Pin `torchcodec==0.9` ditujukan untuk PyTorch 2.9, sedangkan server menggunakan PyTorch 2.11. Menginstal seluruh file tersebut juga dapat mencoba mengubah instalasi `torch` dan `torchaudio` yang sudah berfungsi. ([GitHub][3])
Node `EdgeTTS` sendiri mengimpor:
```text edge_tts torch torchaudio ```
dan menggunakan `torchaudio.load()` untuk membaca hasil audio. ([GitHub][4])
---
- 8. Verifikasi dependency Python
Jalankan:
```bash docker compose exec -T comfyui /opt/venv/bin/python - <<'PY' import importlib.metadata as metadata import torch import torchaudio import torchcodec import edge_tts
packages = [
"torch", "torchaudio", "torchcodec", "edge-tts",
]
for package in packages:
try:
print(f"{package:12}: {metadata.version(package)}")
except metadata.PackageNotFoundError:
print(f"{package:12}: NOT INSTALLED")
print() print("Semua modul utama berhasil di-import.") PY ```
Hasil yang diharapkan kurang lebih:
```text torch : 2.11.0 torchaudio : 2.11.0 torchcodec : 0.11.x edge-tts : 7.x.x
Semua modul utama berhasil di-import. ```
Nomor revisi kecil dapat berbeda, tetapi kombinasi utamanya harus:
```text torch 2.11.x torchcodec 0.11.x ```
---
- 9. Restart ComfyUI
```bash cd /opt/ai-stack
docker compose restart comfyui ```
Pantau startup:
```bash docker compose logs -f comfyui ```
Hentikan tampilan log dengan:
```text Ctrl+C ```
Periksa error terbaru:
```bash docker compose logs --since=5m comfyui \
| grep -Ei \ 'EdgeTTS|ComfyUI-EdgeTTS|torchcodec|error loading|import failed|traceback|exception'
```
Baris berikut bukan error:
```text 0.0 seconds: /opt/ComfyUI/custom_nodes/ComfyUI-EdgeTTS ```
Baris tersebut merupakan informasi waktu pemuatan plugin.
---
- BAGIAN B — VERIFIKASI
- 10. Pastikan node EdgeTTS terdaftar
Jalankan:
```bash curl -fsS http://127.0.0.1:8188/object_info/EdgeTTS \ | python3 -c ' import json import sys
data = json.load(sys.stdin)
if "EdgeTTS" not in data:
raise SystemExit("GAGAL: EdgeTTS belum terdaftar")
node = data["EdgeTTS"]
print("STATUS : OK") print("NAME :", node.get("name")) print("DISPLAY NAME :", node.get("display_name")) print("MODULE :", node.get("python_module")) print("OUTPUT :", node.get("output")) ' ```
Hasil yang benar:
```text STATUS : OK NAME : EdgeTTS DISPLAY NAME : Edge TTS 🔊 MODULE : custom_nodes.ComfyUI-EdgeTTS OUTPUT : ['AUDIO'] ```
Ini merupakan pemeriksaan paling penting.
Jika endpoint tersebut mengembalikan definisi node, backend ComfyUI sudah mengenali `EdgeTTS`.
---
- 11. Pastikan SaveAudio tersedia
Jalankan:
```bash curl -fsS http://127.0.0.1:8188/object_info/SaveAudio \ | python3 -c ' import json import sys
data = json.load(sys.stdin)
if "SaveAudio" not in data:
raise SystemExit("GAGAL: SaveAudio tidak tersedia")
print("STATUS : OK") print("NODE : SaveAudio") ' ```
`SaveAudio` merupakan node bawaan ComfyUI yang menerima input `AUDIO` dan menyimpan hasil sebagai file FLAC. ([ComfyUI][5])
---
- 12. Verifikasi suara Bahasa Indonesia
Karena Edge TTS menggunakan layanan online, container harus dapat mengakses internet.
Jalankan:
```bash docker compose exec -T comfyui \
/opt/venv/bin/edge-tts --list-voices \ | grep -E 'id-ID-(Gadis|Ardi)Neural'
```
Hasil harus memuat suara seperti:
```text id-ID-ArdiNeural id-ID-GadisNeural ```
Program resmi `edge-tts` menyediakan opsi `--list-voices` untuk memperoleh daftar suara yang tersedia dari layanan Edge TTS. ([GitHub][6])
Jika perintah ini gagal akibat koneksi, periksa:
```bash docker compose exec -T comfyui \
getent hosts speech.platform.bing.com
```
Edge TTS bukan TTS lokal atau offline. Plugin menggunakan layanan text-to-speech online Microsoft Edge. ([GitHub][4])
---
- BAGIAN C — PENGUJIAN
- 13. Uji EdgeTTS langsung melalui ComfyUI API
Jalankan:
```bash curl -fsS \
-X POST \ http://127.0.0.1:8188/prompt \ -H 'Content-Type: application/json' \ -d '{ "prompt": { "1": { "class_type": "EdgeTTS", "inputs": { "text": "Halo, ini adalah pengujian text to speech Bahasa Indonesia menggunakan ComfyUI.", "voice": "[Indonesian] id-ID Gadis", "speed": 1.0, "pitch": 0 } }, "2": { "class_type": "SaveAudio", "inputs": { "audio": [ "1", 0 ], "filename_prefix": "audio/tts_indonesia_test" } } } }' \ | python3 -m json.tool
```
Respons yang benar akan memuat:
```json {
"prompt_id": "...",
"number": 1,
"node_errors": {}
} ```
`prompt_id` akan berbeda pada setiap eksekusi.
Pantau proses:
```bash docker compose logs -f comfyui ```
---
- 14. Cari hasil audio
Jalankan:
```bash docker compose exec -T comfyui \
find /opt/ComfyUI/output \ -type f \ -iname '*tts_indonesia_test*' \ -printf '%TY-%Tm-%Td %TH:%TM:%TS %p\n' \ | sort
```
Lokasi hasil umumnya berada di bawah:
```text /opt/ComfyUI/output/audio/ ```
Karena prefix yang digunakan adalah:
```text audio/tts_indonesia_test ```
File hasil `SaveAudio` menggunakan format FLAC.
Untuk melihat file terakhir:
```bash docker compose exec -T comfyui bash -lc ' find /opt/ComfyUI/output/audio \
-type f \ -iname "*tts_indonesia_test*" \ -printf "%T@ %p\n" \ | sort -n \ | tail -1 \ | cut -d" " -f2-
' ```
---
- BAGIAN D — MENJALANKAN WORKFLOW DI BROWSER
- 15. Buka ComfyUI
Buka dari komputer pengguna:
```text http://IP-SERVER5:8188 ```
Ganti `IP-SERVER5` dengan alamat IP server.
Setelah plugin baru dipasang:
1. Tutup tab ComfyUI lama. 2. Buka kembali ComfyUI. 3. Tekan `Ctrl+Shift+R`. 4. Load ulang workflow JSON. 5. Pastikan node `Edge TTS 🔊` tidak berwarna merah. 6. Pilih suara:
```text [Indonesian] id-ID Gadis ```
atau:
```text [Indonesian] id-ID Ardi ```
7. Hubungkan output `AUDIO` dari `EdgeTTS` ke input `audio` pada `SaveAudio`. 8. Klik **Queue Prompt** atau **Run**.
Node `EdgeTTS` resmi menghasilkan output bertipe `AUDIO`, sehingga dapat langsung dihubungkan ke `SaveAudio`. ([GitHub][4])
---
- BAGIAN E — TROUBLESHOOTING
- 16. Error “Missing node type” masih terlihat di log
Perintah:
```bash docker compose logs --tail=200 comfyui ```
dapat menampilkan peringatan lama yang tercatat sebelum node berhasil dipasang.
Gunakan log berdasarkan waktu:
```bash docker compose logs --since=2m comfyui \
| grep -Ei \ 'missing_node_type|EdgeTTS|error|exception|traceback'
```
Jika:
```bash curl -fsS http://127.0.0.1:8188/object_info/EdgeTTS ```
sudah mengembalikan definisi lengkap `EdgeTTS`, backend sudah benar. Peringatan lama di log tidak berarti error masih aktif. Kondisi inilah yang terverifikasi pada server setelah instalasi.
---
- 17. Backend mengenali EdgeTTS, tetapi browser masih menampilkan node hilang
Kemungkinan browser masih menyimpan definisi node lama atau browser membuka instance ComfyUI yang berbeda.
Lakukan:
```text Ctrl+Shift+R ```
Kemudian pastikan alamat browser menggunakan server dan port yang benar:
```text http://IP-SERVER5:8188 ```
Bila masih bermasalah:
1. Tekan `F12`. 2. Buka tab **Application**. 3. Pilih **Storage**. 4. Klik **Clear site data**. 5. Tutup tab. 6. Buka kembali ComfyUI.
Tidak perlu mengubah workflow apabila backend sudah mengembalikan:
```text /object_info/EdgeTTS ```
---
- 18. Node tersedia tetapi audio kosong atau sangat pendek
Periksa log:
```bash docker compose logs --since=5m comfyui \
| grep -Ei \ 'TTS Error|NoAudioReceived|torchcodec|ffmpeg|audio|exception|traceback'
```
Kode plugin menangkap error TTS dan, pada kondisi gagal, dapat mengembalikan waveform kosong sepanjang satu detik. Karena itu workflow bisa terlihat selesai walaupun layanan TTS sebenarnya gagal. ([GitHub][4])
Penyebab yang harus diperiksa:
```text Koneksi internet dari container DNS container Layanan Edge TTS tidak dapat dijangkau TorchCodec tidak cocok dengan PyTorch FFmpeg tidak tersedia Voice ID sudah berubah atau tidak tersedia ```
Uji layanan Edge TTS secara langsung:
```bash docker compose exec -T comfyui \
/opt/venv/bin/edge-tts \ --voice id-ID-GadisNeural \ --text "Halo, ini adalah pengujian suara Bahasa Indonesia." \ --write-media /tmp/edgetts-test.mp3
```
Periksa file:
```bash docker compose exec -T comfyui \
ls -lh /tmp/edgetts-test.mp3
```
Jika file terbentuk dan ukurannya lebih dari nol, layanan Edge TTS berfungsi.
Hapus file uji:
```bash docker compose exec -T comfyui \
rm -f /tmp/edgetts-test.mp3
```
---
- 19. TorchCodec gagal di-import
Periksa versi:
```bash docker compose exec -T comfyui /opt/venv/bin/python - <<'PY' import importlib.metadata as metadata import torch import torchaudio
print("torch :", torch.__version__) print("torchaudio :", torchaudio.__version__)
try:
print("torchcodec :", metadata.version("torchcodec"))
except metadata.PackageNotFoundError:
print("torchcodec : NOT INSTALLED")
PY ```
Untuk server ini, instal ulang seri yang sesuai:
```bash docker compose exec -u root -T comfyui \
/opt/venv/bin/python -m pip uninstall -y torchcodec
```
```bash docker compose exec -u root -T comfyui \
/opt/venv/bin/python -m pip install \ --no-cache-dir \ "torchcodec>=0.11,<0.12"
```
Kemudian restart:
```bash docker compose restart comfyui ```
Jangan memasang `torchcodec==0.9` pada PyTorch 2.11 karena matriks kompatibilitas resmi memasangkan TorchCodec 0.9 dengan PyTorch 2.9. ([GitHub][1])
---
- 20. Plugin tidak muncul pada object_info
Periksa isi plugin:
```bash docker compose exec -T comfyui bash -lc ' ls -lah /opt/ComfyUI/custom_nodes/ComfyUI-EdgeTTS
grep -Rni "EdgeTTS" \
/opt/ComfyUI/custom_nodes/ComfyUI-EdgeTTS \ --include="*.py" \ | head -30
' ```
Uji modul node secara langsung:
```bash docker compose exec -T comfyui /opt/venv/bin/python - <<'PY' import sys import traceback
plugin_path = "/opt/ComfyUI/custom_nodes/ComfyUI-EdgeTTS" sys.path.insert(0, plugin_path)
try:
import ailab_edgeTTS
print("Import ailab_edgeTTS: OK")
print(
"Node mappings:",
list(ailab_edgeTTS.NODE_CLASS_MAPPINGS.keys())
)
except Exception:
print("Import ailab_edgeTTS: GAGAL")
traceback.print_exc()
raise
PY ```
Hasil yang benar:
```text Import ailab_edgeTTS: OK Node mappings: ['EdgeTTS'] ```
Kode resmi plugin mendaftarkan:
```python NODE_CLASS_MAPPINGS = {
"EdgeTTS": EdgeTTS
} ```
Karena itu nama internal workflow harus tetap:
```text EdgeTTS ```
bukan:
```text Edge TTS Edge TTS 🔊 ComfyUI-EdgeTTS ```
([GitHub][4])
---
- BAGIAN F — PEMELIHARAAN
- 21. Update plugin
Untuk memperbarui plugin:
```bash cd /opt/ai-stack
docker compose exec -u root -T comfyui bash -lc ' set -e
git -C /opt/ComfyUI/custom_nodes/ComfyUI-EdgeTTS \
pull --ff-only
' ```
Setelah update, jangan langsung menjalankan seluruh `requirements.txt` tanpa mengecek perubahan versi.
Tampilkan isi dependency terbaru:
```bash docker compose exec -T comfyui bash -lc ' cat /opt/ComfyUI/custom_nodes/ComfyUI-EdgeTTS/requirements.txt ' ```
Periksa kembali kompatibilitas:
```bash docker compose exec -T comfyui /opt/venv/bin/python - <<'PY' import importlib.metadata as metadata import torch
print("torch :", torch.__version__) print("torchcodec :", metadata.version("torchcodec")) print("edge-tts :", metadata.version("edge-tts")) PY ```
Restart:
```bash docker compose restart comfyui ```
Verifikasi:
```bash curl -fsS http://127.0.0.1:8188/object_info/EdgeTTS \
| python3 -m json.tool \ | head -50
```
---
- 22. Catatan persistensi Docker
Perintah instalasi di atas memasang plugin dan paket ke dalam filesystem container yang sedang berjalan.
Perubahan dalam writable layer container dapat hilang ketika container dihapus dan dibuat ulang. Volume atau bind mount diperlukan agar file bertahan di luar lifecycle container, atau instalasi harus dimasukkan ke dalam Dockerfile. ([Docker Documentation][7])
Periksa apakah folder custom node memakai mount:
```bash docker inspect "$(docker compose ps -q comfyui)" \
--format 'Template:Range .Mounts{{println .Source "->" .Destination}}Template:End'
```
Cari tujuan:
```text /opt/ComfyUI/custom_nodes ```
Jika folder tersebut tidak menggunakan volume atau bind mount, plugin harus dimasukkan ke Dockerfile agar tidak hilang setelah container dibuat ulang.
Hal yang sama berlaku untuk paket Python di:
```text /opt/venv ```
Instalasi permanen harus memasukkan langkah berikut ke proses build image, setelah `/opt/venv` dan `/opt/ComfyUI` tersedia:
```dockerfile RUN apt-get update \
&& apt-get install -y --no-install-recommends \
git \
ffmpeg \
ca-certificates \
&& rm -rf /var/lib/apt/lists/*
RUN git clone --depth 1 \
https://github.com/1038lab/ComfyUI-EdgeTTS.git \ /opt/ComfyUI/custom_nodes/ComfyUI-EdgeTTS
RUN /opt/venv/bin/python -m pip install \
--no-cache-dir \ "edge-tts>=7.0.0" \ "torchcodec>=0.11,<0.12"
```
Setelah Dockerfile diperbarui:
```bash cd /opt/ai-stack
docker compose build comfyui docker compose up -d comfyui ```
Verifikasi ulang:
```bash curl -fsS http://127.0.0.1:8188/object_info/EdgeTTS \
| python3 -m json.tool \ | head -50
```
---
- BAGIAN G — RINGKASAN PERINTAH UTAMA
- 23. Instalasi ringkas
```bash cd /opt/ai-stack ```
```bash docker compose exec -u root -T comfyui bash -lc ' set -e
apt-get update
DEBIAN_FRONTEND=noninteractive apt-get install -y \
--no-install-recommends \ git \ ffmpeg \ ca-certificates
rm -rf /var/lib/apt/lists/*
cd /opt/ComfyUI/custom_nodes
if [ -d ComfyUI-EdgeTTS/.git ]; then
git -C ComfyUI-EdgeTTS pull --ff-only
else
rm -rf ComfyUI-EdgeTTS
git clone --depth 1 \
https://github.com/1038lab/ComfyUI-EdgeTTS.git
fi ' ```
```bash docker compose exec -u root -T comfyui \
/opt/venv/bin/python -m pip install \ --no-cache-dir \ --upgrade \ "edge-tts>=7.0.0" \ "torchcodec>=0.11,<0.12"
```
```bash docker compose restart comfyui ```
```bash curl -fsS http://127.0.0.1:8188/object_info/EdgeTTS \
| python3 -m json.tool \ | head -80
```
---
- 24. Kondisi akhir yang benar
Instalasi dinyatakan berhasil jika seluruh kondisi berikut terpenuhi:
```text Container comfyui aktif. FFmpeg tersedia di dalam container. edge-tts berhasil di-import. torchcodec 0.11.x terpasang. PyTorch tetap 2.11.x. Torchaudio tetap 2.11.x. Endpoint /object_info/EdgeTTS mengembalikan node EdgeTTS. Endpoint /object_info/SaveAudio mengembalikan SaveAudio. Daftar suara memuat id-ID-GadisNeural dan id-ID-ArdiNeural. Workflow tidak lagi menghasilkan missing_node_type. File audio tersimpan di /opt/ComfyUI/output/audio. ```
Pada pemeriksaan terakhir server Anda, endpoint `object_info/EdgeTTS` sudah mengembalikan node lengkap dengan:
```text name : EdgeTTS display_name : Edge TTS 🔊 python_module : custom_nodes.ComfyUI-EdgeTTS output : AUDIO ```
Dengan demikian masalah `Missing node type` pada backend telah selesai.
Catatan ini memakai prosedur minimal untuk **TTS Bahasa Indonesia**, tanpa memasang ulang PyTorch, Torchaudio, Whisper, atau dependency lain yang tidak diperlukan oleh workflow tersebut.
[1]: https://github.com/meta-pytorch/torchcodec "GitHub - meta-pytorch/torchcodec: PyTorch media decoding and encoding · GitHub" [2]: https://github.com/1038lab/ComfyUI-EdgeTTS "GitHub - 1038lab/ComfyUI-EdgeTTS: ComfyUI-EdgeTTS is a powerful text-to-speech node for ComfyUI, leveraging Microsoft's Edge TTS capabilities. It enables seamless conversion of text into natural-sounding speech, supporting multiple languages and voices. Ideal for enhancing user interactions, this node is easy to integrate and customize, making it perfect for various applications. · GitHub" [3]: https://github.com/1038lab/ComfyUI-EdgeTTS/blob/main/requirements.txt "ComfyUI-EdgeTTS/requirements.txt at main · 1038lab/ComfyUI-EdgeTTS · GitHub" [4]: https://github.com/1038lab/ComfyUI-EdgeTTS/blob/main/ailab_edgeTTS.py "ComfyUI-EdgeTTS/ailab_edgeTTS.py at main · 1038lab/ComfyUI-EdgeTTS · GitHub" [5]: https://docs.comfy.org/built-in-nodes/SaveAudio?utm_source=chatgpt.com "SaveAudio - ComfyUI Built-in Node Documentation" [6]: https://github.com/rany2/edge-tts/blob/master/README.md?utm_source=chatgpt.com "README.md - rany2/edge-tts" [7]: https://docs.docker.com/get-started/docker-concepts/running-containers/persisting-container-data/?utm_source=chatgpt.com "Persisting container data | Docker Docs"