Seedance 视频生成器 — API 不消耗积分 (Allaimo)
通过 Allaimo API 平台调用 ByteDance Doubao Seedance 2.0 / 2.5 模型生成视频。使用你自己的 API Key,不消耗 WorkBuddy 积分。
支持模型: Seedance 2.0(标准版/快速版/Mini)和 Seedance 2.5。
Prerequisites — Get API Key
To use this skill the user MUST have an Allaimo API key. If they do not have one:
- Go to https://allaimo.com (Allaimo AI Platform)
- Register or log in
- Navigate to "API Key Management" (API Key 管理)
- Create a new API key
- Copy the key string
No Python library installation is needed — the script uses only Python standard library (urllib, json, os, time).
How to Use (Step by Step)
Step 1: Confirm API Key
Ask the user for their Allaimo API key if not already provided. The key can be passed via:
- Environment variable:
export ALLAIMO_API_KEY="sk-xxxxx" - CLI argument:
--api-key sk-xxxxx
Step 2: Understand What the User Wants
Determine the type of generation:
| Scenario | Required Flags |
|---|---|
| Text → Video (T2V) | --prompt "description" |
| Image → Video (I2V) | --prompt "motion description" --image <url_or_path> |
| First+Last Frame Control | --prompt "..." --image first.jpg --last-image last.jpg |
| Query Existing Task | --task-id <id> --query |
| Download Completed Task | --task-id <id> |
Step 3: Run the Script
The script is at scripts/seedance_video.py relative to this skill directory.
It defaults to calling https://api.allaimo.com/v1 — no URL configuration needed.
Basic text-to-video example:
python3 <skill_dir>/scripts/seedance_video.py \
--api-key "sk-xxxxx" \
--prompt "一只金毛犬在阳光下的麦田里奔跑,广角跟拍,电影质感" \
--output golden_retriever.mp4
Use Seedance 2.5 (longer videos, latest model):
python3 <skill_dir>/scripts/seedance_video.py \
--api-key "sk-xxxxx" \
--model 2.5 \
--prompt "..." \
--duration 15 \
--output long_video.mp4
Image-to-video example:
python3 <skill_dir>/scripts/seedance_video.py \
--api-key "sk-xxxxx" \
--prompt "人物慢慢转头微笑" \
--image https://example.com/portrait.jpg \
--ratio adaptive \
--output portrait_animation.mp4
Custom resolution and duration:
python3 <skill_dir>/scripts/seedance_video.py \
--api-key "sk-xxxxx" \
--prompt "..." \
--model fast \
--resolution 720p \
--duration 10 \
--ratio 9:16 \
--output short_video.mp4
Step 4: Wait and Report
The script will:
1. Print "Submitting task..." and show key parameters
2. Print the task ID
3. Poll status every 5s, doubling up to 60s max (exponential backoff)
4. Show current status during polling
5. Download video automatically when done
6. Print a JSON summary with file path, size, resolution, duration, and token usage
Generation typically takes 60-180 seconds for a 5-second 1080p video.
All CLI Parameters
Authentication
--api-key— Allaimo API key (or setALLAIMO_API_KEYenv var. Get it from allaimo.com)--base-url— API endpoint (default:https://api.allaimo.com/v1)
Generation
--prompt— Text description (required for generation, Chinese or English)--image— First-frame image (URL or local path)--last-image— Last-frame image for bookend control (URL or local path)--video— Reference video (URL or local path)--audio— Reference audio (URL or local path)--model— One of:standard(2.0),fast(2.0),mini(2.0),2.5(default:standard)--resolution—480p,720p,1080p, or4k(default:1080p)--ratio—16:9,9:16,1:1,4:3,3:4,21:9, oradaptive(default:16:9)--duration— Seconds, 4-15 for 2.0 models, up to 30 for 2.5 (default:5)--seed— Random seed for reproducibility--return-last-frame— Output the last frame image
Output
--output/-o— Output filename (default:<task_id>.mp4)
Query
--task-id— Existing task ID--query— Only show status, skip download
Model Selection Guide
| Model | Alias | Version | Max Resolution | Max Duration | When to Use |
|---|---|---|---|---|---|
standard |
— | Seedance 2.0 | 4k | 15s | Best quality, default for production |
fast |
— | Seedance 2.0 | 720p | 15s | Quick tests, prototypes, cheaper |
mini |
— | Seedance 2.0 | 720p | 15s | Cheapest option, drafts |
2.5 |
— | Seedance 2.5 | 1080p | 30s | Latest model, longest videos |
Error Handling
| Situation | Action |
|---|---|
| API key invalid (401) | Ask user to check key on allaimo.com |
| Rate limited (429) | Script retries automatically with backoff |
| Task failed | Read error message from API response, help user fix prompt or input |
| Task expired | Re-submit with same parameters |
| Video URL expired (403 on download) | Re-submit task (URLs expire after 24 hours) |
Important Constraints to Tell the User
- API platform: All requests go through
https://api.allaimo.com/v1. Users must create API keys on allaimo.com. - Model version: Supports both Seedance 2.0 (standard/fast/mini) and Seedance 2.5.
- Time: 60-180 seconds generation time for 5s 1080p.
- Resolution limits: Fast and Mini models max out at 720p. 2.5 maxes at 1080p.
- Duration limits: 4-15 seconds for 2.0 models; up to 30 seconds for 2.5.
- Download quickly: Generated video URLs expire after 24 hours.
After Generation
After successfully generating a video:
1. Show the output file path and size to the user
2. If using --return-last-frame, note the last frame URL for chain generation
3. Offer to save the video to the user's preferred location
For the User: Quick Setup (Chinese)
第 1 步:去 allaimo.com 注册并创建 API Key
第 2 步:在终端设置 API Key(只需做一次):
export ALLAIMO_API_KEY="你的Allaimo API密钥"
第 3 步:直接使用,比如:
python3 <技能目录>/scripts/seedance_video.py \
--model 2.5 \
--prompt "一只猫在窗台上晒太阳" \
--output 猫晒太阳.mp4
如果不指定 --model,默认使用 Seedance 2.0 标准版。用 --model 2.5 切换到 2.5 版本。
找技能目录:
ls ~/.workbuddy/skills/seedance-video/scripts/