tuzi-video-gen
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseVideo Generation (AI SDK)
视频生成(AI SDK)
Tuzi API video generation backend. Default model: veo3.1.
Tuzi API 视频生成后端,默认模型:veo3.1。
Script Directory
脚本目录
Agent Execution:
- = this SKILL.md file's directory
SKILL_DIR - Script path =
${SKILL_DIR}/scripts/main.ts
Agent 执行:
- = 本 SKILL.md 文件所在目录
SKILL_DIR - 脚本路径 =
${SKILL_DIR}/scripts/main.ts
Step 0: Load Preferences ⛔ BLOCKING
第0步:加载偏好设置 ⛔ 阻塞步骤
CRITICAL: This step MUST complete BEFORE any video generation. Do NOT skip or defer.
重要提示:本步骤必须在所有视频生成操作前完成,请勿跳过或延后执行。
0.1 Check API Key
0.1 检查API密钥
bash
echo "${TUZI_API_KEY:-not_set}"
grep -s TUZI_API_KEY .tuzi-skills/.env "$HOME/.tuzi-skills/.env"| Result | Action |
|---|---|
| Key found | Continue to Step 0.2 |
| Key NOT found | ⛔ Run API key setup (see references/config/first-time-setup.md) → Store key → Then continue |
bash
echo "${TUZI_API_KEY:-not_set}"
grep -s TUZI_API_KEY .tuzi-skills/.env "$HOME/.tuzi-skills/.env"| 结果 | 操作 |
|---|---|
| 找到密钥 | 继续执行第0.2步 |
| 未找到密钥 | ⛔ 运行API密钥设置(参考 references/config/first-time-setup.md)→ 存储密钥 → 继续后续操作 |
0.2 Check EXTEND.md
0.2 检查 EXTEND.md 文件
bash
test -f .tuzi-skills/tuzi-video-gen/EXTEND.md && echo "project"
test -f "$HOME/.tuzi-skills/tuzi-video-gen/EXTEND.md" && echo "user"| Result | Action |
|---|---|
| Found | Load, parse, apply settings |
| Not found | ⛔ Run first-time setup (references/config/first-time-setup.md) → Save EXTEND.md → Then continue |
| Path | Location |
|---|---|
| Project directory |
| User home |
EXTEND.md Supports: Default model | Default seconds | Default size
Schema:
references/config/preferences-schema.mdbash
test -f .tuzi-skills/tuzi-video-gen/EXTEND.md && echo "project"
test -f "$HOME/.tuzi-skills/tuzi-video-gen/EXTEND.md" && echo "user"| 结果 | 操作 |
|---|---|
| 找到文件 | 加载、解析并应用配置 |
| 未找到文件 | ⛔ 运行首次设置(参考 references/config/first-time-setup.md)→ 保存 EXTEND.md → 继续后续操作 |
| 路径 | 位置 |
|---|---|
| 项目目录 |
| 用户根目录 |
EXTEND.md 支持配置项:默认模型 | 默认时长(秒)| 默认尺寸
配置规则:
references/config/preferences-schema.mdUsage
使用方法
bash
undefinedbash
undefinedSingle video
生成单个视频
npx -y bun ${SKILL_DIR}/scripts/main.ts --prompt "A cat walking in a garden" --video cat.mp4
npx -y bun ${SKILL_DIR}/scripts/main.ts --prompt "A cat walking in a garden" --video cat.mp4
With model and duration
指定模型和时长
npx -y bun ${SKILL_DIR}/scripts/main.ts --prompt "城市夜景延时" --video city.mp4 --model veo3 --seconds 8
npx -y bun ${SKILL_DIR}/scripts/main.ts --prompt "城市夜景延时" --video city.mp4 --model veo3 --seconds 8
With reference image
带参考图生成
npx -y bun ${SKILL_DIR}/scripts/main.ts --prompt "Animate this scene" --video out.mp4 --ref source.png
npx -y bun ${SKILL_DIR}/scripts/main.ts --prompt "Animate this scene" --video out.mp4 --ref source.png
From prompt file
从提示词文件读取
npx -y bun ${SKILL_DIR}/scripts/main.ts --promptfiles prompt.md --video out.mp4
npx -y bun ${SKILL_DIR}/scripts/main.ts --promptfiles prompt.md --video out.mp4
Long video (multi-segment with ffmpeg concat)
生成长视频(通过 ffmpeg 拼接多段视频)
npx -y bun ${SKILL_DIR}/scripts/main.ts --prompt "A journey through seasons" --video long.mp4 --segments 3
npx -y bun ${SKILL_DIR}/scripts/main.ts --prompt "A journey through seasons" --video long.mp4 --segments 3
Long video with per-segment prompts
按分段提示词生成长视频
npx -y bun ${SKILL_DIR}/scripts/main.ts --video long.mp4 --segments 3 --segment-prompts seg1.md seg2.md seg3.md
undefinednpx -y bun ${SKILL_DIR}/scripts/main.ts --video long.mp4 --segments 3 --segment-prompts seg1.md seg2.md seg3.md
undefinedOptions
参数说明
| Option | Description |
|---|---|
| Prompt text |
| Read prompt from files (concatenated) |
| Output video path (required) |
| Model ID (default: veo3.1) |
| Duration in seconds |
| Video size (e.g., |
| Reference images |
| Reference image mode |
| Long video segment count (min 2) |
| Per-segment prompt files |
| JSON output |
| 参数 | 描述 |
|---|---|
| 提示词文本 |
| 从文件读取提示词(自动拼接内容) |
| 输出视频路径(必填) |
| 模型ID(默认:veo3.1) |
| 视频时长(单位:秒) |
| 视频尺寸(例如 |
| 参考图片 |
| 参考图片使用模式 |
| 长视频分段数量(最小值为2) |
| 各分段对应的提示词文件 |
| 以JSON格式输出结果 |
Models
支持的模型
| Model | Provider | Duration | Sizes | Image Mode |
|---|---|---|---|---|
| Veo | 8s | 16:9, 9:16 | reference |
| Veo | 8s | 16:9, 9:16 | frames |
| Veo | 8s | 4K | frames |
| Sora | 10/15s | 16:9, 9:16 | reference |
| Sora | 10/15/25s | 16:9, 9:16, HD | reference |
| Kling | 5/10s | 16:9, 9:16, 1:1 | reference |
| Seedance | 5/10s | 1080p, 720p | frames |
| 模型ID | 提供方 | 支持时长 | 支持尺寸 | 参考图模式 |
|---|---|---|---|---|
| Veo | 8s | 16:9, 9:16 | reference |
| Veo | 8s | 16:9, 9:16 | frames |
| Veo | 8s | 4K | frames |
| Sora | 10/15s | 16:9, 9:16 | reference |
| Sora | 10/15/25s | 16:9, 9:16, HD | reference |
| Kling | 5/10s | 16:9, 9:16, 1:1 | reference |
| Seedance | 5/10s | 1080p, 720p | frames |
Long Video Mode
长视频模式
When is specified (N >= 2):
--segments N- Generates N video segments sequentially
- After each segment, extracts last frame via ffmpeg
- Last frame becomes next segment's reference image (continuity)
- All segments concatenated via
ffmpeg -f concat - Temporary files cleaned up
Requirements: ffmpeg must be installed.
Per-segment prompts: Use to provide individual prompt files for each segment. If fewer files than segments, remaining segments use the main .
--segment-prompts--prompt当指定 参数(N >= 2)时:
--segments N- 按顺序生成N段视频
- 每段生成完成后,通过 ffmpeg 提取最后一帧
- 上一段的最后一帧作为下一段的参考图(保证内容连贯性)
- 所有分段通过 拼接为完整视频
ffmpeg -f concat - 清理临时文件
依赖要求:必须安装 ffmpeg。
分段提示词说明:使用 可以为每个分段指定单独的提示词文件,如果提供的文件数量少于分段数,剩余分段将使用主 参数的提示词。
--segment-prompts--promptEnvironment Variables
环境变量
| Variable | Description |
|---|---|
| Tuzi API key (https://api.tu-zi.com) |
| Default video model (default: veo3.1) |
| Custom Tuzi endpoint (default: https://api.tu-zi.com) |
Load Priority: CLI args > EXTEND.md > env vars > >
<cwd>/.tuzi-skills/.env~/.tuzi-skills/.env| 变量名 | 描述 |
|---|---|
| Tuzi API 密钥(获取地址:https://api.tu-zi.com) |
| 默认视频生成模型(默认值:veo3.1) |
| 自定义 Tuzi 接口地址(默认:https://api.tu-zi.com) |
加载优先级:命令行参数 > EXTEND.md配置 > 环境变量 > >
<cwd>/.tuzi-skills/.env~/.tuzi-skills/.envModel Resolution
模型选择优先级
Priority (highest → lowest):
- CLI:
--model <id> - EXTEND.md:
default_model - Env var:
TUZI_VIDEO_MODEL - Built-in default:
veo3.1
Agent MUST display model info before each generation:
- Show:
Using [model] - Show switch hint:
Switch model: --model <id> | EXTEND.md default_model | env TUZI_VIDEO_MODEL
优先级(从高到低):
- 命令行参数:
--model <id> - EXTEND.md 配置:
default_model - 环境变量:
TUZI_VIDEO_MODEL - 内置默认值:
veo3.1
Agent 必须在每次生成前展示模型信息:
- 展示内容:
Using [model] - 展示切换提示:
Switch model: --model <id> | EXTEND.md default_model | env TUZI_VIDEO_MODEL
Error Handling
错误处理
- Missing API key → ⛔ MUST run API key setup from Step 0.1
- Generation failure → auto-retry once
- Business failure (content rejected) → no retry, report error
- Network error → exponential backoff (1.5x, max 60s)
- Timeout → error after 90 minutes
- Missing ffmpeg (long video mode) → clear error with install instructions
- 缺少API密钥 → ⛔ 必须执行第0.1步的API密钥设置流程
- 生成失败 → 自动重试1次
- 业务错误(内容被拒绝)→ 不重试,直接上报错误
- 网络错误 → 指数退避重试(每次间隔乘以1.5,最大间隔60秒)
- 超时 → 90分钟后返回超时错误
- 长视频模式下缺少 ffmpeg → 返回清晰的错误信息并附带安装指引
Extension Support
扩展支持
Custom configurations via EXTEND.md. See Step 0 for paths and supported options.
可通过 EXTEND.md 进行自定义配置,路径和支持的配置项参考第0步。