Tarek Video Generator
⚠️ STRICT PROTOCOL — READ BEFORE ANY TOOL CALL
When the user asks for a video, a reel, an animation, a drift clip, a motion shot, a product demo video, or ANY AI-generated moving image:
- ONLY call one of the two shell commands below (text-to-video OR from-image). Do not invent your own.
- NEVER
curl a task_server endpoint yourself. The script already does that correctly.
- NEVER call
delegate_task for video generation. There is NO other working video backend on this machine. Delegation will hallucinate success and no file will exist.
- NEVER use fal_client directly in Python. Use this skill. It handles auth, caching, spend caps, DB logging.
- NEVER claim a video was generated unless
video_tool.py printed a JSON line containing "render_state": "completed" AND "file_path": "/Users/majana-agent/..." — then verify with ls -la <file_path> before telling the user it exists.
- If the command fails (non-zero exit, timeout, error JSON), tell the user the real error. Do not fall back to another tool. Do not fabricate.
When to use this skill
- "Make me a reel about X"
- "Turn this image into a video"
- "Generate a 5-second clip of Y"
- "Animate the car drifting"
- Anything involving motion, drift, camera movement, animation, reels, stories
Backend
- Server:
$TASK_SERVER_URL (set in pmax-tarek .env, points to Studio localhost task_server at http://127.0.0.1:7439)
- Auth: Bearer token from
$TASK_TOKEN_FILE (set in .env)
- Worker:
~/mem0-server/image_worker.py — same worker dispatches image + video based on model name
- Output dir:
/Users/majana-agent/mem0-server/assets/videos/YYYY-MM/task_N_<hash>.mp4
How to invoke
1) Text-to-video — generate from a prompt
python3 ~/Projects/performancemax/hermes-skills/pmax-video/scripts/video_tool.py text-to-video \
--client "tint-near-me" \
--prompt "A black Porsche 911 drifting in a neon-lit garage, smoke clouds rising, cinematic slow-mo" \
--model kling-v3-pro \
--aspect 16:9 \
--duration 5s
2) Image-to-video — animate an existing image
python3 ~/Projects/performancemax/hermes-skills/pmax-video/scripts/video_tool.py from-image \
--client "tint-near-me" \
--image /Users/majana-agent/mem0-server/assets/images/2026-04/task_14_66ca091ceed789cb.jpg \
--prompt "The car drifts, making donuts, fire bursting from the tires" \
--model kling-v3-i2v \
--aspect 16:9 \
--duration 5s
Use image-to-video whenever the user references a previously generated image. Much more coherent than regenerating from scratch.
Output shape
On success:
{"task_id": 15, "render_state": "completed",
"render_asset_url": "file:///Users/majana-agent/mem0-server/assets/videos/2026-04/task_15_<hash>.mp4",
"file_path": "/Users/majana-agent/mem0-server/assets/videos/2026-04/task_15_<hash>.mp4",
"model": "kling-v3-i2v", "kind": "video"}
The script uploads the video to the user's Telegram automatically when TELEGRAM_BOT_TOKEN + TELEGRAM_HOME_CHANNEL are set (they are). You do NOT add MEDIA: tags. You do NOT curl sendVideo. Check telegram_delivery.ok in the JSON — if true, just confirm briefly to the user ("Done — video sent"). If false, relay the real error.
Models — when to pick which
Text-to-video
| Model |
Strength |
Duration |
Notes |
kling-v3-pro (default) |
Strong motion, reliable quality |
5s / 10s |
Best all-rounder |
seedance-1-pro |
Cinematic camera moves |
5s / 10s |
ByteDance, smooth |
veo-3 |
Highest fidelity + native audio |
5s |
Google DeepMind, premium |
Image-to-video
| Model |
Strength |
Notes |
kling-v3-i2v (default) |
Faithful to source image, strong motion |
Best default for animating renders |
luma-ray2-i2v |
Strong camera motion / parallax |
Good for cinematic scene setting |
minimax-i2v |
Fast iteration |
Cheaper, lower fidelity |
Aspect ratios
| Ratio |
Use |
16:9 (default) |
YouTube, landscape, web ads |
9:16 |
Instagram reels, TikTok, stories |
1:1 |
Instagram feed, square ads |
Durations
5s (default, cheaper, faster) — works on all video models
10s — supported by Kling + Seedance; not supported on Veo 3
Failure modes
SPEND_CAP_EXCEEDED — Tarek hit the daily budget. Report to user.
render_error — model refused prompt (unsafe content), FAL outage, or image-to-video source unreachable. Retry with rephrased prompt or different model.
- Timeout (default 300s) — video jobs can be slow. Use
--no-wait + status <task_id> if expecting slow renders.
Related
pmax-image — sibling skill for static images (use it first to generate a base image, then animate it here)
~/mem0-server/image_worker.py — the shared render worker on Studio
~/mem0-server/task_server.py — HTTP API, Studio port 7439
1---2name: pmax-video3description: Generate short videos (ads, reels, product motion) via FAL.ai — routed through the shared task_server + image_worker pipeline. Handles text-to-video AND image-to-video (animate an existing image).4license: MIT5---67# Tarek Video Generator89**⚠️ STRICT PROTOCOL — READ BEFORE ANY TOOL CALL**1011When the user asks for a video, a reel, an animation, a drift clip, a motion shot, a product demo video, or ANY AI-generated moving image:12131. **ONLY call one of the two shell commands below** (text-to-video OR from-image). Do not invent your own.142. **NEVER `curl` a task_server endpoint yourself.** The script already does that correctly.153. **NEVER call `delegate_task` for video generation.** There is NO other working video backend on this machine. Delegation will hallucinate success and no file will exist.164. **NEVER use fal_client directly in Python.** Use this skill. It handles auth, caching, spend caps, DB logging.175. **NEVER claim a video was generated** unless `video_tool.py` printed a JSON line containing `"render_state": "completed"` AND `"file_path": "/Users/majana-agent/..."` — then verify with `ls -la <file_path>` before telling the user it exists.186. If the command fails (non-zero exit, timeout, error JSON), **tell the user the real error**. Do not fall back to another tool. Do not fabricate.1920## When to use this skill2122- "Make me a reel about X"23- "Turn this image into a video"24- "Generate a 5-second clip of Y"25- "Animate the car drifting"26- Anything involving motion, drift, camera movement, animation, reels, stories2728## Backend2930- **Server**: `$TASK_SERVER_URL` (set in pmax-tarek `.env`, points to Studio localhost task_server at `http://127.0.0.1:7439`)31- **Auth**: Bearer token from `$TASK_TOKEN_FILE` (set in `.env`)32- **Worker**: `~/mem0-server/image_worker.py` — same worker dispatches image + video based on model name33- **Output dir**: `/Users/majana-agent/mem0-server/assets/videos/YYYY-MM/task_N_<hash>.mp4`3435## How to invoke3637### 1) Text-to-video — generate from a prompt3839```bash40python3 ~/Projects/performancemax/hermes-skills/pmax-video/scripts/video_tool.py text-to-video \41 --client "tint-near-me" \42 --prompt "A black Porsche 911 drifting in a neon-lit garage, smoke clouds rising, cinematic slow-mo" \43 --model kling-v3-pro \44 --aspect 16:9 \45 --duration 5s46```4748### 2) Image-to-video — animate an existing image4950```bash51python3 ~/Projects/performancemax/hermes-skills/pmax-video/scripts/video_tool.py from-image \52 --client "tint-near-me" \53 --image /Users/majana-agent/mem0-server/assets/images/2026-04/task_14_66ca091ceed789cb.jpg \54 --prompt "The car drifts, making donuts, fire bursting from the tires" \55 --model kling-v3-i2v \56 --aspect 16:9 \57 --duration 5s58```5960**Use image-to-video whenever the user references a previously generated image.** Much more coherent than regenerating from scratch.6162## Output shape6364On success:65```json66{"task_id": 15, "render_state": "completed",67 "render_asset_url": "file:///Users/majana-agent/mem0-server/assets/videos/2026-04/task_15_<hash>.mp4",68 "file_path": "/Users/majana-agent/mem0-server/assets/videos/2026-04/task_15_<hash>.mp4",69 "model": "kling-v3-i2v", "kind": "video"}70```7172**The script uploads the video to the user's Telegram automatically** when `TELEGRAM_BOT_TOKEN` + `TELEGRAM_HOME_CHANNEL` are set (they are). You do NOT add `MEDIA:` tags. You do NOT curl sendVideo. Check `telegram_delivery.ok` in the JSON — if `true`, just confirm briefly to the user ("Done — video sent"). If `false`, relay the real error.7374## Models — when to pick which7576### Text-to-video77| Model | Strength | Duration | Notes |78|---|---|---|---|79| `kling-v3-pro` (default) | Strong motion, reliable quality | 5s / 10s | Best all-rounder |80| `seedance-1-pro` | Cinematic camera moves | 5s / 10s | ByteDance, smooth |81| `veo-3` | Highest fidelity + native audio | 5s | Google DeepMind, premium |8283### Image-to-video84| Model | Strength | Notes |85|---|---|---|86| `kling-v3-i2v` (default) | Faithful to source image, strong motion | Best default for animating renders |87| `luma-ray2-i2v` | Strong camera motion / parallax | Good for cinematic scene setting |88| `minimax-i2v` | Fast iteration | Cheaper, lower fidelity |8990## Aspect ratios9192| Ratio | Use |93|---|---|94| `16:9` (default) | YouTube, landscape, web ads |95| `9:16` | Instagram reels, TikTok, stories |96| `1:1` | Instagram feed, square ads |9798## Durations99100- `5s` (default, cheaper, faster) — works on all video models101- `10s` — supported by Kling + Seedance; **not supported** on Veo 3102103## Failure modes104105- **`SPEND_CAP_EXCEEDED`** — Tarek hit the daily budget. Report to user.106- **`render_error`** — model refused prompt (unsafe content), FAL outage, or image-to-video source unreachable. Retry with rephrased prompt or different model.107- **Timeout** (default 300s) — video jobs can be slow. Use `--no-wait` + `status <task_id>` if expecting slow renders.108109## Related110111- `pmax-image` — sibling skill for static images (use it first to generate a base image, then animate it here)112- `~/mem0-server/image_worker.py` — the shared render worker on Studio113- `~/mem0-server/task_server.py` — HTTP API, Studio port 7439