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-video

Tags

Translated version includes tags in frontmatter

SKILL.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.mp4

2. Custom parameters

bash
python3 scripts/generate_video.py "Seaside at sunset" \
  --duration 10 \
  --ratio 16:9 \
  --wait \
  -o sunset.mp4

3. Image-to-video

bash
python3 scripts/generate_video.py "Make the cat move" \
  --image-url https://example.com/cat.jpg \
  --duration 5 \
  --wait

4. Create task only (no waiting)

bash
python3 scripts/generate_video.py "City under the starry sky" -o starry.mp4
# Return task ID
Then query the status and download later:
bash
python3 scripts/generate_video.py --status <task_id> --wait -o starry.mp4

Parameter Description

ParameterDefault ValueDescription
prompt
RequiredVideo description prompt
-o, --output
output.mp4Output file path
-m, --model
doubao-seedance-1-5-pro-251215Model ID
-d, --duration
5Video duration (seconds)
-r, --ratio
16:9Aspect ratio (16:9, 9:16, 1:1, 4:3, etc.)
--watermark
falseAdd watermark
--return-last-frame
falseReturn the last frame image
--image-url
NoneFirst frame image URL (for image-to-video)
--wait
falseWait for video generation to complete and download automatically
--status
NoneQuery the status of the specified task ID

API Key Configuration

You need to set the
ARK_API_KEY
or
SEEDANCE_API_KEY
environment variable.

Configuration Method (Recommended)

  1. Copy the configuration template:
bash
cp .canghe-skills/.env.example .canghe-skills/.env
  1. Edit the
    .canghe-skills/.env
    file and fill in your API Key:
ARK_API_KEY=your-actual-api-key-here

Or use environment variables

bash
export ARK_API_KEY="your-api-key"
# Or
export SEEDANCE_API_KEY="your-api-key"

Loading Priority

  1. System environment variables (
    process.env
    )
  2. .canghe-skills/.env
    in the current directory
  3. ~/.canghe-skills/.env
    in the user home directory

Prompt Optimization Suggestions

  1. Specific description: Describe details such as scene, subject, action, environment, etc.
  2. Clear style: Specify the photography style (such as "cinematic", "documentary style")
  3. Light description: Specify lighting conditions (such as "golden hour", "soft natural light")
  4. 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 quality
A robot walking on a neon street in a future city, cyberpunk style, rainy night, reflections, wide-angle lens, cinematic color tone

Python 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

  • queued
    : In queue
  • running
    : Generating
  • succeeded
    : Succeeded
  • failed
    : Failed