File size: 2,098 Bytes
cb1a4ae
7c33a07
 
 
 
cb1a4ae
4819d39
cb1a4ae
 
 
7c33a07
cb1a4ae
 
7c33a07
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1c82a8d
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
---
title: AI Short Video Generator
emoji: 🎬
colorFrom: purple
colorTo: blue
sdk: gradio
sdk_version: 6.14.0
app_file: app.py
pinned: false
license: mit
hardware: gpu-t4-small
---

# 🎬 AI Short Video Generator

Upload photos of characters, describe a scene, and receive a **1080Γ—1920 (1K) Shorts-ready video** complete with animation, dialogue, voice-over, subtitles, and visual effects.

## Pipeline

```
Images β†’ Claude Vision (character extraction)
       β†’ Claude (script + storyboard)
       β†’ AnimateDiff + Stable Diffusion (animated frames)
       β†’ Coqui TTS (voice lines)
       β†’ FFmpeg (subtitles, FX, assembly)
       β†’ Final MP4 (1080Γ—1920 @ 30fps)
```

## Setup (HuggingFace Spaces)

1. **Fork / duplicate** this Space.
2. Go to **Settings β†’ Secrets** and add:
   - `ANTHROPIC_API_KEY` β€” your Anthropic API key ([get one here](https://console.anthropic.com/))
3. Choose **GPU T4 small** (or larger) hardware for reasonable speed.
4. The Space will install all dependencies and launch automatically.

## Local Setup

```bash
# 1. Clone
git clone https://huggingface.co/spaces/<your-username>/ai-short-video-generator
cd ai-short-video-generator

# 2. Install system deps (Ubuntu/Debian)
sudo apt-get install -y ffmpeg espeak-ng

# 3. Python deps
pip install -r requirements.txt

# 4. Set API key
export ANTHROPIC_API_KEY=sk-ant-...

# 5. Run
python app.py
```

## Output Specs

| Property | Value |
|---|---|
| Resolution | 1080 Γ— 1920 px |
| Aspect ratio | 9:16 (Shorts / Reels / TikTok) |
| Frame rate | 30 fps |
| Video codec | H.264 |
| Audio codec | AAC |
| Duration | ~30–60 s |

## Visual FX Supported

- **zoom** β€” Ken Burns zoom-in
- **glitch** β€” RGB channel-split glitch
- **slow-motion** β€” frame doubling
- **vignette** β€” cinematic edge darkening
- Combinations (e.g. `glitch, zoom`)

## Notes

- First run downloads ~4–6 GB of model weights (SD 1.5 + AnimateDiff adapter). They are cached automatically.
- Generation takes ~3–8 minutes on a T4 GPU depending on scene count.
- The `ANTHROPIC_API_KEY` secret is never exposed to users.