Spaces:
Running
Running
lerp666
tricket: AI product-ad video studio (GLM script + FLUX scenes + Kokoro TTS + ffmpeg)
e1d94af | 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) | |