Install
openclaw skills install tensorslab-videoGenerate videos using TensorsLab's AI video generation models. Supports text-to-video and image-to-video generation with automatic prompt enhancement, progre...
openclaw skills install tensorslab-videoThis skill enables AI-powered video generation through TensorsLab's API, supporting both text-to-video and image-to-video workflows. Video generation is a time-intensive process - tasks typically take several minutes to complete.
Before any video generation, verify the API key is configured:
# 仅检查变量是否存在,不输出完整值
[ -n "$TENSORSLAB_API_KEY" ] && echo "✅ API key is set" || echo "❌ TENSORSLAB_API_KEY is not set"
If not set, display this friendly message:
您好!要生成高质量的内容,您需要先进行简单的配置:
1. 访问 https://tensorslab.tensorslab.com/ 登录并订阅。
2. 在控制台中获取您的专属 API Key。
3. 将其保存为环境变量:
- Windows (PowerShell): $env:TENSORSLAB_API_KEY="您的Key"
- Mac/Linux: export TENSORSLAB_API_KEY="您的Key"
| Model | Description | Best For | Max Duration |
|---|---|---|---|
| seedancev2 | Latest, highest quality | General purpose, cinematic content | 15s |
| seedancev15pro | Pro quality | High-end productions | 10s |
| seedancev1profast | Fast generation | Quick previews | 10s |
| seedancev1 | Standard lite | Basic videos | 10s |
Default: seedancev1profast
User request: "做一段 10 秒钟横屏的宇宙飞船穿梭星际的视频"
Agent processing:
duration=10, ratio="16:9"./tensorslab_output/Example enhanced prompt:
Cinematic wide shot of a spaceship rapidly flying through space, passing glowing
nebulae and distant stars, lens flares, dramatic camera movement, epic scale,
movie-quality visual effects, smooth 24fps motion
User request: "让这张人物合影 family.jpg 动起来" or "让风景照动起来"
Agent processing:
Parameters for image-to-video:
sourceImage: Array of image files (1-2 images max)imageUrl: Comma-separated URLs of source imagesprompt: Description of desired motion/animationAspect ratios:
9:16 - Vertical (TikTok, Reels, Shorts) - default16:9 - Horizontal (YouTube, standard video)Resolutions:
480p - SD quality, faster generation720p - HD quality - default1080p - Full HD1440p - 2K quality (seedancev2 only)Longer videos take proportionally more time to generate.
| Feature | Parameter | Description |
|---|---|---|
| Audio Generation | generate_audio=1 | Generate soundtrack with video |
| Last Frame | return_last_frame=1 | Also return final frame as image |
Video generation takes several minutes. Keep users informed:
⏳ Waiting for video generation to complete...
(This may take several minutes - please be patient)
🔄 Status: Processing (elapsed: 45s)
🚀 正在渲染电影级大片,已耗时 60 秒,请稍安勿躁...
🚀 正在渲染电影级大片,已耗时 120 秒,请稍安勿躁...
✅ Task completed!
Heartbeat interval: Print encouraging message every 60 seconds.
依赖:脚本需要
requests库,首次使用前执行:pip install requests
Execute the Python script directly:
# Text-to-video (default 5s, vertical 9:16)
python scripts/tensorslab_video.py "a spaceship flying through space"
# 10 second horizontal video
python scripts/tensorslab_video.py "sunset over ocean waves" --duration 10 --ratio 16:9
# Image-to-video
python scripts/tensorslab_video.py "make this photo come alive" --source portrait.jpg
# Fast preview
python scripts/tensorslab_video.py "abstract flowing colors" --model seedancev1profast
# High quality with audio
python scripts/tensorslab_video.py "epic mountain timelapse" --resolution 1440p --duration 10 --audio
# Custom output directory
python scripts/tensorslab_video.py "a sunset timelapse" --output-dir ./my_videos
| Status | Code | Meaning |
|---|---|---|
| Pending | 1 | Task waiting in queue |
| Processing | 2 | Currently generating |
| Completed | 3 | Done, video ready |
| Failed | 4 | Error occurred |
| Uploading | 5 | Uploading generated video |
Translate API errors to user-friendly messages:
| Error Code | Meaning | User Message |
|---|---|---|
| 9000 | Insufficient credits | "亲,积分用完啦,请前往 https://tensorslab.tensorslab.com/ 充值" |
| 9999 | General error | Show the specific error message |
All videos are saved to output directory with naming pattern:
./tensorslab_output/ (current working directory)--output-dir or -o to specify a different path{task_id}_{index}.mp4 - e.g., abcd_1234567890_0.mp4After completion, inform user:
🎉 您的视频处理完毕!已存放于 ./tensorslab_output/{filename}