
Video Generator SeeDance
- 8 installs
- 33 repo stars
- Updated April 26, 2026
- bighardperson/computer-science-skills-collection
video-generator-seedance is a Claude skill that generates text-to-video and image-to-video MP4 clips through Volcengine's SD1.5pro API.
About
This skill generates video with Volcengine's (火山引擎) SD1.5pro API, supporting text-to-video and image-to-video generation. It creates an asynchronous job, polls until the video is ready, and downloads the resulting MP4, with parameters for duration, output path, camera-fixed and watermark. A developer uses it to produce short generated videos from a prompt or a reference image. It matters because it wraps the async generation flow behind a single bundled Python script.
- Generates video from text or from an image using Volcengine's SD1.5pro API
- Runs asynchronous jobs that poll status and auto-download the finished MP4
- Supports duration, output path, camera-fixed and watermark parameters
Video Generator SeeDance by the numbers
- 8 all-time installs (skills.sh)
- Ranked #1,074 of 1,337 Generative Media skills by installs in the Skillselion catalog
- Data as of Jul 30, 2026 (Skillselion catalog sync)
Video-Generator-SeeDance capabilities & compatibility
Requires a Volcengine API key and model ID; usage billed by Volcengine
- Capabilities
- video generation · text to video · image to video
- Use cases
- video generation
- Runs
- Runs locally
- Pricing
- Bring your own API key
What Video-Generator-SeeDance says it does
使用火山引擎 SD1.5pro API 生成视频。支持文本到视频和图生视频,异步处理任务。
**创建任务**: 调用API创建视频生成任务
首次使用前必须配置 `config.json` 文件
npx skills add https://github.com/bighardperson/computer-science-skills-collection --skill video-generator-seedanceAdd your badge
Show developers this skill is listed on Skillselion. Paste this into your README.
| Installs | 8 |
|---|---|
| repo stars | ★ 33 |
| Last updated | April 26, 2026 |
| Repository | bighardperson/computer-science-skills-collection ↗ |
What it does
Generate text-to-video or image-to-video MP4 clips through Volcengine's SD1.5pro API.
Who is it for?
Generating short video clips from a text prompt or a reference image via the SD1.5pro API
Skip if: Editing or clipping existing videos; it only generates new video from prompts or images
When should I use this skill?
The user wants to generate a video from text or from an image using the SD1.5pro / Volcengine API
What you get
An MP4 video generated from a prompt or image and downloaded to the chosen path
- Generated MP4 video file
By the numbers
- default duration 5 seconds
- 6 CLI parameters (prompt, image, duration, output, camera-fixed, watermark)
Files
SD1.5pro 视频生成技能
功能
使用火山引擎的 SD1.5pro API 生成视频,支持纯文本生成和图生视频。
首次使用配置
1. 创建配置文件
在技能目录中创建 config.json 文件:
{
"api_key": "你的火山引擎API Key",
"model": "你的模型ID(如:ep-20260313005600-p8s6m)"
}2. 配置说明
- api_key: 火山引擎API Key(必需)
- model: 模型ID(必需),默认使用
ep-20260313005600-p8s6m
3. 获取API Key和模型ID
1. 访问火山引擎控制台:https://console.volcengine.com/ 2. 在API Key管理中创建或获取API Key 3. 在模型服务中找到SD1.5pro模型的ID
使用方法
基本用法(仅文本生成)
python scripts/generate_video.py "提示词"图生视频(需要参考图片)
python scripts/generate_video.py "提示词" --image "https://example.com/image.jpg"指定输出路径
python scripts/generate_video.py "提示词" --output "C:\Users\Desktop\视频.mp4"完整参数
python scripts/generate_video.py "提示词" \
--image "https://example.com/image.jpg" \
--duration 5 \
--output "C:\Users\Desktop\视频.mp4" \
--camera-fixed False \
--watermark True参数说明
| 参数 | 类型 | 必需 | 默认值 | 说明 |
|---|---|---|---|---|
prompt | 字符串 | 是 | - | 文本提示词 |
--image | 字符串 | 否 | 无 | 参考图片URL(图生视频) |
--duration | 整数 | 否 | 5 | 视频时长(秒) |
--output | 字符串 | 否 | 桌面 | 输出文件路径 |
--camera-fixed | 布尔 | 否 | False | 相机是否固定 |
--watermark | 布尔 | 否 | True | 是否添加水印 |
工作流程
1. 创建任务: 调用API创建视频生成任务 2. 异步处理: 轮询任务状态,等待生成完成 3. 下载视频: 自动下载生成的视频到指定位置
示例
示例1:纯文本生成
python scripts/generate_video.py "冬日的杭州西湖,雪花纷纷扬扬飘落"示例2:图生视频
python scripts/generate_video.py "无人机穿越障碍" \
--image "https://example.com/reference.jpg"示例3:自定义参数
python scripts/generate_video.py "美丽风景" \
--duration 10 \
--output "C:\Videos\风景.mp4" \
--watermark False注意事项
- 首次使用前必须配置
config.json文件 - 视频生成是异步的,可能需要几分钟
- 建议使用桌面路径保存视频
- 支持MP4格式输出
- 默认视频时长为5秒,最大时长取决于模型限制
错误处理
如果遇到以下错误:
1. 配置文件不存在: 创建 config.json 文件并配置API Key和模型ID 2. API Key无效: 检查API Key是否正确 3. 模型ID错误: 确认模型ID是否有效 4. 网络错误: 检查网络连接和防火墙设置
API文档
- 火山引擎控制台: https://console.volcengine.com/
- API文档: https://www.volcengine.com/docs/
{
"ownerId": "kn76pxaypnyz4n3wvcet7gcp5h82sdz0",
"slug": "video-generator-seedance",
"version": "1.0.1",
"publishedAt": 1773337801019
}{
"slug": "video-generator-seedance",
"name": "video-generator-seedance",
"version": "1.0.1",
"installedAt": 1776152120874,
"source": "skillhub"
}{
"api_key": "YOUR_API_KEY_HERE",
"model": "YOUR_MODEL_ID_HERE"
}
Video-Generator-SeeDance 视频生成技能
使用火山引擎 SD1.5pro API 生成视频,支持纯文本生成和图生视频。
🚀 快速开始
1. 配置技能
复制示例配置文件并填写您的信息:
cp config.example.json config.json编辑 config.json 文件:
{
"api_key": "你的火山引擎API Key",
"model": "你的模型ID(如:ep-20260313005600-p8s6m)"
}2. 生成视频
纯文本生成
python scripts/generate_video.py "冬日的杭州西湖,雪花纷纷扬扬飘落"图生视频
python scripts/generate_video.py "无人机穿越障碍" \
--image "https://example.com/reference.jpg"📋 获取API Key和模型ID
1. 访问火山引擎控制台:https://console.volcengine.com/ 2. 获取API Key**:
- 进入"API Key管理"
- 创建或复制API Key
3. 获取模型ID:
- 进入"模型服务"
- 找到SD1.5pro模型
- 复制模型ID
🛠️ 参数说明
| 参数 | 类型 | 必需 | 默认值 | 说明 |
|---|---|---|---|---|
prompt | 字符串 | 是 | - | 文本提示词 |
--image | 字符串 | 否 | 无 | 参考图片URL(图生视频) |
--duration | 整数 | 否 | 5 | 视频时长(秒) |
--output | 字符串 | 否 | 桌面 | 输出文件路径 |
--camera-fixed | 布尔 | 否 | False | 相机是否固定 |
--watermark | 布尔 | 否 | True | 是否添加水印 |
--config | 字符串 | 否 | config.json | 配置文件路径 |
📝 使用示例
示例1:纯文本生成
python scripts/generate_video.py "美丽风景"示例2:指定输出路径
python scripts/generate_video.py "美丽风景" \
--output "C:\Videos\风景.mp4"示例3:图生视频
```需要的bash python scripts/generate_video.py "无人机穿越障碍" \ --image "https://example.com/reference.jpg"
### 示例4:自定义所有参数python scripts/generate_video.py "美丽风景" \ --image "https://example.com/reference.jpg" \ --duration 10 \ --output "C:\Videos\风景.mp4" \ --camera-fixed False \ --watermark False
## ⚠️ 注意事项
1. **配置文件**: 首次使用前必须配置 `config.json` 文件
2. **异步处理**: 视频生成是异步的,可能需要几分钟
3. **网络连接**: 需要稳定的网络连接
4. **文件路径**: 建议使用绝对路径保存视频
5. **模型限制**: 不同模型可能有不同的时长和分辨率限制
## 🔧 故障排除
### 错误:配置文件不存在
**解决方案**: 创建 `config.json` 文件并配置API Key和模型ID
### 错误:配置文件中缺少api_key
**解决方案**: 在 `config.json` 中添加 `api_key` 字段
### 错误:API Key无效
**解决方案**: 检查API Key是否正确,是否已过期
### 错误:模型ID错误
**解决方案**: 确认模型ID是否有效,模型是否可用
### 错误:网络连接失败
**解决方案**: 检查网络连接和防火墙设置
## 📚 相关文档
- [火山引擎控制台](https://console.volcengine.com/)
- [火山引擎API文档](https://www.volcengine.com/docs/)
- [ClawHub](https://clawhub.com)
## 📄 许可证
This skill is released under the MIT-0 License (MIT No Attribution). Feel free to use it for any purpose without attribution.
## 🤝 贡献
欢迎提交问题和改进建议!
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
使用火山引擎 SD1.5pro API 生成视频
支持命令行参数传入提示词和图片地址
从config.json读取API Key和模型ID
"""
import sys
import json
import time
import requests
import argparse
import os
if sys.stdout.encoding != 'utf-8':
sys.stdout.reconfigure(encoding='utf-8')
class SD15ProVideoGenerator:
"""SD1.5pro 视频生成器"""
def __init__(self, config_path=None):
"""
初始化视频生成器
Args:
config_path: 配置文件路径,如果为None则使用默认路径
"""
# 确定配置文件路径
if config_path is None:
# 使用技能目录中的config.json
script_dir = os.path.dirname(os.path.abspath(__file__))
config_path = os.path.join(script_dir, '..', 'config.json')
# 加载配置
self.config = self.load_config(config_path)
# 从配置中获取API Key和模型ID
self.api_key = self.config.get('api_key')
self.model = self.config.get('model', 'ep-20260313005600-p8s6m') # 默认模型
if not self.api_key:
raise ValueError("配置文件中缺少api_key,请在config.json中配置API Key")
# API配置
self.create_task_url = "https://ark.cn-beijing.volces.com/api/v3/contents/generations/tasks"
self.headers = {
"Authorization": f"Bearer {self.api_key}",
"Content-Type": "application/json"
}
def load_config(self, config_path):
"""
加载配置文件
Args:
config_path: 配置文件路径
Returns:
配置字典
"""
if not os.path.exists(config_path):
raise FileNotFoundError(
f"配置文件不存在: {config_path}\n"
f"请创建config.json文件并配置以下内容:\n"
f'{{\n'
f' "api_key": "你的火山引擎API Key",\n'
f' "model": "你的模型ID"\n'
f'}}'
)
with open(config_path, 'r', encoding='utf-8') as f:
config = json.load(f)
return config
def create_video_task(self, prompt, image_url=None, duration=5, camera_fixed=False, watermark=True):
"""
创建视频任务
Args:
prompt: 文本提示词
image_url: 参考图片URL(可选)
duration: 视频时长(秒)
camera_fixed: 相机是否固定
watermark: 是否添加水印
Returns:
任务ID
"""
print(f"🎬 开始创建视频任务...")
print(f" 模型: {self.model}")
print(f" 提示词: {prompt}")
if image_url:
print(f" 参考图片: {image_url}")
else:
print(f" 参考图片: 无(纯文本生成)")
print(f" 时长: {duration}秒")
print(f" 相机固定: {camera_fixed}")
print(f" 水印: {watermark}")
print()
# 构建请求体
# 参数在text中,格式:"{prompt} --duration {duration} --camerafixed {camera_fixed} --watermark {watermark}"
text_with_params = f"{prompt} --duration {duration} --camerafixed {str(camera_fixed).lower()} --watermark {str(watermark).lower()}"
# 构建content数组
content = [
{
"type": "text",
"text": text_with_params
}
]
# 如果提供了参考图片,添加到content中
if image_url:
content.append({
"type": "image_url",
"image_url": {
"url": image_url
}
})
payload = {
"model": self.model,
"content": content
}
print("📝 请求体:")
print(json.dumps(payload, ensure_ascii=False, indent=2))
print()
try:
response = requests.post(
self.create_task_url,
headers=self.headers,
json=payload,
timeout=30
)
print(f"📥 响应状态码: {response.status_code}")
if response.status_code == 200:
result = response.json()
print("📝 响应内容:")
print(json.dumps(result, ensure_ascii=False, indent=2))
print()
# 提取任务ID
if "id" in result:
task_id = result["id"]
print(f"✅ 视频生成任务已创建")
print(f" 任务ID: {task_id}")
return task_id
else:
print("❌ 响应中未找到任务ID")
return None
else:
print(f"❌ 创建任务失败")
print(f" 错误信息: {response.text}")
return None
except Exception as e:
print(f"❌ 创建视频任务时出错: {e}")
return None
def check_task_status(self, task_id):
"""
查询任务状态
Args:
task_id: 任务ID
Returns:
任务状态信息
"""
print(f"🔍 查询任务状态: {task_id}")
try:
response = requests.get(
f"{self.create_task_url}/{task_id}",
headers=self.headers,
timeout=10
)
if response.status_code == 200:
result = response.json()
return result
else:
print(f"❌ 查询任务状态失败: {response.text}")
return None
except Exception as e:
print(f"❌ 查询任务状态时出错: {e}")
return None
def wait_for_completion(self, task_id, max_wait_time=300, poll_interval=10):
"""
等待任务完成
Args:
task_id: 任务ID
max_wait_time: 最大等待时间(秒)
poll_interval: 轮询间隔(秒)
Returns:
完成后的任务信息
"""
print(f"⏳ 等待任务完成...")
print(f" 最大等待时间: {max_wait_time}秒")
print(f" 轮询间隔: {poll_interval}秒")
print()
start_time = time.time()
while True:
elapsed_time = int(time.time() - start_time)
if elapsed_time >= max_wait_time:
print(f"⏰ 超时: 已等待{elapsed_time}秒")
return None
# 查询任务状态
task_info = self.check_task_status(task_id)
if task_info:
status = task_info.get("status", "unknown")
print(f" [{elapsed_time}s] 状态: {status}")
if status == "succeeded":
print("✅ 任务完成!")
return task_info
elif status == "failed":
print("❌ 任务失败")
error = task_info.get("error", "未知错误")
print(f" 错误信息: {error}")
return None
elif status == "processing" or status == "running" or status == "queued":
# 继续等待
pass
else:
print(f"⚠️ 未知状态: {status}")
# 等待下一次轮询
time.sleep(poll_interval)
def get_video_url(self, task_info):
"""
从任务信息中提取视频URL
Args:
task_info: 任务信息
Returns:
视频URL
"""
# 根据实际响应格式,视频URL在 content.video_url 中
if "content" in task_info:
if "video_url" in task_info["content"]:
return task_info["content"]["video_url"]
# 尝试其他可能的路径
if "result" in task_info:
if "video" in task_info["result"]:
return task_info["result"]["video"]
elif "video_url" in task_info["result"]:
return task_info["result"]["video_url"]
if "video_url" in task_info:
return task_info["video_url"]
if "video" in task_info:
return task_info["video"]
return None
def download_video(self, video_url, output_path):
"""
下载视频
Args:
video_url: 视频URL
output_path: 输出路径
Returns:
是否成功
"""
print(f"📥 下载视频...")
print(f" 视频URL: {video_url}")
print(f" 输出路径: {output_path}")
try:
response = requests.get(video_url, stream=True, timeout=30)
if response.status_code == 200:
with open(output_path, 'wb') as f:
for chunk in response.iter_content(chunk_size=8192):
f.write(chunk)
file_size = len(open(output_path, 'rb').read()) / (1024*1024)
print(f"✅ 视频下载成功")
print(f" 文件大小: {file_size:.2f} MB")
return True
else:
print(f"❌ 下载视频失败: {response.status_code}")
return False
except Exception as e:
print(f"❌ 下载视频时出错: {e}")
return False
def main():
"""主函数"""
# 解析命令行参数
parser = argparse.ArgumentParser(description='SD1.5pro 视频生成器')
parser.add_argument('prompt', type=str, help='文本提示词')
parser.add_argument('--image', type=str, help='参考图片URL(可选)')
parser.add_argument('--duration', type=int, default=5, help='视频时长(秒),默认5')
parser.add_argument('--output', type=str, help='输出文件路径,默认保存到桌面')
parser.add_argument('--camera-fixed', type=bool, default=False, help='相机是否固定,默认False')
parser.add_argument('--watermark', type=bool, default=True, help='是否添加水印,默认True')
parser.add_argument('--config', type=str, help='配置文件路径,默认使用技能目录中的config.json')
args = parser.parse_args()
print("🎬 SD1.5pro 视频生成器")
print("=" * 60)
try:
# 创建视频生成器(从配置文件加载API Key和模型ID)
generator = SD15ProVideoGenerator(config_path=args.config)
# 确定输出路径
if args.output:
output_path = args.output
else:
# 使用提示词的前10个字符作为文件名
safe_name = args.prompt[:10].replace(' ', '_').replace('/', '_')
output_path = rf"C:\Users\Administrator\Desktop\{safe_name}.mp4"
# 步骤1: 创建视频任务
task_id = generator.create_video_task(
prompt=args.prompt,
image_url=args.image,
duration=args.duration,
camera_fixed=args.camera_fixed,
watermark=args.watermark
)
if not task_id:
print("❌ 无法创建视频生成任务")
return
print()
# 步骤2: 等待任务完成
task_info = generator.wait_for_completion(task_id)
if not task_info:
print("❌ 任务未完成")
return
print()
# 步骤3: 提取视频URL
video_url = generator.get_video_url(task_info)
if not video_url:
print("❌ 未找到视频URL")
return
print(f"📹 视频URL: {video_url}")
print()
# 步骤4: 下载视频
success = generator.download_video(video_url, output_path)
if success:
print()
print("=" * 60)
print("🎉 视频生成完成!")
print(f"📁 文件位置: {output_path}")
else:
print()
print("=" * 60)
print("❌ 视频生成失败")
except FileNotFoundError as e:
print(f"❌ 配置错误: {e}")
print()
print("请创建config.json文件并配置以下内容:")
print('{')
print(' "api_key": "你的火山引擎API Key",')
print(' "model": "你的模型ID"')
print('}')
except ValueError as e:
print(f"❌ 配置错误: {e}")
except Exception as e:
print(f"❌ 发生错误: {e}")
import traceback
traceback.print_exc()
if __name__ == "__main__":
main()
Related skills
FAQ
What does video-generator-seedance need to run?
A config.json with a Volcengine API key and a model ID; without it the script cannot start generation.
Does it support image-to-video?
Yes. Pass an image URL with --image to generate video from a reference image, in addition to plain text-to-video.