AI Video Generation Configuration
Configure AI video generation functionality
TinyShip supports AI video generation with multiple providers. This document explains how to configure AI video generation.
Related Pages
| Page | Path | Description |
|---|---|---|
| Video Gen | /video-generate | AI video generation page |
Supported Video Providers
| Service | Models | Features |
|---|---|---|
| Fal.ai | Kling 3.0 Pro text/image-to-video, Veo 3.1 | Simple integration, supports text-to-video and image-to-video |
| Volcengine Seedance | doubao-seedance-2-5-260628, doubao-seedance-2-0-260128 | 2.5 up to 30s (max 720p); 2.0 up to 1080p |
| Aliyun Wan | wan3.0-video, wan3.0-video-prime | Unified text/image-to-video, up to 30s |
Configuration
Video generation config is defined in config/aiVideo.ts:
// config/aiVideo.ts
export const aiVideoConfig = {
defaultProvider: 'volcengine' as const, // default video generation provider
defaultModels: {
fal: 'fal-ai/kling-video/v3/pro/text-to-video',
volcengine: 'doubao-seedance-2-5-260628',
aliyun: 'wan3.0-video',
},
availableModels: {
fal: [
'fal-ai/kling-video/v3/pro/text-to-video',
'fal-ai/kling-video/v3/pro/image-to-video',
'fal-ai/veo3.1',
'fal-ai/veo3.1/image-to-video',
],
volcengine: ['doubao-seedance-2-5-260628', 'doubao-seedance-2-0-260128'],
aliyun: ['wan3.0-video', 'wan3.0-video-prime'],
},
defaults: {
duration: 5, // default duration; users can change it in the UI
promptExtend: true,
watermark: false,
},
}Durations and resolutions are filtered by provider + model and exposed to all three front-end apps via getVideoDurationsForProvider() / getVideoSizesForProvider(). Users can pick what they want — nothing is locked down.
Duration and Resolution
| Model | Duration | Resolution |
|---|---|---|
| Seedance 2.5 | 5 / 10 / 15 / 30 s | Up to 720P |
| Seedance 2.0 | 5 / 10 / 15 s | 720P / 1080P |
| Kling 3.0 Pro | 5 / 10 / 15 s | Multiple aspect ratios |
| Veo 3.1 | 4 / 6 / 8 s | 16:9 and 9:16 only |
| Wan 3.0 | 5 / 10 / 15 / 30 s | 720P / 1080P |
The default duration is 5 seconds. Volcengine billing scales with duration and resolution, so keep the default at 5s + 720P to avoid someone accidentally picking 30 seconds.
Environment Variables
Add provider keys in .env:
# Volcengine
VOLCENGINE_API_KEY="your-volcengine-api-key"
# Aliyun
ALIYUN_ACCESS_KEY_ID="your-aliyun-access-key-id"
ALIYUN_ACCESS_KEY_SECRET="your-aliyun-access-key-secret"
# Fal.ai
FAL_API_KEY="your-fal-api-key"Credits Configuration
AI video generation usually costs more credits than image generation. You can price per model in config/credits.ts:
// config/credits.ts
export const creditsConfig = {
fixedConsumption: {
// AI video generation - priced per model
aiVideo: {
default: 30,
models: {
'fal-ai/kling-video/v3/pro/text-to-video': 35,
'fal-ai/kling-video/v3/pro/image-to-video': 35,
'doubao-seedance-2-5-260628': 40,
'doubao-seedance-2-0-260128': 35,
'wan3.0-video': 25,
'wan3.0-video-prime': 35,
},
},
},
}This is a fixed charge for end users: the same model costs the same whether it runs 5 or 30 seconds. Volcengine Ark bills differently — see the next section.
Volcengine Seedance Billing
The Seedance API is billed by tokens on the Volcengine side — a separate ledger from TinyShip credits. The token count roughly depends on output duration, resolution, frame rate, and whether a reference video is included; use the task's returned usage.completion_tokens as the source of truth.
2.5 costs about 50% more per token than 2.0:
| Input without video | Input with video | |
|---|---|---|
| Seedance 2.5 | ¥70 / million tokens | ¥42 / million tokens |
| Seedance 2.0 | ~¥46 / million tokens | ~¥28 / million tokens |
Typical prices for 2.5 pure text-to-video (no reference video):
| Resolution | 5 s | Per second | 30 s (estimated) |
|---|---|---|---|
| 480P | ~¥3.36 | ~¥0.67 | ~¥20 |
| 720P | ~¥7.56 | ~¥1.51 | ~¥45 |
Image-to-video (first frame only) usually still falls into the "input without video" tier. Only inputs with a reference video get the cheaper token rate, but the input duration counts toward tokens.
The 2.5 page currently only exposes 720P; the adapter can already map 854x480, so you can add 480P to volcengineSizes720 if you want to stress-test costs.
Official pricing: Volcengine Ark model pricing
Local Testing Tips
Don't use the default 2.5 + long durations when you just want to verify "can it produce a video".
| Goal | Recommendation | Approx. Volcengine cost |
|---|---|---|
| Just verify Seedance works | 2.0 + 720P + 5 s, pure text-to-video | ~¥5 |
| Must see 2.5 quality | 2.5 + 720P + 5 s | ~¥7.5 |
| Only test pages / polling / credits | Wan 3.0 Prime | Usually cheaper than Seedance |
| Avoid | 2.5 at 15s/30s, 2.0 at 1080P | Tens of yuan |
Fal / Veo run on overseas nodes. When testing in China, the dev server (Node) doesn't use the browser proxy — you need TUN mode or set HTTPS_PROXY for the process, otherwise requests will be slow or time out. Qwen and Volcengine use domestic routes and usually don't need this.
Related docs: