Skill: lilei0311/siliconflow-video-gen (version 1.0.1)

--- name: siliconflow-video-gen description: Generate videos using SiliconFlow API with Wan2.2 model. Supports both Text-to-Video and Image-to-Video. env: - SILICONFLOW_API_KEY files: config: - ~/.openclaw/openclaw.json --- # SiliconFlow Video Generation Skill Generate videos using SiliconFlow API with Wan2.2 model. Supports both Text-to-Video and Image-to-Video. ## Features - 🎬 **Text-to-Video**: Generate videos from text descriptions - 🖼️ **Image-to-Video**: Animate static images with motion - 🎥 **Cinematic Quality**: Powered by Wan2.2 (14B params) - 🔑 **Auto API Key Detection**: Reads from environment or OpenClaw config ## Requirements - **Environment Variable**: `SILICONFLOW_API_KEY` - **Optional Config File**: `~/.openclaw/openclaw.json` (for auto-detect) ## Installation ```bash npx clawhub install siliconflow-video-gen ``` ## Configuration Set your SiliconFlow API key: ```bash export SILICONFLOW_API_KEY="your-api-key" ``` Or configure in OpenClaw: ```json { "models": { "providers": { "siliconflow": { "apiKey": "your-api-key" } } } } ``` ## Usage ### Text-to-Video ```bash python3 scripts/generate.py "A woman walking in a blooming garden, cinematic shot" ``` ### Image-to-Video ```bash python3 scripts/generate.py "Camera slowly zooming in" --image-url https://example.com/image.jpg ``` ## Models | Model | Type | Cost | |-------|------|------| | `Wan-AI/Wan2.2-T2V-A14B` | Text-to-Video | ¥2/video | | `Wan-AI/Wan2.2-T2V-A14B` | Image-to-Video | ¥2/video | ## Security Notes - This skill requires an API key to call SiliconFlow services - The script reads `~/.openclaw/openclaw.json` only to auto-detect API keys - No sensitive data is transmitted except to `api.siliconflow.cn` - Review the code at `scripts/generate.py` before providing credentials ## Author MaxStorm Team ## License MIT

path: README.md
content: # SiliconFlow Video Generation Skill

Generate videos using SiliconFlow API with Wan2.2 model. Supports both Text-to-Video and Image-to-Video.

## Features

- 🎬 **Text-to-Video**: Generate videos from text descriptions
- 🖼️ **Image-to-Video**: Animate static images with motion
- 🎥 **Cinematic Quality**: Powered by Wan2.2 (14B params)
- 🔑 **Auto API Key Detection**: Reads from environment or OpenClaw config
- 📱 **OpenClaw Ready**: Designed for OpenClaw Agent integration

## Installation

```bash
# Via ClawHub
npx clawhub install siliconflow-video-gen

# Or manual
git clone https://github.com/your-repo/siliconflow-video-gen.git ~/.openclaw/workspace/skills/siliconflow-video-gen
```

## Configuration

Set your SiliconFlow API key:

```bash
export SILICONFLOW_API_KEY="your-api-key"
```

Or the skill will auto-detect from `~/.openclaw/openclaw.json`

## Usage

### Command Line

```bash
# Text-to-Video
python3 scripts/generate.py "A woman walking in a blooming garden, cinematic shot"

# Image-to-Video
python3 scripts/generate.py "Camera slowly zooming in" --image-url https://example.com/image.jpg

# Specify custom model
python3 scripts/generate.py "Sunset over mountains" --model "Wan-AI/Wan2.2-T2V-A14B"
```

### OpenClaw Agent

```
生成视频：一位女士在盛开的花园中漫步，电影级镜头
```

Or for image-to-video:

```
基于图片生成视频：https://example.com/image.jpg，镜头缓慢推进
```

## Available Models

| Model | Type | Cost | Quality |
|-------|------|------|---------|
| `Wan-AI/Wan2.2-T2V-A14B` | Text-to-Video | ¥2/video | Cinematic |
| `Wan-AI/Wan2.2-T2V-A14B` | Image-to-Video | ¥2/video | Cinematic |

## Model Details

**Wan2.2-T2V-A14B**
- Released: July 28, 2025
- Parameters: 14B
- Architecture: MoE (Mixture of Experts)
- Resolution: Up to 1080P
- Features: First open-source 14B video model with cinematic quality

## API Response

The script returns a JSON response:

```json
{
  "success": true,
  "message": "Job submitted successfully",
  "mode": "Text-to-Video",
  "request_id": "wylhsk14i432",
  "model": "Wan-AI/Wan2.2-T2V-A14B",
  "prompt": "A woman walking in garden",
  "image_url": null,
  "note": "Video generation is async. Use request_id to check status."
}
```

## Important Notes

- Video generation is **asynchronous**
- Use the returned `request_id` to check generation status
- Each video costs ¥2 (about $0.28 USD)
- Generation typically takes 1-5 minutes depending on complexity

## Author

MaxStorm Team

## License

MIT


path: skill.json
content: {
  "name": "siliconflow-video-gen",
  "version": "1.0.0",
  "description": "Generate videos using SiliconFlow API (Wan2.2). Supports Text-to-Video and Image-to-Video.",
  "author": "MaxStorm Team",
  "license": "MIT",
  "homepage": "https://github.com/maxstorm/siliconflow-video-gen",
  "keywords": ["video", "generation", "siliconflow", "wan2.2", "text-to-video", "image-to-video"],
  "trigger": {
    "patterns": [
      "生成视频",
      "文生视频",
      "图生视频",
      "生成短视频",
      "create video",
      "generate video",
      "text to video",
      "image to video"
    ]
  },
  "tools": ["exec"],
  "env": {
    "SILICONFLOW_API_KEY": {
      "description": "SiliconFlow API Key for video generation",
      "required": true
    }
  },
  "config": {
    "apiKey": {
      "description": "SiliconFlow API Key",
      "required": true,
      "env": "SILICONFLOW_API_KEY"
    },
    "defaultModel": {
      "description": "Default video generation model",
      "default": "Wan-AI/Wan2.2-T2V-A14B"
    }
  },
  "files": {
    "config": ["~/.openclaw/openclaw.json"]
  },
  "models": [
    {
      "id": "Wan-AI/Wan2.2-T2V-A14B",
      "name": "Wan2.2 T2V",
      "description": "Text-to-Video, cinematic quality, 14B params"
    },
    {
      "id": "Wan-AI/Wan2.2-I2V-A14B",
      "name": "Wan2.2 I2V",
      "description": "Image-to-Video, cinematic quality, 14B params"
    }
  ]
}


path: scripts/generate.py
content: #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
SiliconFlow Video Generation Script
Supports both Text-to-Video and Image-to-Video
Compatible with OpenClaw Agent Skills
"""

import os
import sys
import json
import argparse
import subprocess
import time

# API Configuration
API_BASE_URL = "https://api.siliconflow.cn/v1"
DEFAULT_MODEL = "Wan-AI/Wan2.2-T2V-A14B"

def get_api_key():
    """Get API key from environment or OpenClaw config"""
    [REDACTED_SECRET]"SILICONFLOW_API_KEY")
    if [REDACTED_SECRET] api_key
    
    try:
        config_path = os.path.expanduser("~/.openclaw/openclaw.json")
        with open(config_path, 'r', encoding='utf-8') as f:
            config = json.load(f)
        providers = config.get("models", {}).get("providers", {})
        siliconflow = providers.get("siliconflow", {})
        [REDACTED_SECRET]"apiKey")
        if api_key and api_key != "ollama":
            return api_key
    except Exception:
        pass
    
    return None

def submit_video_job(prompt, image_url=None, model=None):
    """Submit video generation job"""
    [REDACTED_SECRET])
    if not [REDACTED_SECRET] {"success": False, "error": "SILICONFLOW_API_KEY not found"}
    
    model = model or DEFAULT_MODEL
    
    data = {
        "model": model,
        "prompt": prompt
    }
    
    # Add image_url for image-to-video
    if image_url:
        data["image_url"] = image_url
    
    curl_cmd = [
        "curl", "-s", "-X", "POST",
        f"{API_BASE_URL}/video/submit",
        "-H", f"Authorization: Bearer {api_key}",
        "-H", "Content-Type: application/json",
        "-d", json.dumps(data),
        "--max-time", "30"
    ]
    
    try:
        result = subprocess.run(curl_cmd, capture_output=True, text=True)
        if result.returncode != 0:
            return {"success": False, "error": f"API request failed: {result.stderr}"}
        
        response = json.loads(result.stdout)
        
        # Check for API error
        if "code" in response and response["code"] != 200:
            return {"success": False, "error": response.get("message", "Unknown error")}
        
        return {"success": True, "request_id": response.get("requestId")}
        
    except Exception as e:
        return {"success": False, "error": str(e)}

def generate_video(prompt, image_url=None, model=None, output_path=None):
    """Generate video (text-to-video or image-to-video)"""
    mode = "Image-to-Video" if image_url else "Text-to-Video"
    print(json.dumps({
        "message": f"Submitting {mode} job...",
        "prompt": prompt,
        "image_url": image_url
    }, ensure_ascii=False))
    
    # Submit job
    submit_result = submit_video_job(prompt, image_url, model)
    if not submit_result.get("success"):
        print(json.dumps(submit_result))
        sys.exit(1)
    
    request_id = submit_result.get("request_id")
    print(json.dumps({
        "success": True,
        "message": "Job submitted successfully",
        "mode": mode,
        "request_id": request_id,
        "model": model or DEFAULT_MODEL,
        "prompt": prompt,
        "image_url": image_url,
        "note": "Video generation is async. Use request_id to check status."
    }, indent=2, ensure_ascii=False))

def main():
    parser = argparse.ArgumentParser(
        description="Generate videos using SiliconFlow API (Wan2.2)",
        epilog="Examples:\n"
               "  %(prog)s \"A woman walking in garden\"\n"
               "  %(prog)s \"Camera zooming in\" --image-url https://example.com/image.jpg\n",
        formatter_class=argparse.RawDescriptionHelpFormatter
    )
    parser.add_argument("prompt", help="Video generation prompt")
    parser.add_argument("--image-url", "-i", help="Image URL for image-to-video mode")
    parser.add_argument("--model", "-m", help="Model to use", default=DEFAULT_MODEL)
    parser.add_argument("--output", "-o", help="Output file path (optional)")
    
    args = parser.parse_args()
    generate_video(args.prompt, args.image_url, args.model, args.output)

if __name__ == "__main__":
    main()


Security scan verdicts — ClawScan: clean | static analysis: clean | VirusTotal: clean | SkillSpector: suspicious (MEDIUM)