tensorslab-video
npx skills add https://github.com/bob5-tensorslab/skills --skill tensorslab-video
Agent 安装分布
Skill 文档
TensorsLab Video Generation
Overview
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.
Authentication Check
Before any video generation, verify the API key is configured:
# Check if API key is set
echo $TENSORSLAB_API_KEY
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"
Models
| 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
Workflow
1. Text-to-Video Generation
User request: “å䏿®µ 10 ç§é横å±çå®å®é£è¹ç©¿æ¢æé çè§é¢”
Agent processing:
- Extract parameters:
duration=10,ratio="16:9" - Enhance prompt with cinematic details, camera movements, scene descriptions
- Call API with enriched prompt
- Monitor progress with heartbeat updates (every 60 seconds)
- Download to
./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
2. Image-to-Video Generation
User request: “让è¿å¼ 人ç©åå½± family.jpg å¨èµ·æ¥” or “è®©é£æ¯ç §å¨èµ·æ¥”
Agent processing:
- Extract image file paths (1-2 images supported)
- Enhance prompt with motion instructions
- Monitor progress with heartbeat updates
- Download results
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/animation
3. Resolution and Aspect Ratio
Aspect ratios:
9:16– Vertical (TikTok, Reels, Shorts) – default16:9– Horizontal (YouTube, standard video)- Other ratios available depending on model
Resolutions:
480p– SD quality, faster generation720p– HD quality – default1080p– Full HD1440p– 2K quality (seedancev2 only)
4. Duration Options
- seedancev2: 5-15 seconds
- Other models: 5-10 seconds
Longer videos take proportionally more time to generate.
5. Special Features (seedancev2 only)
| Feature | Parameter | Description |
|---|---|---|
| Audio Generation | generate_audio=1 |
Generate soundtrack with video |
| Last Frame | return_last_frame=1 |
Also return final frame as image |
Progress Tracking
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.
Using the Script
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
Task Status Flow
| 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 |
Error Handling
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 |
Output
All videos are saved to ./tensorslab_output/ with naming pattern:
{task_id}_{index}.mp4– e.g.,abcd_1234567890_0.mp4
After completion, inform user:
ð æ¨çè§é¢å¤ç宿¯ï¼å·²åæ¾äº ./tensorslab_output/{filename}
Tips for Better Results
Text-to-Video
- Include cinematic terms: “wide shot”, “close-up”, “pan”, “dolly”
- Describe motion: “flying rapidly”, “slowly drifting”, “zooming in”
- Specify style: “cinematic”, “documentary style”, “dreamy”
Image-to-Video
- Describe the desired motion: “gentle sway”, “subtle movement”
- For landscapes: “clouds moving”, “water flowing”, “leaves rustling”
Resources
- scripts/tensorslab_video.py: Main API client with full CLI support
- references/api_reference.md: Detailed API documentation