Features
Generate videos using the Volcano Engine SD1.5pro API, supporting text-only generation and image-to-video.
First-Time Setup
1. Create Configuration File
Create in the skill directory config.json file:
{
"api_key": "你的火山引擎API Key",
"model": "你的模型ID(如:ep-20260313005600-p8s6m)"
}
2. Configuration Instructions
- api_key: Volcano Engine API Key (required)
- model: Model ID (required), defaults to
ep-20260313005600-p8s6m
3. Obtain API Key and Model ID
- Visit Volcano Engine Console:https://console.volcengine.com/
- Create or obtain an API Key in API Key Management
- Find the ID of the SD1.5pro model in Model Service
Usage
Basic Usage (Text-Only Generation)
python scripts/generate_video.py "提示词"
Image-to-Video (Requires Reference Image)
python scripts/generate_video.py "提示词" --image "https://example.com/image.jpg"
Specify Output Path
python scripts/generate_video.py "提示词" --output "C:\Users\Desktop\视频.mp4"
Full Parameters
python scripts/generate_video.py "提示词" \
--image "https://example.com/image.jpg" \
--duration 5 \
--output "C:\Users\Desktop\视频.mp4" \
--camera-fixed False \
--watermark True
Parameter Description
| Parameter | Type | Required | Default Value | Description |
|---|---|---|---|---|
prompt |
String | Yes | - | Text Prompt |
--image |
String | No | None | Reference Image URL (image-to-video) |
--duration |
Integer | No | 5 | Video Duration (seconds) |
--output |
String | No | Desktop | Output File Path |
--camera-fixed |
Boolean | No | False | Whether the camera is fixed |
--watermark |
Boolean | No | True | Whether to add a watermark |
Workflow
- Create Task: Call the API to create a video generation task
- Asynchronous Processing: Poll task status, wait for generation to complete
- Download Video: Automatically download the generated video to the specified location
Examples
Example 1: Text-Only Generation
python scripts/generate_video.py "冬日的杭州西湖,雪花纷纷扬扬飘落"
Example 2: Image-to-Video
python scripts/generate_video.py "无人机穿越障碍" \
--image "https://example.com/reference.jpg"
Example 3: Custom Parameters
python scripts/generate_video.py "美丽风景" \
--duration 10 \
--output "C:\Videos\风景.mp4" \
--watermark False
Notes
- You must configure the
config.jsonfile before first use - Video generation is asynchronous and may take several minutes
- It is recommended to use a desktop path to save videos
- Supports MP4 format output
- The default video duration is 5 seconds; the maximum duration depends on model limits
Error Handling
If you encounter the following errors:
- Configuration file does not exist: Create
config.jsonfile and configure the API Key and Model ID - Invalid API Key: Check whether the API Key is correct
- Incorrect Model ID: Confirm whether the Model ID is valid
- Network Error: Check the network connection and firewall settings
API Documentation
- Volcano Engine Console: https://console.volcengine.com/
- API Documentation: https://www.volcengine.com/docs/