deerflow2/skills/public/video-generation/SETUP.md

2.5 KiB
Executable File

Video Generation Skill - Setup Guide

Quick Start

  1. Install Dependencies

    pip install requests python-dotenv
    
  2. Configure API Key

    Create a .env file in the project root directory:

    RUNNINGHUB_API_KEY=your_api_key_here
    

    Or set it as an environment variable:

    # Windows PowerShell
    $env:RUNNINGHUB_API_KEY="your_api_key_here"
    
    # Linux/Mac
    export RUNNINGHUB_API_KEY="your_api_key_here"
    
  3. Generate a Video

    python scripts/generate.py --prompt-file workspace/your-prompt.json --output-file outputs/video.mp4 --duration 5
    

Parameters

  • --prompt-file: Path to JSON prompt file (required)
  • --output-file: Output video file path (required)
  • --aspect-ratio: Video aspect ratio (optional, default: 16:9)
  • --duration: Video duration in seconds (optional, default: 5, range: 1-16)

Getting API Key

To use this skill, you need a RunningHub API key:

  1. Visit RunningHub
  2. Sign up for an account
  3. Get your API key from the dashboard
  4. Add it to your .env file

Example Prompt

Create a JSON file with your video description:

{
  "title": "Your Video Title",
  "description": "Description of what you want to generate",
  "visual": {
    "scene": "Scene description",
    "elements": ["element1", "element2"],
    "colors": "Color palette",
    "lighting": "Lighting description"
  },
  "camera": {
    "movement": "Camera movement",
    "focus": "Focus description"
  },
  "audio": {
    "background": "Background music description",
    "effects": "Sound effects description"
  }
}

Notes

  • The .env file is already in .gitignore and won't be committed to version control
  • Never share your API key or commit it to public repositories
  • The script automatically loads environment variables from .env file
  • Video generation may take several minutes depending on the complexity

Troubleshooting

Error: RUNNINGHUB_API_KEY is not set

  • Make sure you've created the .env file with your API key
  • Or set the environment variable before running the script

Error: Failed to submit task

  • Check that your API key is valid
  • Ensure you have sufficient credits in your RunningHub account
  • Verify your internet connection

Video generation takes too long

  • This is normal for AI video generation
  • The script will automatically poll for status until completion
  • You can check the RunningHub dashboard for task progress