คู่มือการใช้งานฉบับสมบูรณ์ · User Manual v2.5
Director Studio คือเว็บแอป multi-tenant สำหรับสร้างซีรีส์สยองขวัญไทย "คืนซ่อนวิญญาณ" (The Night of Hidden Souls) ด้วย AI ใช้ 3-Stage Pipeline ที่ผสาน LLM (เขียนบท) เข้ากับ Veo 3.1 (สร้างวิดีโอ) ทำงานแบบ background jobs — ปิด browser ได้
sk-cp-...) (ใช้กับ Stage 1 + 2)admin อัตโนมัติแถบเมนูด้านบนประกอบด้วย 7 แท็บ:
| แท็บ | คำอธิบาย |
|---|---|
| 📁 โปรเจกต์ | รายการโปรเจกต์ทั้งหมด |
| ⚙ ตั้งค่า | API Keys + Quota |
| 📊 Analytics | สถิติการใช้งาน |
| 📋 Jobs N | Background jobs (badge แสดงงานที่กำลังทำ) |
| 🛡 Admin | เฉพาะ admin เท่านั้น |
| 📖 คู่มือ | เปิด tab ใหม่ → ไป /docs |
| ⎋ Logout | ออกจากระบบ |
หน้า Login - เข้าสู่ระบบหรือสมัครสมาชิก
หน้าสมัครสมาชิก - กรอก email + password + display name
หน้าโปรเจกต์หลัง login - รายการโปรเจกต์ทั้งหมด
แสดงรายการโปรเจกต์ + ปุ่มสร้างใหม่
Modal สร้างโปรเจกต์ใหม่ - เลือก Template ได้ 5 แบบ
Modal แสดง 5 templates ให้เลือก
เลือก Template Horror Village แล้ว - สีเหลือง border + ชื่อ auto-fill
Project Settings - rename, share link, export, delete
Project Settings มี 4 ฟีเจอร์:
5 preset templates พร้อม seed episodes + characters:
| Template | Episodes | Characters | Style |
|---|---|---|---|
| 🏚️ หมู่บ้านร้าง (Horror Village) | 3 | nam, jay, ghost, yai_kaew | Thai horror, dark village, isolated |
| 🏫 โรงเรียนสยอง (Haunted School) | 1 | nam, jay, ghost | School setting, ghostly students |
| 🏢 อพาร์ตเมนต์ผี (Ghost Apartment) | 1 | nam, jay, ghost | Urban setting, modern apartment |
| ⛩️ ศาลป่า (Forest Shrine) | 1 | nam, jay, ghost, yai_kaew | Forest, ancient shrine, spiritual |
| 📄 เริ่มจากศูนย์ (Blank) | 0 | — | Empty project |
หน้าโปรเจกต์ - แสดงรายการ episodes และปุ่มจัดการ
รายการ Episodes + ปุ่มดำเนินการ
Episode modal - แท็บ Script แสดง scenes + dialogue + mood
แสดง scenes + dialogue + emotional_beat + mood
Episode modal - แท็บ Veo Prompts พร้อม VO + audio + camera
แสดง Veo prompts + VO + audio cue + camera
Episode modal - แท็บ Videos
ผลลัพธ์: JSON script (Thai horror) พร้อม scenes, dialogue, emotional_beat
Generate Script modal - ใส่ idea + เลือก episode
{
"episode_title": "ตอนที่ 1: บ้านร้าง",
"episode_title_en": "EP1 — The Empty House",
"episode_logline": "น้ำกลับมายังหมู่บ้านเกิด...",
"characters_in_ep": ["nam", "ghost", "yai_kaew"],
"scenes": [
{
"id": "S01_01",
"title": "ทางเข้าหมู่บ้าน",
"location": "ถนนลูกรังหน้าหมู่บ้าน",
"time_marker": "18:47 — พลบค่ำ",
"characters": ["nam"],
"action": "close-up รองเท้าหนังสีดำ...",
"dialogue": [{"speaker": "น้ำ", "line": "ยี่สิบปีแล้ว..."}],
"emotional_beat": "หวาดหวั่นผสมเหงา"
}
]
}
ผลลัพธ์: Veo YAML พร้อม timeline, prompts, audio cues
["nam", "jay", "ghost"]){
"variant": "VARIANT_EP1_BAANRAAN",
"video_config": {
"duration": "8s",
"aspect": "9:16",
"fps": 30,
"look": "Cinematic Thai horror, desaturated teal-orange grade"
},
"timeline": [
{
"id": "S01_01",
"t": "0.0-8.0",
"reference_image": ["nam_ref"],
"prompt": "SCENE: ทางเข้า (Village Entrance)\n\n- [nam_ref] walks slowly...\n- dialogue: \"กลับมาแล้ว\"\n- audio: distant crickets, soft wind",
"camera": {"move": "slow dolly in", "lens": "35mm"},
"vo": "กลับมาแล้ว",
"audio_cue": "distant crickets, soft wind, footsteps on gravel"
}
],
"negative": ["blood", "weapons", "no dialogue", "no audio"]
}
ผลลัพธ์: MP4 (8s, 9:16, 1080p) พร้อมเล่น
reference_image field)https://files.genaipro.io/video_xxx.mp4queued → running → completedPUBLIC_ERROR_AUDIO_FILTERED — prompt ไม่มี audio cue (backend auto-injects)PUBLIC_ERROR_DANGER_FILTER — มี "blood", "weapons", "knives" (auto-replace)error code: 1010 — Cloudflare block (User-Agent fix แล้ว)สร้างภาพ reference ตัวละคร / scene จาก prompt โดยใช้ GTMage-2 (Google Gemini 2.5 Flash Image) ผ่าน genaipro.io — ไม่ต้องอัปโหลด ref เอง เหมาะกับโปรเจกต์ใหม่ที่ยังไม่มี character image
🎨 Stage 0: Generate Image| Ratio | ใช้กับ |
|---|---|
| 1:1 | Character portrait, profile pic |
| 16:9 | Cinematic scene, environment |
| 9:16 | Vertical (mobile, poster) |
| 3:2 / 2:3 | Photo standard |
| 4:3 / 3:4 | Landscape / portrait |
"A young Thai woman, 25 years old, long black hair, soft smile, traditional Thai silk dress, golden hour lighting""cinematic, dark, atmospheric, photorealistic, 8K""blood", "weapon", "violence", "knife" (ระบบจะ reject)reference_images (frontend ปัจจุบันยังไม่ expose)Prompt: "A mysterious Thai village elder woman in traditional indigo shirt, holding an old lantern, dark misty forest background, cinematic horror, photorealistic"
Aspect: 16:9
Result: ~2-3 นาที
POST /api/images/generate
{
"project_id": "...",
"prompt": "...",
"aspect_ratio": "16:9", // or 1:1, 9:16, 3:2, 2:3, 4:3, 3:4
"n": 1, // 1-4
"sync": false // true = wait for completion
}
Powered by GTMage-2 · uses your Veo JWT (same one as Stage 2/3)
Settings - Veo JWT + LLM Key + Quota auto-display
eyJ...)sk-cp-...)เมื่อบันทึก JWT แล้ว quota จะแสดงอัตโนมัติ:
Jobs tab - background jobs list + cancel button
ระบบใช้ WebSocket (/api/ws?token=...) ส่ง update แบบ real-time เมื่อ job state เปลี่ยน:
type: "snapshot" — รายการ jobs ทั้งหมดตอน connecttype: "update" — job เปลี่ยน state (status, progress, message, result)
Analytics - สถิติการใช้งาน + 7-day activity chart
| Stat | คำอธิบาย |
|---|---|
| 📁 Projects | จำนวนโปรเจกต์ทั้งหมด |
| 🎬 Episodes | จำนวน episodes รวมทุกโปรเจกต์ |
| 🧠 LLM Jobs | จำนวน LLM jobs (script_gen + veo_gen) |
| 🎥 Veo Videos | จำนวน videos ที่ submit |
| 💎 Credits used (est.) | Veo=1cr, LLM=0.1cr (ประมาณ) |
| ✅ Veo success rate | % ที่สำเร็จ |
| 📊 Job statuses | completed/failed/running/queued |
| 📈 Activity (7d) | Chart แสดง activity 7 วัน |
เปิด Episode → ปุ่ม "📝 Export .md" หรือ "📋 Export .json"
# ตอนที่ 1: คืนแรก
*EP1 — The First Night*
> น้ำกลับมาที่หมู่บ้านเกิดหลังจาก 20 ปี...
**Characters:** nam, jay, ghost
## Scenes
### Scene 1: ทางเข้าหมู่บ้าน
*หมู่บ้านเกิด — เย็น พลบค่ำ*
**Characters:** nam
**Action:**
close-up รองเท้า...
**Dialogue:**
- **น้ำ:** "ยี่สิบปีแล้ว..."
*Mood: ความเหงา*
## 🎬 Veo Prompts (3)
### Clip 1 (t=0.0-8.0)
**Refs:** nam_ref
```text
SCENE: ทางเข้า...
```
เปิด Project Settings → "📤 Export" → "⬇ Download JSON"
Admin panel - users list + system stats
คนแรกที่สมัครจะกลายเป็น admin อัตโนมัติ คนต่อ ๆ ไปเป็น user
has_veo_jwt + has_llm (boolean เท่านั้น)| Component | Encryption | Location |
|---|---|---|
| User passwords | bcrypt | users.password_hash |
| JWT auth token | HS256 (30-day TTL) | localStorage (frontend) |
| Veo JWT | Fernet AES-128 | settings.veo_jwt_enc |
| LLM API Key | Fernet AES-128 | settings.llm_api_key_enc |
| Fernet key | Fernet key (auto-gen) | /opt/director-studio/data/.fernet_key |
| JWT signing | HS256 secret (auto-gen) | /opt/director-studio/data/.secret_key |
has_* flag, ไม่ decrypt ได้Base URL: https://directorstudio.sj88ai.com/api
Auth: Authorization: Bearer <token> (header)
| Method | Path | Description |
|---|---|---|
| GET | /health | Health check |
| POST | /auth/signup | Create user (first → admin) |
| POST | /auth/login | Get JWT |
| GET | /public/project/{pid} | Public project (read-only) |
| Method | Path | Description |
|---|---|---|
| GET | /auth/me | Current user |
| GET/PUT/DELETE | /settings/veo-jwt | Veo JWT CRUD |
| GET | /settings/veo-jwt/test | Auth check + quota |
| PUT/DELETE | /settings/llm-api-key | LLM key CRUD |
| POST | /llm/generate-script | Stage 1: idea → script (sync) |
| POST | /llm/generate-veo | Stage 2: script → Veo YAML (sync) |
| GET/POST/PUT/DELETE | /projects[/{id}] | Per-user projects |
| POST | /veo/submit | Stage 3: start Veo task (sync) |
| GET | /veo/poll/{id} | Poll Veo status |
| POST | /jobs | Submit background job (returns job_id) |
| GET | /jobs/{id} | Get job status |
| GET | /jobs | List jobs (?status=) |
| DELETE | /jobs/{id} | Cancel job |
| GET | /analytics/me | Personal stats |
| Method | Path | Description |
|---|---|---|
| GET | /admin/users | List all users |
| GET | /admin/users/{id} | User details (no secrets) |
| GET | /admin/stats | System stats |
| DELETE | /admin/users/{id} | Delete user |
wss://directorstudio.sj88ai.com/api/ws?token=<jwt>
// Receives:
// {type: "snapshot", jobs: [...]}
// {type: "update", job_id, status, progress, message, result, error}
# 1. Login
curl -X POST https://directorstudio.sj88ai.com/api/auth/login \
-H 'Content-Type: application/json' \
-d '{"email":"admin@sj88ai.com","password":"admin1234"}'
# → {"access_token": "eyJ...", "user": {...}}
# 2. Submit background job
curl -X POST https://directorstudio.sj88ai.com/api/jobs \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
-d '{
"type": "script_gen",
"input": {
"prompt": "น้ำกลับมาที่หมู่บ้านเกิด",
"episode_number": 1,
"num_scenes": 5
}
}'
# → {"ok": true, "job_id": "abc123", "status": "queued"}
# 3. Poll job
curl -H "Authorization: Bearer $TOKEN" \
https://directorstudio.sj88ai.com/api/jobs/abc123
# → {"status": "completed", "result": {"script": {...}}}
สาเหตุ: genaipro.io ban JWT หลังใช้งาน 5-10 นาที
แก้: ไป genaipro.io → Avatar → API Key → Create API Key ใหม่ → ใส่ใน Settings
สาเหตุ: genaipro.io block IP ของ server
แก้: Backend ใช้ User-Agent: Mozilla/5.0 แล้ว — ถ้ายังเจอ ลองเปลี่ยน key ใหม่
สาเหตุ: Veo ปฏิเสธ prompt ที่ไม่มี audio cue
แก้: Backend auto-inject audio cues แล้ว — ถ้ายังเจอ แก้ prompt ให้ audio ชัด
สาเหตุ: prompt มี "blood", "weapons", "knives"
แก้: Backend auto-replace แล้ว — ใช้ "red mist", "objects", "tools"
แก้: Settings → LLM API Key → วาง sk-cp-... → 💾
แก้: Settings → Veo API Key → วาง eyJ... → 💾
แก้: Token อายุ 30 วัน — login ใหม่ได้เลย
สาเหตุ: poll เร็วเกินไป ก่อน genaipro จะ register
แก้: Backend return processing แทน error แล้ว — รอต่อ
สาเหตุ: /opt/director-studio/refs/ ไม่มีภาพ
แก้: cp /home/.../www/refs/* /opt/director-studio/refs/
A: Director Studio เพิ่ม: LLM script generation, project organization, character management, Veo prompt optimization, queue system, history, analytics, multi-user. Veo API ตรง ๆ เป็นแค่ video generation
A: ตอนนี้รองรับแค่ genaipro.io (Veo) + MiniMax (LLM) — เพิ่ม provider อื่นได้ในอนาคต
A: SQLite ที่ /opt/director-studio/data/studio.db (บน server)
A: ได้ — cp /opt/director-studio/data/studio.db backup.db
A: UI responsive ใช้บนมือถือได้ (แต่ไม่มี dedicated app)
A: Veo JWT มีอายุ ~5-10 นาที (ต้อง refresh) — ไม่มี rate limit ที่ backend
A: ตอนนี้ทำได้ผ่าน Public Share link — multi-user edit ยังไม่มี
A: ตอนนี้ export เป็น .md หรือ .json — PDF ต้อง convert เอง (หรือ print to PDF)
A: ได้ — JWT stateless, แต่ session จะ sync เมื่อ refresh
A: genaipro.io แพ็กเกจหมดอายุ + ถูกใช้ไป — ระบบกรองเฉพาะที่ยังไม่หมดอายุ
A: ใส่ idea เป็นภาษาไทย + เลือก style "Thai horror" — LLM จะเขียนเป็นไทย
A: ตอนนี้ใช้ได้แค่ nam, jay, ghost, yai_kaew — Image Generation Stage 0 (กำลังพัฒนา) จะให้สร้าง character ใหม่ได้