leamsigc/ShortsGenerator
Automate the creation of Shorts content locally with a couple simple steps.
ShortsGenerator – Automated YouTube Shorts Builder
What it does
- Generates a short‑form video from a text prompt using AI‑written scripts, stock footage, text‑to‑speech, subtitles, background music and optional image stitching.
- Provides a web UI (Nuxt 3) that talks to a Flask backend. The backend runs the whole pipeline and exposes a set of REST endpoints.
- After a video is built you can schedule it to several social platforms (Instagram, TikTok, Facebook, LinkedIn, YouTube) through the MagicSync integration.
Key components
| Layer | Tech / Role |
|---|---|
| Backend | Python 3.11, Flask, ffmpeg, Torch (for Qwen‑3 TTS), g4f/Gemini for script generation. Handles stock‑video search (Pexels API), TTS (Supertonic, TikTok, KittenTTS, Qwen‑3), subtitle rendering, video stitching, and the MagicSync API calls. |
| Frontend | Nuxt 3 (Vue) UI, runs on localhost:3000. Lets you enter a subject, edit the generated script, pick voices, subtitles, aspect ratio, music, etc., then triggers the backend via the documented API. |
| AI models | • Script: free g4f (browser‑cookie based) or Gemini (via GOOGLE_API_KEY). |
| • TTS: local Supertonic (10 voices, 33 languages), TikTok TTS (fallback), KittenTTS, Qwen‑3‑TTS (local model with 9 preset timbres, voice‑design, voice‑clone). | |
| Media sources | Stock clips from Pexels, user‑provided music files, optional image‑stitching at the start of the video. |
| Scheduling | MagicSync – you can store multiple business accounts (API URL + token) and pick which one to use when posting. |
How you use it
- Clone the repo, copy
.env.exampleto.envand fill in at leastPEXELS_API_KEYandIMAGEMAGICK_BINARY. - Run the backend (
python Backend/main.py) and the Nuxt UI (cd UI && pnpm i && npx nuxt dev --tunnel). Docker is also supported viadocker compose up -d. - In the web UI, type a video subject, generate a script, tweak it, choose a voice and subtitle style, add optional images or music, then click Generate.
- When the video finishes you can extract a thumbnail, preview it, and schedule the upload through MagicSync.
Notable features
- Multi‑voice TTS with local high‑quality models (Qwen‑3) and fallbacks.
- Subtitle templates (10 visual styles) generated automatically.
- Aspect‑ratio flexibility for vertical Shorts (9:16) or other formats.
- Hardware acceleration – detects a GPU and passes it to ffmpeg/Torch for faster encoding.
- Multi‑business MagicSync – store separate API credentials per client and select the right one when scheduling.
Who might find it useful
- Content creators who want to batch‑produce YouTube Shorts without manually editing video.
- Small agencies managing several brand accounts and needing a repeatable pipeline.
- Developers looking for an open‑source reference implementation of an end‑to‑end short‑form video generation stack.
Limitations
- Requires Python 3.11 and a fairly heavy dependency stack (Torch, Qwen‑3 weights ≈ 3 GB).
- Some AI services (Gemini, OpenAI) need API keys; the free
g4fpath depends on browser cookies. - Scheduling works only with the proprietary MagicSync service; the repo does not provide a generic social‑media API.
License
- The project is released under the license found in the
LICENSEfile (not reproduced here).
Related
- Project
- Project
- Project
- Project
- Project