Auto Video Creator - XLXAI Video Generation Skill
Generate professional videos from text prompts or images using the XLXAI Sora2 API.
Scope
This skill focuses exclusively on video generation:
- - ✅ Calls XLXAI Sora2 API to generate videos
- ✅ Returns task/result JSON with video URL upon completion
- ✅ Supports text-to-video and image-to-video generation
- ❌ Does NOT upload, post, or proxy videos to TikTok or other platforms
- ❌ Does NOT handle social media publishing
For upload/post functionality, use a separate skill (e.g., post-to-tiktok-getlate) or downstream workflow.
Quick Start
1. Setup Environment
CODEBLOCK0
2. Generate Video
CODEBLOCK1
The script loads the API key from the XLXAIAPIKEY environment variable, handles task creation and polling, and returns JSON with the video URL when complete.
API Response Examples
Task Creation Response (no-wait)
CODEBLOCK2
Completed Task Response
CODEBLOCK3
Notes:
- - Field names depend on XLXAI API version; inspect raw JSON for actual fields
- video_url may point to third-party CDN; download and self-host if needed
Video Models
Choose based on your needs:
Portrait Models (Vertical Videos)
- -
sora2-portrait-4s — 4-second vertical video (default) - INLINECODE1 — 8-second vertical video
- INLINECODE2 — 12-second vertical video
Landscape Models (Horizontal Videos)
- -
sora2-landscape-4s — 4-second horizontal video - INLINECODE4 — 8-second horizontal video
- INLINECODE5 — 12-second horizontal video
Default: INLINECODE6
Usage Patterns
Text-to-Video Generation
Generate videos from text descriptions:
CODEBLOCK4
Image-to-Video Generation
Create videos from images with motion (local images auto-converted to data URI):
CODEBLOCK5
Or use image URLs directly:
CODEBLOCK6
Non-blocking Task Creation
Get task ID immediately without waiting for completion:
CODEBLOCK7
Check status later:
CODEBLOCK8
Script Options
| Option | Description | Default |
|---|
| INLINECODE7 | Video model (portrait/landscape, 4s/8s/12s) | sora2-portrait-4s |
| INLINECODE8 |
Image URL or local file path | — |
|
--no-wait | Return task ID immediately | false |
|
--poll-interval | Seconds between status checks | 10 |
|
--timeout | Max seconds to wait for completion | 600 |
|
--check-status | Check status of existing task | — |
Output Format
On success, the script returns JSON with:
- -
status: "completed" - INLINECODE14 : Download link for the generated video
- INLINECODE15 : 100
- INLINECODE16 : Generation time in seconds
- INLINECODE17 : Unique task identifier
- INLINECODE18 : Task creation timestamp
- INLINECODE19 : Task completion timestamp
Error Handling
The script handles:
- - ✅ API request failures with retry logic
- ✅ Timeout after 600 seconds (configurable)
- ✅ Progress reporting during generation
- ✅ Clear error messages for failed tasks
- ✅ HTTP status code validation
Important Notes
- - Copyright & Rights: Verify copyright and portrait rights before publishing generated content
- API Key Security: Keep your API key secret; use environment variables in production
- Video URL: May point to third-party CDN; download and self-host if needed
- Rate Limits: Check XLXAI API documentation for rate limiting
日本語ガイド
セットアップ
CODEBLOCK9
ビデオ生成
CODEBLOCK10
画像からビデオを生成
CODEBLOCK11
한국어 가이드
설정
CODEBLOCK12
비디오 생성
CODEBLOCK13
이미지에서 비디오 생성
CODEBLOCK14
Contact / 連絡先 / 연락처
Auto Video Creator - XLXAI 视频生成技能
使用 XLXAI Sora2 API 从文本提示或图像生成专业视频。
适用范围
本技能专注于视频生成:
- - ✅ 调用 XLXAI Sora2 API 生成视频
- ✅ 完成后返回包含视频 URL 的任务/结果 JSON
- ✅ 支持文本转视频和图像转视频生成
- ❌ 不上传、发布或代理视频到 TikTok 或其他平台
- ❌ 不处理社交媒体发布
如需上传/发布功能,请使用其他技能(例如 post-to-tiktok-getlate)或下游工作流。
快速开始
1. 环境设置
bash
cp skills/xlxai-video/.env.example skills/xlxai-video/.env
编辑 skills/xlxai-video/.env 并设置 XLXAIAPIKEY
export XLXAI
APIKEY=$YOUR_KEY
2. 生成视频
bash
python3 skills/xlxai-video/scripts/generate_video.py 您的视频提示 --model sora2-portrait-4s
该脚本从 XLXAIAPIKEY 环境变量加载 API 密钥,处理任务创建和轮询,并在完成后返回包含视频 URL 的 JSON。
API 响应示例
任务创建响应(不等待)
json
{
taskid: taskUe8FsGswnj3fCaY91yAj84m8AA8lLVpm,
status: pending,
model: sora2-portrait-4s,
created_at: 2026-03-03T18:19:30Z
}
任务完成响应
json
{
taskid: taskUe8FsGswnj3fCaY91yAj84m8AA8lLVpm,
status: completed,
video_url: https://api.xlxai.store/video2-proxy/base/video/79193b56b4792daec07c5564bff412f193a6c20e5ee7ca0a323ab753da2420a9.mp4,
progress: 100,
duration: 38,
message: Generation complete,
created_at: 2026-03-03T18:19:30Z,
completed_at: 2026-03-03T18:20:08Z
}
注意:
- - 字段名称取决于 XLXAI API 版本;请检查原始 JSON 以获取实际字段
- video_url 可能指向第三方 CDN;如有需要请下载并自行托管
视频模型
根据需求选择:
竖屏模型(垂直视频)
- - sora2-portrait-4s — 4 秒竖屏视频(默认)
- sora2-portrait-8s — 8 秒竖屏视频
- sora2-portrait-12s — 12 秒竖屏视频
横屏模型(水平视频)
- - sora2-landscape-4s — 4 秒横屏视频
- sora2-landscape-8s — 8 秒横屏视频
- sora2-landscape-12s — 12 秒横屏视频
默认值: sora2-portrait-4s
使用模式
文本转视频生成
从文本描述生成视频:
bash
python3 scripts/generate_video.py 一位 30 岁的美国男子穿着西装对着镜头展示 \
--model sora2-landscape-8s
图像转视频生成
从图像创建带有动态效果的视频(本地图像自动转换为数据 URI):
bash
python3 scripts/generate_video.py 男子展示西装,说它做工精良且价格实惠 \
--model sora2-portrait-4s \
--image /path/to/local/image.jpg
或直接使用图像 URL:
bash
python3 scripts/generate_video.py 男子展示西装,说它做工精良且价格实惠 \
--model sora2-portrait-4s \
--image http://example.com/image.jpg
非阻塞任务创建
立即获取任务 ID,无需等待完成:
bash
python3 scripts/generate_video.py 您的提示 --no-wait
稍后检查状态:
bash
python3 scripts/generatevideo.py --check-status taskabc123
脚本选项
| 选项 | 描述 | 默认值 |
|---|
| --model | 视频模型(竖屏/横屏,4s/8s/12s) | sora2-portrait-4s |
| --image |
图像 URL 或本地文件路径 | — |
| --no-wait | 立即返回任务 ID | false |
| --poll-interval | 状态检查间隔秒数 | 10 |
| --timeout | 等待完成的最大秒数 | 600 |
| --check-status | 检查现有任务的状态 | — |
输出格式
成功时,脚本返回包含以下内容的 JSON:
- - status:completed
- videourl:生成视频的下载链接
- progress:100
- duration:生成时间(秒)
- taskid:唯一任务标识符
- createdat:任务创建时间戳
- completedat:任务完成时间戳
错误处理
脚本处理:
- - ✅ API 请求失败并带有重试逻辑
- ✅ 600 秒后超时(可配置)
- ✅ 生成过程中的进度报告
- ✅ 失败任务的清晰错误消息
- ✅ HTTP 状态码验证
重要说明
- - 版权与权利:发布生成内容前请验证版权和肖像权
- API 密钥安全:保持 API 密钥机密;在生产环境中使用环境变量
- 视频 URL:可能指向第三方 CDN;如有需要请下载并自行托管
- 速率限制:查看 XLXAI API 文档了解速率限制
日本語ガイド
セットアップ
bash
cp skills/xlxai-video/.env.example skills/xlxai-video/.env
export XLXAIAPIKEY=$YOUR_KEY
ビデオ生成
bash
python3 skills/xlxai-video/scripts/generate_video.py あなたのプロンプト --model sora2-portrait-4s
画像からビデオを生成
bash
python3 skills/xlxai-video/scripts/generate_video.py シーンの説明 --image /path/to/image.jpg
한국어 가이드
설정
bash
cp skills/xlxai-video/.env.example skills/xlxai-video/.env
export XLXAIAPIKEY=$YOUR_KEY
비디오 생성
bash
python3 skills/xlxai-video/scripts/generate_video.py 당신의 프롬프트 --model sora2-portrait-4s
이미지에서 비디오 생성
bash
python3 skills/xlxai-video/scripts/generate_video.py 장면 설명 --image /path/to/image.jpg
联系方式 / 連絡先 / 연락처