Files

103 lines
5.7 KiB
Markdown
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# 🎬 Drama AI Cina — Generator Drama Pendek Vertikal
Bikin drama pendek Cina (C-drama) vertikal 9:16 ala channel **Teater Bangkit Balik**: tulis judul
+ genre, AI buatkan naskah per adegan, tiap adegan di-render jadi video, ada dialog suara +
subtitle Indonesia, lalu digabung jadi **satu video episode lengkap** + file SRT.
**Genre utama: Xianxia · Sistem · Turun Gunung (男频爽剧)** — MC diremehkan → kekuatan
tersembunyi terungkap → semua panik → pembalasan memuaskan. Genre lain: Kultivasi Perkotaan,
Perang Dewa-Iblis, Kembali ke Masa Lalu, Wuxia/Xianxia, Romansa CEO, Balas Dendam, Fantasi,
Keluarga, Komedi, Kostum Sejarah.
## Arsitektur
```
[Browser: web/index.html] ──HTTP──> [Notebook Kaggle / Colab (GPU T4)]
naskah, judul, render, FastAPI :8000 + Cloudflare Tunnel
subtitle, antrian job (URL *.trycloudflare.com, berubah tiap sesi)
│ ├─ LLM Qwen2.5-1.5B-Instruct (naskah + judul)
│ ├─ Wan2.1-T2V-1.3B 480p (video per adegan)
│ ├─ Edge-TTS (dialog Cina + narasi Indonesia)
│ └─ ffmpeg + libass (gabung + bakar subtitle)
└── Mode Demo: tanpa GPU, render disimulasikan di browser (canvas → .webm)
```
Website hanya frontend + antrian job; semua komputasi berat di notebook GPU gratis.
## File
| File | Isi |
|---|---|
| `web/index.html` | Aplikasi web single-file (tanpa build step, tanpa CDN wajib). Buka langsung di browser atau via `python3 -m http.server`. |
| `notebook/Kaggle_DramaAI.ipynb` | Worker GPU Kaggle: GPU T4 x2, kuota ~30 jam/minggu, sesi max ~12 jam. |
| `notebook/Colab_DramaAI.ipynb` | Worker GPU Colab: GPU T4 (cadangan kalau Kaggle habis/penuh). |
| `PANDUAN.md` | Langkah demi langkah: nyalakan notebook → hubungkan web → drama pertama → troubleshooting. |
## Fitur web
- **Proyek**: judul, genre, mode **Episode** (gabung jadi 1 video panjang, untuk update harian)
atau **Adegan satuan**, jumlah adegan 1–10, durasi 3–8 detik, resolusi 480×832 / 720×1280 (upscale).
- **Buatkan Judul**: 5 judul clickbait ala drama Cina + hashtag YouTube
(`#DramaPendek #DramaChina #Xianxia #Sistem #BangkitBalik`).
- **Karakter**: nama, peran, deskripsi visual (konsistensi antar adegan), suara dialog per karakter.
- **Naskah**: per adegan ada setting visual, narasi (ID/ZH/EN), dialog per karakter
(Mandarin + Indonesia + Inggris). Tombol "Buatkan Naskah Otomatis" pakai LLM.
- **Subtitle custom**: bahasa Indonesia / English / 中文 / bilingual (Cina+Indonesia),
ukuran font, warna teks, warna kotak, posisi (bawah/tengah), tebal, outline — dengan
preview langsung di panggung 9:16.
- **Antrian job**: status per adegan (Antri/Berjalan/Selesai/Gagal), preview video per adegan,
tombol "Gabung & Download Video Final" (MP4 + SRT).
- **Mode Demo**: drama contoh "Adik Perempuan Turun Gunung" (3 adegan), simulasi render
di browser, preview subtitle langsung — tanpa GPU.
- Semua state proyek tersimpan di `localStorage`; URL engine hanya di memori halaman.
## API engine (dipakai web — wajib sama dengan notebook)
| Endpoint | Fungsi |
|---|---|
| `GET /health` | Status, model, GPU |
| `POST /script` | Buatkan naskah adegan dari judul+genre+karakter |
| `POST /title` | Buatkan 5 judul clickbait + hashtag |
| `POST /render` | Render 1 adegan jadi video → `{job_id}` |
| `POST /tts` | Text-to-speech 1 baris → mp3 base64 |
| `POST /assemble` | Gabung adegan + audio dialog + bakar subtitle → video final + SRT |
| `GET /status` | Status semua job + GPU |
| `GET /result/{job_id}` | File MP4 hasil (kalau done) |
| `GET /result/{job_id}/srt` | File SRT hasil assemble |
## Batas jujur (wajib dibaca)
- **Render gratis di T4 itu lambat**: klip 5 detik 480p sekitar **1–3 menit**; episode 10 adegan
bisa 10–30 menit.
- **Kualitas tidak setara tool komersial** (Kling/Runway): model Wan2.1 1.3B gratis, 480p.
Wan 1.3B native max ~5 detik (81 frame @16fps) — adegan 6–8 detik di-freeze frame
terakhirnya sampai durasi penuh.
- **Suara memakai TTS gratis** (Edge-TTS), bukan dubber manusia.
- Subtitle dibakar ke video via ffmpeg (libass); font bakar selalu DejaVu Sans.
- URL engine berubah tiap sesi — paste ulang tiap kali notebook di-Run All.
- Mode Demo hanya simulasi visual di browser (tanpa suara, format .webm).
## Coba cepat (tanpa GPU)
1. Buka `web/index.html` di browser (klik ganda, atau `python3 -m http.server` di folder `web/`).
2. Klik **"▶ Coba Mode Demo (tanpa GPU)"** — drama contoh langsung dimuat.
3. Klik **"🎬 Render Semua Adegan"** — tiap adegan direkam dari canvas (3× ~5 detik).
4. Klik **"📺 Gabung & Download Video Final"** — dapat video episode demo (.webm) + SRT.
Untuk render asli dengan suara, ikuti `PANDUAN.md`.
---
## English summary
**Drama AI Cina** — a vertical (9:16) Chinese short-drama generator. Write a title + genre,
the AI writes a per-scene script, each scene is rendered to video, dialogue is voiced and
subtitled (Indonesian default, bilingual option), then everything is assembled into one
full-episode video + SRT. Lead genre: Xianxia · System · Descending the Mountain (男频爽剧 —
underestimated MC, hidden power revealed, everyone panics, satisfying payback), modelled on
the "Teater Bangkit Balik" channel style. The web app (`web/index.html`) is a single-file
frontend; heavy compute runs on a free Kaggle (T4 x2) or Colab (T4) notebook via a
Cloudflare tunnel. Demo mode works with no GPU. Honest limits: free T4 rendering is slow
(~1–3 min per 5 s 480p clip), quality is below commercial tools (Kling/Runway), voices are
free TTS, and scenes over ~5 s get freeze-framed to full length.