| name | doubao-video-generation |
| description | 集成豆包视频生成API,支持文生视频、图生视频、有声视频生成、任务查询等功能。使用时当用户需要调用豆包seedance模型生成视频,或者需要查询视频生成任务结果时触发。 |
Doubao Video Generation
Overview
This skill provides integration with the Doubao Seedance video generation API, enabling text-to-video, image-to-video, audio-enabled video generation, and async task status querying. It supports multiple models from Doubao with different capabilities.
Supported Capabilities
1. Create Video Generation Task
Supports multiple generation modes:
- Text-to-Video: Generate video from text prompt
- Image-to-Video (First Frame): Generate video starting from a provided first frame image
- Image-to-Video (First + Last Frame): Generate video transitioning between two provided frames (supported by select models)
- Audio-enabled Video: Generate video with automatically matched environmental audio (supported by doubao-seedance-1-5-pro-251215)
- Draft Mode: Fast low-resolution preview before generating high-quality final video
- Offline Flex Tier: Lower cost batch processing for non-urgent tasks
2. Query Video Generation Task
Check the status of an async generation task and retrieve the finished video URL when complete.
Configuration
Before using this API, create a .env file in the project root directory:
DOUBBAO_API_KEY=your_api_key_here
DOUBBAO_VIDEO_API_BASE=https://api.cozex.cn/v1/videos/generations
DOUBBAO_VIDEO_QUERY_BASE=https://api.cozex.cn/v1/videos/generations
Or copy from .env.example:
cp .env.example .env
The script will automatically load configuration from the .env file.
Usage
Basic Text-to-Video
python scripts/generate-video.py --prompt "A cat playing piano" --resolution 1080p
Image-to-Video (First Frame)
python scripts/generate-video.py --prompt "A cat walking" --images "https://example.com/image.jpg"
Image-to-Video (First + Last Frame)
python scripts/generate-video.py --prompt "Transition between scenes" --images "https://example.com/start.jpg,https://example.com/end.jpg"
Audio-enabled Video
python scripts/generate-video.py --prompt "Forest scene with birds" --generate-audio --model doubao-seedance-1-5-pro-251215
Draft Mode (Quick Preview)
python scripts/generate-video.py --prompt "Test video" --draft --resolution 480p
Query Task Status
python scripts/generate-video.py --task-id "task-xxx"
Poll Until Completion
python scripts/generate-video.py --task-id "task-xxx" --poll --poll-interval 10
Save Response to File
python scripts/generate-video.py --prompt "A sunset" --output result.json
Command Line Arguments
| Argument | Required | Default | Description |
|---|
--model | No | doubao-seedance-1-5-pro-251215 | Model name |
--prompt | Yes* | - | Text prompt for video generation |
--resolution | No | 1080p | Video resolution (480p/720p/1080p) |
--ratio | No | 16:9 | Aspect ratio |
--duration | No | 12 | Duration in seconds (2-12) |
--images | No | - | Comma-separated image URLs |
--fps | No | - | Frame rate |
--seed | No | -1 | Random seed |
--watermark | No | False | Add watermark |
--camera-fixed | No | False | Fixed camera |
--generate-audio | No | False | Generate audio (model-specific) |
--draft | No | False | Draft mode |
--draft-task-id | No | - | Draft task ID for final generation |
--service-tier | No | - | Service tier (flex for offline) |
--task-id | No | - | Task ID to query |
--poll | No | False | Poll until completion |
--poll-interval | No | 10 | Poll interval in seconds |
--output | No | - | Output file for JSON response |
*Required unless --task-id or --draft-task-id is provided
Model Selection
| Model | Resolution | Text to Video | Image to Video (1 frame) | Image to Video (2 frames) | Audio |
|---|
doubao-seedance-1-0-pro-250528 | 480p/720p/1080p | ✅ | ✅ | ✅ | ❌ |
doubao-seedance-1-0-pro-fast-251015 | 480p/720p/1080p | ✅ | ✅ | ❌ | ❌ |
doubao-seedance-1-5-pro-251215 | 480p/720p/1080p | ✅ | ✅ | ✅ | ✅ |
Resources
references/
- api-doc.md - Complete API documentation with request/response examples and full parameter reference