shortsflow 0.1.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- shortsflow-0.1.0/.gitignore +64 -0
- shortsflow-0.1.0/LICENSE +21 -0
- shortsflow-0.1.0/PKG-INFO +308 -0
- shortsflow-0.1.0/README.md +254 -0
- shortsflow-0.1.0/assets/avatars/cat.mp4 +0 -0
- shortsflow-0.1.0/assets/avatars/mafia_cat.mp4 +0 -0
- shortsflow-0.1.0/assets/avatars/mafia_cat.png +0 -0
- shortsflow-0.1.0/assets/avatars/orange_cat.mp4 +0 -0
- shortsflow-0.1.0/assets/avatars/rabbit.png +0 -0
- shortsflow-0.1.0/assets/avatars/robot.png +0 -0
- shortsflow-0.1.0/assets/avatars/squirrel.png +0 -0
- shortsflow-0.1.0/assets/branding/tv_frame.jpg +0 -0
- shortsflow-0.1.0/assets/models/face_detection_yunet_2023mar.onnx +0 -0
- shortsflow-0.1.0/engine/analysis.py +1562 -0
- shortsflow-0.1.0/engine/beat_sync.py +97 -0
- shortsflow-0.1.0/engine/branding.py +189 -0
- shortsflow-0.1.0/engine/comfy_bridge.py +286 -0
- shortsflow-0.1.0/engine/fillers.py +99 -0
- shortsflow-0.1.0/engine/find_moments.py +135 -0
- shortsflow-0.1.0/engine/kokoro_tts.py +133 -0
- shortsflow-0.1.0/engine/media_gen.py +972 -0
- shortsflow-0.1.0/engine/modes/__init__.py +1 -0
- shortsflow-0.1.0/engine/modes/clip_extract.py +413 -0
- shortsflow-0.1.0/engine/modes/explainer.py +104 -0
- shortsflow-0.1.0/engine/modes/generate.py +1324 -0
- shortsflow-0.1.0/engine/modes/music.py +183 -0
- shortsflow-0.1.0/engine/modes/photo_reel.py +123 -0
- shortsflow-0.1.0/engine/modes/video_filter.py +89 -0
- shortsflow-0.1.0/engine/paths.py +12 -0
- shortsflow-0.1.0/engine/pipeline.py +129 -0
- shortsflow-0.1.0/engine/publish.py +119 -0
- shortsflow-0.1.0/engine/remotion_renderer.py +405 -0
- shortsflow-0.1.0/engine/script_gen.py +2551 -0
- shortsflow-0.1.0/engine/social_gen.py +669 -0
- shortsflow-0.1.0/engine/speaker_focus.py +364 -0
- shortsflow-0.1.0/engine/storage.py +91 -0
- shortsflow-0.1.0/engine/trend_gen.py +50 -0
- shortsflow-0.1.0/engine/utils.py +59 -0
- shortsflow-0.1.0/engine/video_gen.py +3105 -0
- shortsflow-0.1.0/engine/voice_gen.py +418 -0
- shortsflow-0.1.0/env.example +48 -0
- shortsflow-0.1.0/music/bg_music.mp3 +0 -0
- shortsflow-0.1.0/pyproject.toml +79 -0
- shortsflow-0.1.0/remotion-video/package-lock.json +5721 -0
- shortsflow-0.1.0/remotion-video/package.json +35 -0
- shortsflow-0.1.0/remotion-video/public/fonts/Anton-Regular.ttf +0 -0
- shortsflow-0.1.0/remotion-video/public/fonts/LICENSE-Anton.txt +1 -0
- shortsflow-0.1.0/remotion-video/remotion.config.ts +15 -0
- shortsflow-0.1.0/remotion-video/src/HelloWorld/Arc.tsx +55 -0
- shortsflow-0.1.0/remotion-video/src/HelloWorld/Atom.tsx +36 -0
- shortsflow-0.1.0/remotion-video/src/HelloWorld/Logo.tsx +87 -0
- shortsflow-0.1.0/remotion-video/src/HelloWorld/Subtitle.tsx +26 -0
- shortsflow-0.1.0/remotion-video/src/HelloWorld/Title.tsx +58 -0
- shortsflow-0.1.0/remotion-video/src/HelloWorld/constants.ts +5 -0
- shortsflow-0.1.0/remotion-video/src/HelloWorld.tsx +76 -0
- shortsflow-0.1.0/remotion-video/src/Root.tsx +54 -0
- shortsflow-0.1.0/remotion-video/src/ShortFlow.tsx +1695 -0
- shortsflow-0.1.0/remotion-video/src/captionEmoji.ts +19 -0
- shortsflow-0.1.0/remotion-video/src/fonts.ts +11 -0
- shortsflow-0.1.0/remotion-video/src/index.css +1 -0
- shortsflow-0.1.0/remotion-video/src/index.ts +8 -0
- shortsflow-0.1.0/remotion-video/tsconfig.json +16 -0
- shortsflow-0.1.0/shortsflow/__init__.py +2 -0
- shortsflow-0.1.0/shortsflow/__main__.py +4 -0
- shortsflow-0.1.0/shortsflow/_main.py +281 -0
- shortsflow-0.1.0/shortsflow/api/__init__.py +1 -0
- shortsflow-0.1.0/shortsflow/api/__main__.py +6 -0
- shortsflow-0.1.0/shortsflow/api/app.py +128 -0
- shortsflow-0.1.0/shortsflow/api/jobs.py +108 -0
- shortsflow-0.1.0/shortsflow/cli.py +68 -0
- shortsflow-0.1.0/shortsflow/workspace.py +89 -0
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
# Python
|
|
2
|
+
__pycache__/
|
|
3
|
+
*.py[cod]
|
|
4
|
+
*$py.class
|
|
5
|
+
venv/
|
|
6
|
+
.env
|
|
7
|
+
|
|
8
|
+
# Project Assets (Generated dynamically)
|
|
9
|
+
assets/bg_*.mp4
|
|
10
|
+
assets/voice.mp3
|
|
11
|
+
assets/subs.json
|
|
12
|
+
*.png
|
|
13
|
+
*.mp4
|
|
14
|
+
!assets/avatars/*.mp4
|
|
15
|
+
!assets/avatars/*.png
|
|
16
|
+
!demos/ui_studio_preview.png
|
|
17
|
+
*.mp4.txt
|
|
18
|
+
*.json
|
|
19
|
+
!package.json
|
|
20
|
+
!package-lock.json
|
|
21
|
+
!tsconfig.json
|
|
22
|
+
!**/package.json
|
|
23
|
+
!**/package-lock.json
|
|
24
|
+
!**/tsconfig.json
|
|
25
|
+
remotion-video/temp_props_*.json
|
|
26
|
+
remotion-video/public/temp_assets/
|
|
27
|
+
*.mp3
|
|
28
|
+
actions-runner/*
|
|
29
|
+
|
|
30
|
+
# Secrets
|
|
31
|
+
client_secrets.json
|
|
32
|
+
client_secrets*.json
|
|
33
|
+
token.json
|
|
34
|
+
token*.json
|
|
35
|
+
.env
|
|
36
|
+
.env.*
|
|
37
|
+
|
|
38
|
+
# PyInstaller & Build Temp Files
|
|
39
|
+
build/
|
|
40
|
+
dist/
|
|
41
|
+
*.spec
|
|
42
|
+
*.log
|
|
43
|
+
|
|
44
|
+
# IDE
|
|
45
|
+
.vscode/
|
|
46
|
+
.idea/
|
|
47
|
+
|
|
48
|
+
assets/temp_*
|
|
49
|
+
!assets/avatars/
|
|
50
|
+
!assets/avatars/*
|
|
51
|
+
sessions*
|
|
52
|
+
test_manim_output/
|
|
53
|
+
PROMOTION_GUIDE.md
|
|
54
|
+
frame_*.jpg
|
|
55
|
+
temp_edge_cookies.sqlite
|
|
56
|
+
scratch/
|
|
57
|
+
# Local session hand-off notes (not published)
|
|
58
|
+
docs/HANDOFF.md
|
|
59
|
+
|
|
60
|
+
# Local MCP client config (absolute paths)
|
|
61
|
+
.mcp.json
|
|
62
|
+
|
|
63
|
+
# Bundled background music ships with the package
|
|
64
|
+
!music/*.mp3
|
shortsflow-0.1.0/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 shorts-generator
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
|
@@ -0,0 +1,308 @@
|
|
|
1
|
+
Metadata-Version: 2.5
|
|
2
|
+
Name: shortsflow
|
|
3
|
+
Version: 0.1.0
|
|
4
|
+
Summary: Self-hosted Opus Clip alternative: long videos to captioned 9:16 Shorts (Whisper, face tracking, active-speaker cuts, Remotion captions). CLI, REST API and MCP server.
|
|
5
|
+
Project-URL: Homepage, https://github.com/ghost1412/shorts-generator
|
|
6
|
+
Project-URL: Issues, https://github.com/ghost1412/shorts-generator/issues
|
|
7
|
+
License: MIT
|
|
8
|
+
License-File: LICENSE
|
|
9
|
+
Keywords: mcp,opus-clip,reels,remotion,shorts,tiktok,video,whisper
|
|
10
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
11
|
+
Classifier: Programming Language :: Python :: 3
|
|
12
|
+
Classifier: Topic :: Multimedia :: Video
|
|
13
|
+
Requires-Python: >=3.10
|
|
14
|
+
Requires-Dist: cryptography<47,>=43
|
|
15
|
+
Requires-Dist: edge-tts>=7.3.1
|
|
16
|
+
Requires-Dist: fastapi<1,>=0.115
|
|
17
|
+
Requires-Dist: google-api-python-client<3,>=2.150
|
|
18
|
+
Requires-Dist: google-auth-httplib2<1,>=0.2
|
|
19
|
+
Requires-Dist: google-auth-oauthlib<2,>=1.2
|
|
20
|
+
Requires-Dist: imageio-ffmpeg>=0.5
|
|
21
|
+
Requires-Dist: moviepy<3,>=2.1
|
|
22
|
+
Requires-Dist: nest-asyncio<2,>=1.6
|
|
23
|
+
Requires-Dist: numpy<3,>=1.26
|
|
24
|
+
Requires-Dist: pillow<12,>=10.4
|
|
25
|
+
Requires-Dist: python-dotenv<2,>=1.0
|
|
26
|
+
Requires-Dist: requests<3,>=2.32
|
|
27
|
+
Requires-Dist: supabase<3,>=2.10
|
|
28
|
+
Requires-Dist: uvicorn<1,>=0.30
|
|
29
|
+
Requires-Dist: yt-dlp>=2026.8.19
|
|
30
|
+
Provides-Extra: clip
|
|
31
|
+
Requires-Dist: librosa<0.12,>=0.10; extra == 'clip'
|
|
32
|
+
Requires-Dist: opencv-python<5,>=4.10; extra == 'clip'
|
|
33
|
+
Requires-Dist: soundfile<1,>=0.12; extra == 'clip'
|
|
34
|
+
Requires-Dist: stable-ts<3,>=2.17; extra == 'clip'
|
|
35
|
+
Provides-Extra: explainer
|
|
36
|
+
Requires-Dist: manim<0.22,>=0.19; extra == 'explainer'
|
|
37
|
+
Requires-Dist: manimpango<0.6.0; extra == 'explainer'
|
|
38
|
+
Provides-Extra: full
|
|
39
|
+
Requires-Dist: gradio<6,>=5; extra == 'full'
|
|
40
|
+
Requires-Dist: gtts<3,>=2.5; extra == 'full'
|
|
41
|
+
Requires-Dist: kokoro-onnx<1,>=0.4; extra == 'full'
|
|
42
|
+
Requires-Dist: librosa<0.12,>=0.10; extra == 'full'
|
|
43
|
+
Requires-Dist: manim<0.22,>=0.19; extra == 'full'
|
|
44
|
+
Requires-Dist: manimpango<0.6.0; extra == 'full'
|
|
45
|
+
Requires-Dist: opencv-python<5,>=4.10; extra == 'full'
|
|
46
|
+
Requires-Dist: soundfile<1,>=0.12; extra == 'full'
|
|
47
|
+
Requires-Dist: stable-ts<3,>=2.17; extra == 'full'
|
|
48
|
+
Provides-Extra: local-voice
|
|
49
|
+
Requires-Dist: kokoro-onnx<1,>=0.4; extra == 'local-voice'
|
|
50
|
+
Requires-Dist: soundfile<1,>=0.12; extra == 'local-voice'
|
|
51
|
+
Provides-Extra: webui
|
|
52
|
+
Requires-Dist: gradio<6,>=5; extra == 'webui'
|
|
53
|
+
Description-Content-Type: text/markdown
|
|
54
|
+
|
|
55
|
+
# ⚡ ShortsFlow AI Studio
|
|
56
|
+
|
|
57
|
+
> **The self-hosted Opus Clip alternative.**
|
|
58
|
+
> Paste a podcast or YouTube link, get captioned 9:16 Shorts that cut to whoever is talking. Free, local, no watermark, no credit caps.
|
|
59
|
+
|
|
60
|
+
**Clip long videos** with local Whisper, an LLM that scores the hooks, face-tracked 9:16 crops, a stacked two-speaker split or active-speaker switching, and Remotion spring captions.
|
|
61
|
+
**Or generate from an idea** with 30+ formats (facts quizzes, explainers, top-5 lists, stories) and drive everything from a browser UI, the CLI, Docker, Colab or an MCP agent.
|
|
62
|
+
|
|
63
|
+
<div align="center">
|
|
64
|
+
<img src="demos/demo_spot_the_lie.gif" width="220" alt="Spot the Lie short rendered by ShortsFlow" />
|
|
65
|
+
<img src="demos/demo_short.gif" width="220" alt="Viral Short Preview" />
|
|
66
|
+
<img src="demos/demo_facts.gif" width="220" alt="AI Facts Preview" />
|
|
67
|
+
<img src="demos/demo_explainer.gif" width="220" alt="Manim Explainer Preview" />
|
|
68
|
+
</div>
|
|
69
|
+
|
|
70
|
+
<p align="center">
|
|
71
|
+
🎬 <b>Running in production:</b> the YouTube channel <a href="https://www.youtube.com/@spottheliee">@spottheliee</a> is generated and posted
|
|
72
|
+
entirely by ShortsFlow - 6 "spot the lie" Shorts a day from <a href=".github/workflows/daily_generate.yml">one GitHub Actions workflow</a>.
|
|
73
|
+
</p>
|
|
74
|
+
|
|
75
|
+
<p align="center">
|
|
76
|
+
<a href="https://python.org"><img src="https://img.shields.io/badge/Python-3.12+-blue?style=flat&logo=python" alt="Python" /></a>
|
|
77
|
+
<a href="https://remotion.dev"><img src="https://img.shields.io/badge/Remotion-React_Video-61DAFB?style=flat&logo=react" alt="Remotion" /></a>
|
|
78
|
+
<a href="https://nvidia.com"><img src="https://img.shields.io/badge/CUDA-GPU_Accelerated-76B900?style=flat&logo=nvidia" alt="CUDA" /></a>
|
|
79
|
+
<a href="LICENSE"><img src="https://img.shields.io/badge/License-MIT-green?style=flat" alt="MIT License" /></a>
|
|
80
|
+
<a href="https://colab.research.google.com/github/ghost1412/shorts-generator/blob/main/ShortsFlow_Colab.ipynb"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open in Colab" /></a>
|
|
81
|
+
<a href="https://github.com/ghost1412/shorts-generator/stargazers"><img src="https://img.shields.io/github/stars/ghost1412/shorts-generator?style=flat&logo=github" alt="GitHub stars" /></a>
|
|
82
|
+
<a href="https://github.com/ghost1412/shorts-generator/actions/workflows/tests.yml"><img src="https://github.com/ghost1412/shorts-generator/actions/workflows/tests.yml/badge.svg" alt="Tests" /></a>
|
|
83
|
+
</p>
|
|
84
|
+
|
|
85
|
+
<p align="center"><b>⭐ If ShortsFlow saves you an Opus Clip subscription, please star the repo - it helps more creators find it.</b></p>
|
|
86
|
+
|
|
87
|
+
---
|
|
88
|
+
|
|
89
|
+
## ⚡ Quick Start - pick one
|
|
90
|
+
|
|
91
|
+
| Option | Command | Best for |
|
|
92
|
+
|---|---|---|
|
|
93
|
+
| ☁️ **Google Colab** (free GPU, zero install) | [](https://colab.research.google.com/github/ghost1412/shorts-generator/blob/main/ShortsFlow_Colab.ipynb) | Trying it in 5 minutes |
|
|
94
|
+
| 🐳 **Docker** (browser WebUI) | `docker run -p 7860:7860 -e GEMINI_API_KEY=your_key ghcr.io/ghost1412/shorts-generator` → open http://localhost:7860 | Servers, Linux, no Python setup |
|
|
95
|
+
| 📦 **pip** | `pip install "shortsflow @ git+https://github.com/ghost1412/shorts-generator"` then `shortsflow init` and `shortsflow doctor` | Using it as a command from anywhere |
|
|
96
|
+
| 🌐 **Browser WebUI** | `pip install -r requirements-full.txt && python webui.py` | Local use with a GPU |
|
|
97
|
+
| 🖥️ **Desktop Studio GUI** (Windows) | `setup.bat && launch.bat` | Windows desktop |
|
|
98
|
+
| 🤖 **AI agents** | `python mcp_server.py` or point your agent at [`SKILL.md`](SKILL.md) | Claude Code, Cursor, n8n |
|
|
99
|
+
|
|
100
|
+
```bash
|
|
101
|
+
git clone --depth 1 https://github.com/ghost1412/shorts-generator.git
|
|
102
|
+
cd shorts-generator
|
|
103
|
+
```
|
|
104
|
+
|
|
105
|
+
> 🐧 **Linux / macOS**: `chmod +x setup.sh && ./setup.sh && python3 webui.py`
|
|
106
|
+
|
|
107
|
+
---
|
|
108
|
+
|
|
109
|
+
## ⚡ ShortsFlow vs Opus Clip, Klap & Vizard
|
|
110
|
+
|
|
111
|
+
| | ⚡ ShortsFlow | Paid clippers |
|
|
112
|
+
|---|---|---|
|
|
113
|
+
| **Price** | Free (MIT). You pay only for the LLM key you choose, or $0 with Ollama | ~$19-49 / month with minute or credit caps |
|
|
114
|
+
| **Where your video goes** | Stays on your machine; Whisper runs locally | Uploaded to their cloud |
|
|
115
|
+
| **Watermark / export limits** | None | Watermark and caps on lower tiers |
|
|
116
|
+
| **Face-tracked 9:16 reframing** | ✅ | ✅ |
|
|
117
|
+
| **Podcast layouts** | ✅ single, stacked split, active-speaker switching | ✅ varies by tool |
|
|
118
|
+
| **Word-level animated captions** | ✅ Remotion (Hormozi, Glow Box, Bounce, Minimal) | ✅ |
|
|
119
|
+
| **Virality / hook score per clip** | ✅ in `--output_json` (WebUI view planned) | ✅ |
|
|
120
|
+
| **Dubbing** | ✅ | Often a paid add-on |
|
|
121
|
+
| **Idea-to-video (facts, explainers, stories)** | ✅ 30+ modes | ❌ clipping only |
|
|
122
|
+
| **Automation** | ✅ CLI, MCP server, Docker, GitHub Actions | API usually on higher tiers |
|
|
123
|
+
| **Polished timeline editor** | ❌ not yet | ✅ |
|
|
124
|
+
| **Multi-platform scheduling** | ✅ TikTok / Instagram / YouTube via Upload-Post (`python -m engine.publish`) | ✅ |
|
|
125
|
+
|
|
126
|
+
_Honest take: the paid tools have a nicer editor and scheduling. ShortsFlow wins on cost, privacy, and being scriptable._
|
|
127
|
+
|
|
128
|
+
---
|
|
129
|
+
|
|
130
|
+
## 🖥️ Desktop Studio GUI (`gui_app.py`)
|
|
131
|
+
|
|
132
|
+
<div align="center">
|
|
133
|
+
<img src="demos/ui_studio_preview.png" width="100%" alt="ShortsFlow AI Studio GUI Preview" />
|
|
134
|
+
</div>
|
|
135
|
+
|
|
136
|
+
- **3-Column Single-Window Studio Layout**: Live 9:16 vertical canvas preview, mode picker, preset cards, and 1-click render launcher.
|
|
137
|
+
- **Interactive Remotion Presets**: 1-click selection between `HORMOZI`, `GLOW_BOX`, `BOUNCE`, and `MINIMAL` spring captions.
|
|
138
|
+
|
|
139
|
+
---
|
|
140
|
+
|
|
141
|
+
## 🎬 Video Generator Modes
|
|
142
|
+
|
|
143
|
+
| Mode | Visual Format | Quick Command |
|
|
144
|
+
| :--- | :--- | :--- |
|
|
145
|
+
| ✂️ **AI Clipping** | Slices long YouTube/local videos into high-scoring vertical shorts | `py main.py --source_video "URL" --smart_crop` |
|
|
146
|
+
| 🔢 **Top 5 Countdown** | Numbered listicle countdown shorts (#5 ➔ #1) with rank badges | `py main.py --mode TOP_5 --category "inventions"` |
|
|
147
|
+
| 💬 **Chat Story** | Animated text message conversation shorts (iMessage format) | `py main.py --mode CHAT_STORY --category "mystery"` |
|
|
148
|
+
| 👥 **Podcast** | 2-speaker debate shorts with alternating multi-voice synthesis | `py main.py --mode PODCAST --prompt "AI future"` |
|
|
149
|
+
| 🌐 **Video Dubbing** | Multilingual video translation & voice re-synthesis | `py main.py --mode DUB --source_video "clip.mp4" --target_lang es` |
|
|
150
|
+
| 🧮 **Manim Explainer** | Programmatic 2D/3D math, CS, and science animations | `py main.py --mode EXPLAINER --prompt "Gravity"` |
|
|
151
|
+
| 💡 **AI Facts** | High-energy trivia & mystery facts with scene stock loops | `py main.py --mode FACTS --category "space"` |
|
|
152
|
+
| 📖 **AI Story** | Narrative story voiceover with visual scene stitching | `py main.py --mode STORY --category "sci-fi"` |
|
|
153
|
+
| 🤔 **This or That (WYR)** | Split-screen dilemma challenge with VS central badge | `py main.py --mode WYR --category "superpowers"` |
|
|
154
|
+
| 🧩 **Emoji Guess** | Interactive emoji puzzle game with animated reveal | `py main.py --mode EMOJI_GUESS --category "movies"` |
|
|
155
|
+
| 📰 **News Breakdown** | RSS news headline summary with cartoon personas | `py main.py --mode NEWS --cartoon --persona mafia_cat` |
|
|
156
|
+
|
|
157
|
+
---
|
|
158
|
+
|
|
159
|
+
## 🎛️ Engine Power Capabilities
|
|
160
|
+
|
|
161
|
+
| Capability | Supported Technologies & Flags |
|
|
162
|
+
| :--- | :--- |
|
|
163
|
+
| 🎙️ **Voice Synthesis & Cloning** | Local Kokoro TTS (`--tts_provider kokoro`, no key), Zero-Shot Voice Cloning (`--clone_voice "sample.wav"`), VoiceStudio Local REST (`--tts_provider voicestudio`), ElevenLabs, EdgeTTS |
|
|
164
|
+
| 📐 **Aspect Ratios** | `9:16` (Vertical), `16:9` (Landscape), `1:1` (Square), `4:5` (Social Feed) via `--aspect_ratio` |
|
|
165
|
+
| 🔊 **Audio Mastering & SFX** | Auto SFX (`whoosh`, `pop`, `riser`, `boom`), Dynamic BGM Audio Ducking (`--auto_ducking`), Studio Master Filter (`--enhance_audio`) |
|
|
166
|
+
| 🎥 **Motion & Visual Filters** | Dynamic Camera Push-In Zoom (`--enable_zoom`), 12 Color Grade Presets (`--video_filter cyberpunk`, `kurosawa`, `teal_orange`) |
|
|
167
|
+
| 📦 **Batch Automation** | Automated queue execution from CSV / text lists (`--batch_file "topics.txt"`) |
|
|
168
|
+
| 🤖 **Multi-LLM Matrix** | Google Gemini, Local Ollama (`qwen3:8b`), DeepSeek, Groq, Anthropic, OpenRouter (`--llm_provider`) |
|
|
169
|
+
|
|
170
|
+
---
|
|
171
|
+
|
|
172
|
+
## 🎨 Visual Color Grading Presets (`--video_filter`)
|
|
173
|
+
|
|
174
|
+
| Preset Name | Visual Atmosphere | Preset Name | Visual Atmosphere |
|
|
175
|
+
| :--- | :--- | :--- | :--- |
|
|
176
|
+
| **`dynamic`** | AI auto-switches color grade per scene beat | **`kurosawa`** | Black & White high-contrast samurai |
|
|
177
|
+
| **`cyberpunk`** | Neon boosted purples/blues for night sci-fi | **`teal_orange`** | Blockbuster movie cinematic color balance |
|
|
178
|
+
| **`cinematic_warm`** | Golden hour warmth for scenery & drama | **`vibrant_action`** | Sharp contrast & saturation for sports/action |
|
|
179
|
+
| **`vintage_vhs`** | Analog retro tape scanlines & color shift | **`moody_dark`** | Dark fantasy / horror shadow contrast |
|
|
180
|
+
|
|
181
|
+
---
|
|
182
|
+
|
|
183
|
+
## 🤖 Model Context Protocol (MCP) & AI Agent Server
|
|
184
|
+
|
|
185
|
+
ShortsFlow AI Studio provides a native **MCP Server** (`mcp_server.py`) allowing AI assistants (Claude Desktop, Cursor, Antigravity, n8n, AutoGPT) to create shorts autonomously:
|
|
186
|
+
|
|
187
|
+
```bash
|
|
188
|
+
# Launch MCP Server over standard I/O for AI IDEs & Workflow Engines
|
|
189
|
+
python mcp_server.py
|
|
190
|
+
```
|
|
191
|
+
|
|
192
|
+
### Available MCP Tools:
|
|
193
|
+
* `generate_short`: Create AI shorts from topics or prompts.
|
|
194
|
+
* `extract_clips`: Slice long YouTube videos into vertical shorts with face tracking, a stacked two-speaker split (`layout: split`) or active-speaker switching (`layout: active`).
|
|
195
|
+
* `generate_social_package`: Generate platform metadata (`.meta.json`) for YouTube Shorts, TikTok, and Reels.
|
|
196
|
+
* `get_render_status`: Query live rendering job progress.
|
|
197
|
+
|
|
198
|
+
---
|
|
199
|
+
|
|
200
|
+
## 🔌 REST API & Webhooks
|
|
201
|
+
|
|
202
|
+
```bash
|
|
203
|
+
pip install -r requirements-full.txt
|
|
204
|
+
SHORTSFLOW_API_KEY=change-me python -m shortsflow.api # http://127.0.0.1:8080/docs
|
|
205
|
+
```
|
|
206
|
+
|
|
207
|
+
```bash
|
|
208
|
+
curl -X POST localhost:8080/v1/clips -H "Authorization: Bearer change-me" -H "Content-Type: application/json" -d '{"source_video": "https://youtu.be/VIDEO_ID", "layout": "active", "clip_count": 3, "webhook_url": "https://example.com/hook"}'
|
|
209
|
+
# -> {"id": "a1b2c3", "status": "queued", "url": "/v1/jobs/a1b2c3"}
|
|
210
|
+
curl localhost:8080/v1/jobs/a1b2c3 -H "Authorization: Bearer change-me" # status + files[] download links
|
|
211
|
+
```
|
|
212
|
+
|
|
213
|
+
`POST /v1/shorts` generates from an idea (`mode`, `category`, `prompt`...). Webhooks are signed with
|
|
214
|
+
`X-ShortsFlow-Signature: sha256=<HMAC of body>` when `SHORTSFLOW_WEBHOOK_SECRET` is set. Jobs run one at a time by default
|
|
215
|
+
(`SHORTSFLOW_MAX_CONCURRENT`). With Docker: `SHORTSFLOW_API_KEY=change-me docker compose --profile api up api` (refuses to start without a key). A ready-made n8n flow lives in [`examples/n8n/`](examples/n8n/shortsflow-clip-workflow.json).
|
|
216
|
+
|
|
217
|
+
---
|
|
218
|
+
|
|
219
|
+
## 📤 Publish & Schedule (TikTok, Instagram Reels, YouTube Shorts)
|
|
220
|
+
|
|
221
|
+
Clip extraction writes `metadata.json` (title, description, tags) and a badge thumbnail next to every clip. Post them with
|
|
222
|
+
[Upload-Post](https://upload-post.com), which holds the platform logins (set `UPLOAD_POST_API_KEY` and `UPLOAD_POST_USER`):
|
|
223
|
+
|
|
224
|
+
```bash
|
|
225
|
+
# preview what would be posted, then post now or stagger one clip every 3 hours
|
|
226
|
+
python -m engine.publish sessions/extraction_123/metadata.json --platforms tiktok,instagram,youtube --dry-run
|
|
227
|
+
python -m engine.publish sessions/extraction_123/metadata.json --platforms tiktok,instagram --start 2026-11-02T10:00 --every 180 --timezone Europe/Madrid
|
|
228
|
+
```
|
|
229
|
+
|
|
230
|
+
---
|
|
231
|
+
|
|
232
|
+
## 🏷️ Brand Kit
|
|
233
|
+
|
|
234
|
+
Burn your logo, `@handle` and a closing end card into every clip (placed clear of the Shorts/Reels UI):
|
|
235
|
+
|
|
236
|
+
```bash
|
|
237
|
+
py main.py --source_video "URL" --logo logo.png --handle @mychannel --end_card "Follow for more"
|
|
238
|
+
py main.py --source_video "URL" --brand examples/brand.json # same thing as a preset file
|
|
239
|
+
python -m engine.branding existing_clip.mp4 --logo logo.png --handle @mychannel # any finished video
|
|
240
|
+
```
|
|
241
|
+
|
|
242
|
+
---
|
|
243
|
+
|
|
244
|
+
## 💡 Top Command Recipes
|
|
245
|
+
|
|
246
|
+
```bash
|
|
247
|
+
# 1. Podcast Shorts that cut to whoever is talking (stacked split when unsure) + silence removal
|
|
248
|
+
py main.py --source_video "https://www.youtube.com/watch?v=VIDEO_ID" --extract_mode shorts --layout active --tighten --use_remotion
|
|
249
|
+
|
|
250
|
+
# 1b. Prompt-based clipping: only the moments that match your request (LLM search, keyword fallback offline)
|
|
251
|
+
py main.py --source_video "https://www.youtube.com/watch?v=VIDEO_ID" --find "where they discuss pricing" --clip_count 3 --use_remotion
|
|
252
|
+
|
|
253
|
+
# 1a. Cut the ums and uhs (and silences) out of clips
|
|
254
|
+
py main.py --source_video "URL" --tighten --remove_fillers --use_remotion
|
|
255
|
+
|
|
256
|
+
# 1c. Emoji pop on keywords in HORMOZI/BOUNCE captions (needs an emoji font; included in the Docker image)
|
|
257
|
+
py main.py --source_video "URL" --use_remotion --caption_style HORMOZI --caption_emoji
|
|
258
|
+
|
|
259
|
+
# 1d. Fully local, zero-cost voice: Kokoro TTS (no API key; ~120 MB model downloads once)
|
|
260
|
+
py main.py --mode FACTS --category "space" --tts_provider kokoro --voice af_heart --use_remotion
|
|
261
|
+
|
|
262
|
+
# 2. High-Retention Short with Voice Cloning, Zoom Motion & Audio Ducking
|
|
263
|
+
py main.py --mode FACTS --category "cyberpunk AI" --tts_provider voicestudio --clone_voice "my_voice.wav" --enable_zoom --auto_ducking --use_remotion
|
|
264
|
+
|
|
265
|
+
# 3. Render Landscape 16:9 YouTube Video with SFX
|
|
266
|
+
py main.py --mode EXPLAINER --prompt "Quantum physics" --aspect_ratio 16:9 --sfx_preset whoosh
|
|
267
|
+
|
|
268
|
+
# 4. Translate and Dub Video into Spanish
|
|
269
|
+
py main.py --mode DUB --source_video "https://www.youtube.com/watch?v=VIDEO_ID" --target_lang es --use_remotion
|
|
270
|
+
|
|
271
|
+
# 5. Process Batch Content Calendar Queue
|
|
272
|
+
py main.py --batch_file "topics.txt" --mode FACTS --aspect_ratio 9:16 --use_remotion
|
|
273
|
+
```
|
|
274
|
+
|
|
275
|
+
---
|
|
276
|
+
|
|
277
|
+
## ⚙️ Environment Configuration (`.env`)
|
|
278
|
+
|
|
279
|
+
Rename `env.example` to `.env`:
|
|
280
|
+
|
|
281
|
+
```env
|
|
282
|
+
GEMINI_API_KEY=your_gemini_key_here
|
|
283
|
+
HF_API_KEY=your_huggingface_key_here
|
|
284
|
+
PEXELS_API_KEY=your_pexels_key_here
|
|
285
|
+
|
|
286
|
+
# Local Voice Studio & Production Defaults
|
|
287
|
+
VOICE_PROVIDER=auto
|
|
288
|
+
VOICE_STUDIO_URL=http://localhost:8000/v1/audio/speech
|
|
289
|
+
DEFAULT_ASPECT_RATIO=9:16
|
|
290
|
+
AUTO_DUCKING=true
|
|
291
|
+
```
|
|
292
|
+
|
|
293
|
+
---
|
|
294
|
+
|
|
295
|
+
## 🤖 AI Agent Onboarding
|
|
296
|
+
|
|
297
|
+
If you are an AI Coding Agent (Cursor, Antigravity, Claude Code, Copilot, AutoGPT) onboarding into this codebase, see **[AGENTS.md](AGENTS.md)** for structured architectural context, module maps, CLI skills, and execution rules, and **[ROADMAP.md](ROADMAP.md)** for the open task board.
|
|
298
|
+
|
|
299
|
+
---
|
|
300
|
+
|
|
301
|
+
## ⭐ Star History
|
|
302
|
+
|
|
303
|
+
[](https://star-history.com/#ghost1412/shorts-generator&Date)
|
|
304
|
+
|
|
305
|
+
---
|
|
306
|
+
|
|
307
|
+
## 📄 License
|
|
308
|
+
ShortsFlow AI Studio is open-source software licensed under the MIT License.
|
|
@@ -0,0 +1,254 @@
|
|
|
1
|
+
# ⚡ ShortsFlow AI Studio
|
|
2
|
+
|
|
3
|
+
> **The self-hosted Opus Clip alternative.**
|
|
4
|
+
> Paste a podcast or YouTube link, get captioned 9:16 Shorts that cut to whoever is talking. Free, local, no watermark, no credit caps.
|
|
5
|
+
|
|
6
|
+
**Clip long videos** with local Whisper, an LLM that scores the hooks, face-tracked 9:16 crops, a stacked two-speaker split or active-speaker switching, and Remotion spring captions.
|
|
7
|
+
**Or generate from an idea** with 30+ formats (facts quizzes, explainers, top-5 lists, stories) and drive everything from a browser UI, the CLI, Docker, Colab or an MCP agent.
|
|
8
|
+
|
|
9
|
+
<div align="center">
|
|
10
|
+
<img src="demos/demo_spot_the_lie.gif" width="220" alt="Spot the Lie short rendered by ShortsFlow" />
|
|
11
|
+
<img src="demos/demo_short.gif" width="220" alt="Viral Short Preview" />
|
|
12
|
+
<img src="demos/demo_facts.gif" width="220" alt="AI Facts Preview" />
|
|
13
|
+
<img src="demos/demo_explainer.gif" width="220" alt="Manim Explainer Preview" />
|
|
14
|
+
</div>
|
|
15
|
+
|
|
16
|
+
<p align="center">
|
|
17
|
+
🎬 <b>Running in production:</b> the YouTube channel <a href="https://www.youtube.com/@spottheliee">@spottheliee</a> is generated and posted
|
|
18
|
+
entirely by ShortsFlow - 6 "spot the lie" Shorts a day from <a href=".github/workflows/daily_generate.yml">one GitHub Actions workflow</a>.
|
|
19
|
+
</p>
|
|
20
|
+
|
|
21
|
+
<p align="center">
|
|
22
|
+
<a href="https://python.org"><img src="https://img.shields.io/badge/Python-3.12+-blue?style=flat&logo=python" alt="Python" /></a>
|
|
23
|
+
<a href="https://remotion.dev"><img src="https://img.shields.io/badge/Remotion-React_Video-61DAFB?style=flat&logo=react" alt="Remotion" /></a>
|
|
24
|
+
<a href="https://nvidia.com"><img src="https://img.shields.io/badge/CUDA-GPU_Accelerated-76B900?style=flat&logo=nvidia" alt="CUDA" /></a>
|
|
25
|
+
<a href="LICENSE"><img src="https://img.shields.io/badge/License-MIT-green?style=flat" alt="MIT License" /></a>
|
|
26
|
+
<a href="https://colab.research.google.com/github/ghost1412/shorts-generator/blob/main/ShortsFlow_Colab.ipynb"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open in Colab" /></a>
|
|
27
|
+
<a href="https://github.com/ghost1412/shorts-generator/stargazers"><img src="https://img.shields.io/github/stars/ghost1412/shorts-generator?style=flat&logo=github" alt="GitHub stars" /></a>
|
|
28
|
+
<a href="https://github.com/ghost1412/shorts-generator/actions/workflows/tests.yml"><img src="https://github.com/ghost1412/shorts-generator/actions/workflows/tests.yml/badge.svg" alt="Tests" /></a>
|
|
29
|
+
</p>
|
|
30
|
+
|
|
31
|
+
<p align="center"><b>⭐ If ShortsFlow saves you an Opus Clip subscription, please star the repo - it helps more creators find it.</b></p>
|
|
32
|
+
|
|
33
|
+
---
|
|
34
|
+
|
|
35
|
+
## ⚡ Quick Start - pick one
|
|
36
|
+
|
|
37
|
+
| Option | Command | Best for |
|
|
38
|
+
|---|---|---|
|
|
39
|
+
| ☁️ **Google Colab** (free GPU, zero install) | [](https://colab.research.google.com/github/ghost1412/shorts-generator/blob/main/ShortsFlow_Colab.ipynb) | Trying it in 5 minutes |
|
|
40
|
+
| 🐳 **Docker** (browser WebUI) | `docker run -p 7860:7860 -e GEMINI_API_KEY=your_key ghcr.io/ghost1412/shorts-generator` → open http://localhost:7860 | Servers, Linux, no Python setup |
|
|
41
|
+
| 📦 **pip** | `pip install "shortsflow @ git+https://github.com/ghost1412/shorts-generator"` then `shortsflow init` and `shortsflow doctor` | Using it as a command from anywhere |
|
|
42
|
+
| 🌐 **Browser WebUI** | `pip install -r requirements-full.txt && python webui.py` | Local use with a GPU |
|
|
43
|
+
| 🖥️ **Desktop Studio GUI** (Windows) | `setup.bat && launch.bat` | Windows desktop |
|
|
44
|
+
| 🤖 **AI agents** | `python mcp_server.py` or point your agent at [`SKILL.md`](SKILL.md) | Claude Code, Cursor, n8n |
|
|
45
|
+
|
|
46
|
+
```bash
|
|
47
|
+
git clone --depth 1 https://github.com/ghost1412/shorts-generator.git
|
|
48
|
+
cd shorts-generator
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
> 🐧 **Linux / macOS**: `chmod +x setup.sh && ./setup.sh && python3 webui.py`
|
|
52
|
+
|
|
53
|
+
---
|
|
54
|
+
|
|
55
|
+
## ⚡ ShortsFlow vs Opus Clip, Klap & Vizard
|
|
56
|
+
|
|
57
|
+
| | ⚡ ShortsFlow | Paid clippers |
|
|
58
|
+
|---|---|---|
|
|
59
|
+
| **Price** | Free (MIT). You pay only for the LLM key you choose, or $0 with Ollama | ~$19-49 / month with minute or credit caps |
|
|
60
|
+
| **Where your video goes** | Stays on your machine; Whisper runs locally | Uploaded to their cloud |
|
|
61
|
+
| **Watermark / export limits** | None | Watermark and caps on lower tiers |
|
|
62
|
+
| **Face-tracked 9:16 reframing** | ✅ | ✅ |
|
|
63
|
+
| **Podcast layouts** | ✅ single, stacked split, active-speaker switching | ✅ varies by tool |
|
|
64
|
+
| **Word-level animated captions** | ✅ Remotion (Hormozi, Glow Box, Bounce, Minimal) | ✅ |
|
|
65
|
+
| **Virality / hook score per clip** | ✅ in `--output_json` (WebUI view planned) | ✅ |
|
|
66
|
+
| **Dubbing** | ✅ | Often a paid add-on |
|
|
67
|
+
| **Idea-to-video (facts, explainers, stories)** | ✅ 30+ modes | ❌ clipping only |
|
|
68
|
+
| **Automation** | ✅ CLI, MCP server, Docker, GitHub Actions | API usually on higher tiers |
|
|
69
|
+
| **Polished timeline editor** | ❌ not yet | ✅ |
|
|
70
|
+
| **Multi-platform scheduling** | ✅ TikTok / Instagram / YouTube via Upload-Post (`python -m engine.publish`) | ✅ |
|
|
71
|
+
|
|
72
|
+
_Honest take: the paid tools have a nicer editor and scheduling. ShortsFlow wins on cost, privacy, and being scriptable._
|
|
73
|
+
|
|
74
|
+
---
|
|
75
|
+
|
|
76
|
+
## 🖥️ Desktop Studio GUI (`gui_app.py`)
|
|
77
|
+
|
|
78
|
+
<div align="center">
|
|
79
|
+
<img src="demos/ui_studio_preview.png" width="100%" alt="ShortsFlow AI Studio GUI Preview" />
|
|
80
|
+
</div>
|
|
81
|
+
|
|
82
|
+
- **3-Column Single-Window Studio Layout**: Live 9:16 vertical canvas preview, mode picker, preset cards, and 1-click render launcher.
|
|
83
|
+
- **Interactive Remotion Presets**: 1-click selection between `HORMOZI`, `GLOW_BOX`, `BOUNCE`, and `MINIMAL` spring captions.
|
|
84
|
+
|
|
85
|
+
---
|
|
86
|
+
|
|
87
|
+
## 🎬 Video Generator Modes
|
|
88
|
+
|
|
89
|
+
| Mode | Visual Format | Quick Command |
|
|
90
|
+
| :--- | :--- | :--- |
|
|
91
|
+
| ✂️ **AI Clipping** | Slices long YouTube/local videos into high-scoring vertical shorts | `py main.py --source_video "URL" --smart_crop` |
|
|
92
|
+
| 🔢 **Top 5 Countdown** | Numbered listicle countdown shorts (#5 ➔ #1) with rank badges | `py main.py --mode TOP_5 --category "inventions"` |
|
|
93
|
+
| 💬 **Chat Story** | Animated text message conversation shorts (iMessage format) | `py main.py --mode CHAT_STORY --category "mystery"` |
|
|
94
|
+
| 👥 **Podcast** | 2-speaker debate shorts with alternating multi-voice synthesis | `py main.py --mode PODCAST --prompt "AI future"` |
|
|
95
|
+
| 🌐 **Video Dubbing** | Multilingual video translation & voice re-synthesis | `py main.py --mode DUB --source_video "clip.mp4" --target_lang es` |
|
|
96
|
+
| 🧮 **Manim Explainer** | Programmatic 2D/3D math, CS, and science animations | `py main.py --mode EXPLAINER --prompt "Gravity"` |
|
|
97
|
+
| 💡 **AI Facts** | High-energy trivia & mystery facts with scene stock loops | `py main.py --mode FACTS --category "space"` |
|
|
98
|
+
| 📖 **AI Story** | Narrative story voiceover with visual scene stitching | `py main.py --mode STORY --category "sci-fi"` |
|
|
99
|
+
| 🤔 **This or That (WYR)** | Split-screen dilemma challenge with VS central badge | `py main.py --mode WYR --category "superpowers"` |
|
|
100
|
+
| 🧩 **Emoji Guess** | Interactive emoji puzzle game with animated reveal | `py main.py --mode EMOJI_GUESS --category "movies"` |
|
|
101
|
+
| 📰 **News Breakdown** | RSS news headline summary with cartoon personas | `py main.py --mode NEWS --cartoon --persona mafia_cat` |
|
|
102
|
+
|
|
103
|
+
---
|
|
104
|
+
|
|
105
|
+
## 🎛️ Engine Power Capabilities
|
|
106
|
+
|
|
107
|
+
| Capability | Supported Technologies & Flags |
|
|
108
|
+
| :--- | :--- |
|
|
109
|
+
| 🎙️ **Voice Synthesis & Cloning** | Local Kokoro TTS (`--tts_provider kokoro`, no key), Zero-Shot Voice Cloning (`--clone_voice "sample.wav"`), VoiceStudio Local REST (`--tts_provider voicestudio`), ElevenLabs, EdgeTTS |
|
|
110
|
+
| 📐 **Aspect Ratios** | `9:16` (Vertical), `16:9` (Landscape), `1:1` (Square), `4:5` (Social Feed) via `--aspect_ratio` |
|
|
111
|
+
| 🔊 **Audio Mastering & SFX** | Auto SFX (`whoosh`, `pop`, `riser`, `boom`), Dynamic BGM Audio Ducking (`--auto_ducking`), Studio Master Filter (`--enhance_audio`) |
|
|
112
|
+
| 🎥 **Motion & Visual Filters** | Dynamic Camera Push-In Zoom (`--enable_zoom`), 12 Color Grade Presets (`--video_filter cyberpunk`, `kurosawa`, `teal_orange`) |
|
|
113
|
+
| 📦 **Batch Automation** | Automated queue execution from CSV / text lists (`--batch_file "topics.txt"`) |
|
|
114
|
+
| 🤖 **Multi-LLM Matrix** | Google Gemini, Local Ollama (`qwen3:8b`), DeepSeek, Groq, Anthropic, OpenRouter (`--llm_provider`) |
|
|
115
|
+
|
|
116
|
+
---
|
|
117
|
+
|
|
118
|
+
## 🎨 Visual Color Grading Presets (`--video_filter`)
|
|
119
|
+
|
|
120
|
+
| Preset Name | Visual Atmosphere | Preset Name | Visual Atmosphere |
|
|
121
|
+
| :--- | :--- | :--- | :--- |
|
|
122
|
+
| **`dynamic`** | AI auto-switches color grade per scene beat | **`kurosawa`** | Black & White high-contrast samurai |
|
|
123
|
+
| **`cyberpunk`** | Neon boosted purples/blues for night sci-fi | **`teal_orange`** | Blockbuster movie cinematic color balance |
|
|
124
|
+
| **`cinematic_warm`** | Golden hour warmth for scenery & drama | **`vibrant_action`** | Sharp contrast & saturation for sports/action |
|
|
125
|
+
| **`vintage_vhs`** | Analog retro tape scanlines & color shift | **`moody_dark`** | Dark fantasy / horror shadow contrast |
|
|
126
|
+
|
|
127
|
+
---
|
|
128
|
+
|
|
129
|
+
## 🤖 Model Context Protocol (MCP) & AI Agent Server
|
|
130
|
+
|
|
131
|
+
ShortsFlow AI Studio provides a native **MCP Server** (`mcp_server.py`) allowing AI assistants (Claude Desktop, Cursor, Antigravity, n8n, AutoGPT) to create shorts autonomously:
|
|
132
|
+
|
|
133
|
+
```bash
|
|
134
|
+
# Launch MCP Server over standard I/O for AI IDEs & Workflow Engines
|
|
135
|
+
python mcp_server.py
|
|
136
|
+
```
|
|
137
|
+
|
|
138
|
+
### Available MCP Tools:
|
|
139
|
+
* `generate_short`: Create AI shorts from topics or prompts.
|
|
140
|
+
* `extract_clips`: Slice long YouTube videos into vertical shorts with face tracking, a stacked two-speaker split (`layout: split`) or active-speaker switching (`layout: active`).
|
|
141
|
+
* `generate_social_package`: Generate platform metadata (`.meta.json`) for YouTube Shorts, TikTok, and Reels.
|
|
142
|
+
* `get_render_status`: Query live rendering job progress.
|
|
143
|
+
|
|
144
|
+
---
|
|
145
|
+
|
|
146
|
+
## 🔌 REST API & Webhooks
|
|
147
|
+
|
|
148
|
+
```bash
|
|
149
|
+
pip install -r requirements-full.txt
|
|
150
|
+
SHORTSFLOW_API_KEY=change-me python -m shortsflow.api # http://127.0.0.1:8080/docs
|
|
151
|
+
```
|
|
152
|
+
|
|
153
|
+
```bash
|
|
154
|
+
curl -X POST localhost:8080/v1/clips -H "Authorization: Bearer change-me" -H "Content-Type: application/json" -d '{"source_video": "https://youtu.be/VIDEO_ID", "layout": "active", "clip_count": 3, "webhook_url": "https://example.com/hook"}'
|
|
155
|
+
# -> {"id": "a1b2c3", "status": "queued", "url": "/v1/jobs/a1b2c3"}
|
|
156
|
+
curl localhost:8080/v1/jobs/a1b2c3 -H "Authorization: Bearer change-me" # status + files[] download links
|
|
157
|
+
```
|
|
158
|
+
|
|
159
|
+
`POST /v1/shorts` generates from an idea (`mode`, `category`, `prompt`...). Webhooks are signed with
|
|
160
|
+
`X-ShortsFlow-Signature: sha256=<HMAC of body>` when `SHORTSFLOW_WEBHOOK_SECRET` is set. Jobs run one at a time by default
|
|
161
|
+
(`SHORTSFLOW_MAX_CONCURRENT`). With Docker: `SHORTSFLOW_API_KEY=change-me docker compose --profile api up api` (refuses to start without a key). A ready-made n8n flow lives in [`examples/n8n/`](examples/n8n/shortsflow-clip-workflow.json).
|
|
162
|
+
|
|
163
|
+
---
|
|
164
|
+
|
|
165
|
+
## 📤 Publish & Schedule (TikTok, Instagram Reels, YouTube Shorts)
|
|
166
|
+
|
|
167
|
+
Clip extraction writes `metadata.json` (title, description, tags) and a badge thumbnail next to every clip. Post them with
|
|
168
|
+
[Upload-Post](https://upload-post.com), which holds the platform logins (set `UPLOAD_POST_API_KEY` and `UPLOAD_POST_USER`):
|
|
169
|
+
|
|
170
|
+
```bash
|
|
171
|
+
# preview what would be posted, then post now or stagger one clip every 3 hours
|
|
172
|
+
python -m engine.publish sessions/extraction_123/metadata.json --platforms tiktok,instagram,youtube --dry-run
|
|
173
|
+
python -m engine.publish sessions/extraction_123/metadata.json --platforms tiktok,instagram --start 2026-11-02T10:00 --every 180 --timezone Europe/Madrid
|
|
174
|
+
```
|
|
175
|
+
|
|
176
|
+
---
|
|
177
|
+
|
|
178
|
+
## 🏷️ Brand Kit
|
|
179
|
+
|
|
180
|
+
Burn your logo, `@handle` and a closing end card into every clip (placed clear of the Shorts/Reels UI):
|
|
181
|
+
|
|
182
|
+
```bash
|
|
183
|
+
py main.py --source_video "URL" --logo logo.png --handle @mychannel --end_card "Follow for more"
|
|
184
|
+
py main.py --source_video "URL" --brand examples/brand.json # same thing as a preset file
|
|
185
|
+
python -m engine.branding existing_clip.mp4 --logo logo.png --handle @mychannel # any finished video
|
|
186
|
+
```
|
|
187
|
+
|
|
188
|
+
---
|
|
189
|
+
|
|
190
|
+
## 💡 Top Command Recipes
|
|
191
|
+
|
|
192
|
+
```bash
|
|
193
|
+
# 1. Podcast Shorts that cut to whoever is talking (stacked split when unsure) + silence removal
|
|
194
|
+
py main.py --source_video "https://www.youtube.com/watch?v=VIDEO_ID" --extract_mode shorts --layout active --tighten --use_remotion
|
|
195
|
+
|
|
196
|
+
# 1b. Prompt-based clipping: only the moments that match your request (LLM search, keyword fallback offline)
|
|
197
|
+
py main.py --source_video "https://www.youtube.com/watch?v=VIDEO_ID" --find "where they discuss pricing" --clip_count 3 --use_remotion
|
|
198
|
+
|
|
199
|
+
# 1a. Cut the ums and uhs (and silences) out of clips
|
|
200
|
+
py main.py --source_video "URL" --tighten --remove_fillers --use_remotion
|
|
201
|
+
|
|
202
|
+
# 1c. Emoji pop on keywords in HORMOZI/BOUNCE captions (needs an emoji font; included in the Docker image)
|
|
203
|
+
py main.py --source_video "URL" --use_remotion --caption_style HORMOZI --caption_emoji
|
|
204
|
+
|
|
205
|
+
# 1d. Fully local, zero-cost voice: Kokoro TTS (no API key; ~120 MB model downloads once)
|
|
206
|
+
py main.py --mode FACTS --category "space" --tts_provider kokoro --voice af_heart --use_remotion
|
|
207
|
+
|
|
208
|
+
# 2. High-Retention Short with Voice Cloning, Zoom Motion & Audio Ducking
|
|
209
|
+
py main.py --mode FACTS --category "cyberpunk AI" --tts_provider voicestudio --clone_voice "my_voice.wav" --enable_zoom --auto_ducking --use_remotion
|
|
210
|
+
|
|
211
|
+
# 3. Render Landscape 16:9 YouTube Video with SFX
|
|
212
|
+
py main.py --mode EXPLAINER --prompt "Quantum physics" --aspect_ratio 16:9 --sfx_preset whoosh
|
|
213
|
+
|
|
214
|
+
# 4. Translate and Dub Video into Spanish
|
|
215
|
+
py main.py --mode DUB --source_video "https://www.youtube.com/watch?v=VIDEO_ID" --target_lang es --use_remotion
|
|
216
|
+
|
|
217
|
+
# 5. Process Batch Content Calendar Queue
|
|
218
|
+
py main.py --batch_file "topics.txt" --mode FACTS --aspect_ratio 9:16 --use_remotion
|
|
219
|
+
```
|
|
220
|
+
|
|
221
|
+
---
|
|
222
|
+
|
|
223
|
+
## ⚙️ Environment Configuration (`.env`)
|
|
224
|
+
|
|
225
|
+
Rename `env.example` to `.env`:
|
|
226
|
+
|
|
227
|
+
```env
|
|
228
|
+
GEMINI_API_KEY=your_gemini_key_here
|
|
229
|
+
HF_API_KEY=your_huggingface_key_here
|
|
230
|
+
PEXELS_API_KEY=your_pexels_key_here
|
|
231
|
+
|
|
232
|
+
# Local Voice Studio & Production Defaults
|
|
233
|
+
VOICE_PROVIDER=auto
|
|
234
|
+
VOICE_STUDIO_URL=http://localhost:8000/v1/audio/speech
|
|
235
|
+
DEFAULT_ASPECT_RATIO=9:16
|
|
236
|
+
AUTO_DUCKING=true
|
|
237
|
+
```
|
|
238
|
+
|
|
239
|
+
---
|
|
240
|
+
|
|
241
|
+
## 🤖 AI Agent Onboarding
|
|
242
|
+
|
|
243
|
+
If you are an AI Coding Agent (Cursor, Antigravity, Claude Code, Copilot, AutoGPT) onboarding into this codebase, see **[AGENTS.md](AGENTS.md)** for structured architectural context, module maps, CLI skills, and execution rules, and **[ROADMAP.md](ROADMAP.md)** for the open task board.
|
|
244
|
+
|
|
245
|
+
---
|
|
246
|
+
|
|
247
|
+
## ⭐ Star History
|
|
248
|
+
|
|
249
|
+
[](https://star-history.com/#ghost1412/shorts-generator&Date)
|
|
250
|
+
|
|
251
|
+
---
|
|
252
|
+
|
|
253
|
+
## 📄 License
|
|
254
|
+
ShortsFlow AI Studio is open-source software licensed under the MIT License.
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|