--- title: Tricket emoji: 🎬 colorFrom: purple colorTo: blue sdk: gradio sdk_version: 6.5.1 app_file: app.py pinned: false short_description: One prompt β†’ a vertical product ad video --- # 🎬 tricket β€” one prompt β†’ a product ad video Describe a product and tricket produces a finished **vertical (9:16) ad**: 1. **GLM-4.6** (via the HF inference router) writes a multi-scene ad script. 2. **FLUX.1-schnell** paints each scene. 3. **Kokoro** voices the narration (English or δΈ­ζ–‡). 4. **ffmpeg** cuts it together β€” Ken Burns motion, burned captions, voiceover β€” into an MP4. All GPU work runs **on-demand on [Modal](https://modal.com)** and scales to zero when idle. > Built for the build-small hackathon. ## Architecture ``` HF Space (Gradio, this repo) Modal.com (app: tricket-flux) app.py ── GLM script (HF router) ── Model.generate (FLUX.1-schnell, A100) per scene ── TTS.synth (Kokoro, CPU) per scene ── assemble_video (ffmpeg, CPU) β†’ 9:16 MP4 ``` Two tabs: **🎬 Ad Studio** (the pipeline above) and **πŸ–Ό Single Image** (plain FLUX text-to-image). ## Setup (for maintainers) 1. Deploy the backend (Modal CLI authenticated): ```bash modal secret create huggingface HF_TOKEN=hf_xxx # FLUX is gated modal deploy modal_app.py ``` 2. Set this Space's secrets (Settings β†’ Variables and secrets): - `MODAL_TOKEN_ID`, `MODAL_TOKEN_SECRET` β€” call Modal from the Space - `HF_TOKEN` β€” used by the GLM script writer (router.huggingface.co)