Skip to content

Repository files navigation

DraMaker

AI-powered short drama generator with dual production modes.

Input a one-sentence idea, get a complete short drama: world bible, character profiles, episode screenplays, and full-length MP4 videos.

Features

  • Deep Research — automatically researches genre trends, audience profiles, and platform conventions before writing
  • Complete text package — world bible, character profiles, full episode outline, per-episode screenplays (DOCX)
  • Two production modes:
    • Mode B (Asset Assembly) — zero video API cost; composes character sprite images + backgrounds via FFmpeg with Ken Burns effects, TTS voiceover, subtitles, and BGM
    • Mode A (AI Generation) — calls image generation + Kling/Hailuo video APIs for cinematic quality
  • Multi-episode batch production — parallel Celery workers; each episode is an independent task with retry support
  • Smart duration control — supports 90s / 5-min / 10-min episodes; LLM dialogue count auto-derived from target duration
  • Cost estimation gate — Mode A shows API call count and estimated cost before starting production
  • Modern web UI — React dashboard with episode progress board, document viewer, asset library, and video preview

Quick Start

Prerequisites

  • Python 3.11+, Node.js 18+, Redis, FFmpeg

Setup

git clone https://github.com/your-username/dramaker
cd dramaker
cp .env.example .env   # fill in your API keys
pip install -r requirements.txt

Run

# Terminal 1: API server
uvicorn src.main:app --reload

# Terminal 2: Celery worker
celery -A src.worker worker --concurrency=4

# Terminal 3: Frontend
cd frontend && npm install && npm run dev

Open http://localhost:5173

Docker (recommended)

cp .env.example .env   # fill in your API keys
docker compose up -d

Open http://localhost:3000

Production Modes

Mode B — Asset Assembly (recommended for batch production)

Zero video API cost. Uses pre-built character sprite packs with multiple expressions:

src/assets/characters/
├── 小美/
│   ├── neutral.png
│   ├── happy.png
│   ├── sad.png
│   ├── angry.png
│   ├── surprised.png
│   └── thinking.png
src/assets/backgrounds/
src/assets/bgm/

Tip: Generate character sprites once with Mode A, save to asset library, then use Mode B for unlimited episodes at zero additional cost.

Mode A — AI Generation

Calls image generation + video generation APIs per scene. Requires video API keys.

Cost estimate is shown before production starts:

  • 5-min episode × 30 episodes ≈ 2250 API calls ≈ $225–$450

Episode Duration Options

Duration Scenes Lines/Episode Mode A Cost/Episode
90s 2–4 ~22 ~$3–4
5 min 5–8 ~75 ~$11
10 min 8–15 ~150 ~$22

API

Full REST API at http://localhost:8000/docs (auto-generated Swagger UI).

Key endpoints:

  • POST /api/dramas — create new drama
  • POST /api/dramas/{id}/research — trigger deep research
  • POST /api/dramas/{id}/worldbuild — build world bible + characters
  • POST /api/dramas/{id}/scripts — generate all episode scripts
  • POST /api/dramas/{id}/produce — start video production
  • POST /api/dramas/{id}/estimate — get Mode A cost estimate
  • WS /ws/dramas/{id}/progress — real-time progress stream

Configuration

See .env.example for all options. Key settings:

LLM_API_BASE=https://api.openai.com/v1
LLM_API_KEY=sk-...
LLM_MODEL=gpt-4o

VIDEO_BACKEND=kling    # kling | hailuo | wan21
KLING_API_KEY=...

TTS_BACKEND=fish_speech   # fish_speech | elevenlabs
FISH_SPEECH_API_BASE=http://localhost:8080

License

MIT — free for commercial use.

About

AI Short Drama Generator — one idea to full multi-episode drama with scripts and video. Dual mode: AI generation (Kling/Hailuo/Wan2.1) + asset assembly (zero video API cost).

Resources

Contributing

Security policy

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages