seedance-video
Original:🇨🇳 Chinese
Translated
1 scriptsChecked / no sensitive code detected
Generate videos using ByteDance's Seedance model. It supports text-to-video and image-to-video functions, and calls APIs through the volcengine-ark SDK. This skill is activated when users need to generate videos, create video content, or produce videos based on text or images.
15installs
Added on
NPX Install
npx skill4agent add freestylefly/canghe-skills seedance-videoTags
Translated version includes tags in frontmatterSKILL.md Content (Chinese)
View Translation Comparison →Seedance Video Generation
Generate videos from text or images using ByteDance's Seedance-1.5-pro model (doubao-seedance-1-5-pro-251215).
Prerequisites
Install the SDK:
bash
pip install 'volcengine-python-sdk[ark]'Features
- Text-to-video: Generate videos based on text prompts
- Image-to-video: Generate videos based on the first frame image
- Custom parameters: Support setting duration, aspect ratio, watermark, etc.
- Task management: Create tasks, query status, and auto download results
Usage
1. Quick video generation (text-to-video)
bash
cd ~/.openclaw/workspace/skills/seedance-video
python3 scripts/generate_video.py "A cute cat playing on the grass" --wait -o cat.mp42. Custom parameters
bash
python3 scripts/generate_video.py "Seaside at sunset" \
--duration 10 \
--ratio 16:9 \
--wait \
-o sunset.mp43. Image-to-video
bash
python3 scripts/generate_video.py "Make the cat move" \
--image-url https://example.com/cat.jpg \
--duration 5 \
--wait4. Create task only (no waiting)
bash
python3 scripts/generate_video.py "City under the starry sky" -o starry.mp4
# Return task IDThen query the status and download later:
bash
python3 scripts/generate_video.py --status <task_id> --wait -o starry.mp4Parameter Description
| Parameter | Default Value | Description |
|---|---|---|
| Required | Video description prompt |
| output.mp4 | Output file path |
| doubao-seedance-1-5-pro-251215 | Model ID |
| 5 | Video duration (seconds) |
| 16:9 | Aspect ratio (16:9, 9:16, 1:1, 4:3, etc.) |
| false | Add watermark |
| false | Return the last frame image |
| None | First frame image URL (for image-to-video) |
| false | Wait for video generation to complete and download automatically |
| None | Query the status of the specified task ID |
API Key Configuration
You need to set the or environment variable.
ARK_API_KEYSEEDANCE_API_KEYConfiguration Method (Recommended)
- Copy the configuration template:
bash
cp .canghe-skills/.env.example .canghe-skills/.env- Edit the file and fill in your API Key:
.canghe-skills/.env
ARK_API_KEY=your-actual-api-key-hereOr use environment variables
bash
export ARK_API_KEY="your-api-key"
# Or
export SEEDANCE_API_KEY="your-api-key"Loading Priority
- System environment variables ()
process.env - in the current directory
.canghe-skills/.env - in the user home directory
~/.canghe-skills/.env
Prompt Optimization Suggestions
Refer to Seedance-1.5-pro Prompt Guide:
- Specific description: Describe details such as scene, subject, action, environment, etc.
- Clear style: Specify the photography style (such as "cinematic", "documentary style")
- Light description: Specify lighting conditions (such as "golden hour", "soft natural light")
- Lens language: Describe camera movement (such as "slow push-in", "stabilizer shooting")
Example Prompts
A golden retriever running in an autumn park, golden fallen leaves falling, afternoon sunlight passing through the leaves, cinematic lens, stabilizer shooting, 4K qualityA robot walking on a neon street in a future city, cyberpunk style, rainy night, reflections, wide-angle lens, cinematic color tonePython API Usage
python
from volcenginesdkarkruntime import Ark
from scripts.generate_video import create_video_task, wait_for_video
# Initialize client
client = Ark(
base_url="https://ark.cn-beijing.volces.com/api/v3",
api_key="your-api-key"
)
# Create video task
result = create_video_task(
client=client,
model="doubao-seedance-1-5-pro-251215",
prompt="A bird flying in the sky",
duration=5
)
task_id = result["task_id"]
# Wait and get result
final_status = wait_for_video(client, task_id)
video_url = final_status["video_url"]Notes
- Asynchronous generation: Video generation is an asynchronous process, usually taking 30-60 seconds
- Task retention time: Task data is only retained for 24 hours
- Rate limiting: Pay attention to the RPM and concurrency limits of your account
- Video ratio: It is recommended that the video aspect ratio is close to the ratio of the first frame image
Task Status
- : In queue
queued - : Generating
running - : Succeeded
succeeded - : Failed
failed