From tensorslab-skills
Generates videos from text or images using TensorsLab's AI models (seedancev2, seedancev15pro, seedancev1profast). Handles prompt enhancement, progress tracking, local file saving, and browser-based authorization.
How this skill is triggered — by the user, by Claude, or both
Slash command
/tensorslab-skills:tl-videoThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
This 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.
This 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.
The Python scripts for this skill are located in the scripts/ subdirectory relative to this SKILL.md file. Always use the absolute path when executing scripts. Determine the absolute path based on where this skill is installed.
For example, if this SKILL.md is at /path/to/skills/tl-video/SKILL.md, then:
python "/path/to/skills/tl-video/scripts/tensorslab_auth.py"python "/path/to/skills/tl-video/scripts/tensorslab_video.py"When executing, construct the command using the resolved absolute path:
python "<absolute_path_to_skill_dir>/scripts/tensorslab_video.py" <args>
BEFORE any video generation, you must ensure you are authorized with TensorsLab.
The authorization script will automatically check if an API key already exists in the TENSORSLAB_API_KEY environment variable or in ~/.tensorslab/.env before proceeding.
(Note: When you need to verify the environment variable, ONLY check if it exists. NEVER display or print the actual API key value.)
Run:
python "<absolute_path_to_skill_dir>/scripts/tensorslab_auth.py"
On Windows/macOS: This will open a browser for authorization. Wait for "Authorization Successful!" before proceeding.
On Linux: Browser auth is automatically skipped. The script will print instructions to get your API key manually from TensorsLab Console. Set it via:
export TENSORSLAB_API_KEY=your_api_key_here
After authorization, the API key is stored in ~/.tensorslab/.env and you don't need to re-authorize unless the key expires.
When the API key is provided via export TENSORSLAB_API_KEY=xxx or --api-key argument and a generation task succeeds, the key is automatically saved to ~/.tensorslab/.env. Future sessions will pick it up without needing to export again.
| Model | Description | Best For | Max Duration |
|---|---|---|---|
| seedancev2 | Highest quality, much slower generation | Cinematic content where quality is priority | 15s |
| seedancev15pro | Pro quality | High-end productions | 10s |
| seedancev1profast | Fast generation with solid quality | Default model, quick previews | 10s |
Default model: seedancev1profast (recommended for most requests)
Notes:
seedancev2 has the best visual quality but is significantly slower than 1.x models.User request: "做一段 10 秒钟横屏的宇宙飞船穿梭星际的视频"
Constraints:
sourceImage or imageUrl for text-to-video generation.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 images (Must be standard HTTP/HTTPS URLs. Do NOT use local paths like /tmp/xxx.png here)prompt: Description of desired motion/animationModel limitation:
seedancev2 does not support human-face source images for image-to-video.seedancev1profast (default) or seedancev15pro instead.Aspect 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. seedancev2 is notably slower even at the same duration/resolution.
| 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和pyyaml库,首次使用前执行:pip install requests pyyaml
重要:提示词必须用引号包裹。 传给脚本的 prompt 参数必须用双引号 " 包裹,避免 shell 解析问题:
# 正确
python "scripts/tensorslab_video.py" "a spaceship flying through space"
python "scripts/tensorslab_video.py" "让照片中的人物动起来" --source portrait.jpg
# 错误 - 提示词没有引号
python "scripts/tensorslab_video.py" a spaceship flying through space
Execute the Python script directly:
# Text-to-video (default 5s, vertical 9:16)
python "<absolute_path_to_skill_dir>/scripts/tensorslab_video.py" "a spaceship flying through space"
# 10 second horizontal video
python "<absolute_path_to_skill_dir>/scripts/tensorslab_video.py" "sunset over ocean waves" --duration 10 --ratio 16:9
# Image-to-video with local file
python "<absolute_path_to_skill_dir>/scripts/tensorslab_video.py" "make this photo come alive" --source portrait.jpg
# Image-to-video with URL
python "<absolute_path_to_skill_dir>/scripts/tensorslab_video.py" "make this photo come alive" --image-url https://example.com/portrait.jpg
# Fast preview
python "<absolute_path_to_skill_dir>/scripts/tensorslab_video.py" "abstract flowing colors" --model seedancev1profast
# High quality with audio
python "<absolute_path_to_skill_dir>/scripts/tensorslab_video.py" "epic mountain timelapse" --resolution 1440p --duration 10 --audio
# Custom output directory
python "<absolute_path_to_skill_dir>/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://tensorai.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.mp4URL mapping: The script also saves file-to-URL mappings in ./tensorslab_output/urls.yaml. This file tracks the original URLs for each downloaded file and accumulates entries across multiple runs. When you need the original URL of a generated video, read this file.
# Example urls.yaml content
abcd_1234567890_0.mp4: https://tensorai.tensorslab.com/videos/abcd_1234567890_0.mp4
After completion, the script outputs both the local file path and the remote URL. Inform user with both:
🎉 您的视频处理完毕!
- File: ./tensorslab_output/{filename}
- URL: {remote_url}
npx claudepluginhub tensorslab/skills --plugin ali-videoCreates, edits, and optimizes skills for Claude Code, including drafting, evaluating with test prompts, iterating on performance, and improving skill descriptions for better triggering accuracy.