Video Generation
БесплатноЗапускает вложенные скриптыНе проверенImplement AI-powered video generation capabilities using the z-ai-web-dev-sdk. Use this skill when the user needs to generate videos from text prompts or…
от AnswerZhao★ 26 звёзд на GitHubОб этом скилле
Video Generation Skill
This skill guides the implementation of video generation functionality using the z-ai-web-dev-sdk package, enabling AI models to create videos from text descriptions or images through asynchronous task processing.
Skills Path
Skill Location: {project_path}/skills/video-generation
This skill is located at the above path in your project.
Reference Scripts: Example test scripts are available in the {Skill Location}/scripts/ directory for quick testing and reference. See {Skill Location}/scripts/video.ts for a working example.
Overview
Video Generation allows you to build applications that can create video content from text prompts or images, with customizable parameters like resolution, frame rate, duration, and quality settings. The API uses an asynchronous task model where you create a task and poll for results.
IMPORTANT: z-ai-web-dev-sdk MUST be used in backend code only. Never use it in client-side code.
Prerequisites
The z-ai-web-dev-sdk package is already installed. Import it as shown in the examples below.
CLI Usage (For Simple Tasks)
For simple video generation tasks, you can use the z-ai CLI instead of writing code. The CLI handles task creation and polling automatically, making it ideal for quick tests and simple automation.
Basic Text-to-Video
# Generate video with automatic polling
z-ai video --prompt "A cat playing with a ball" --poll
# Using short options
z-ai video -p "Beautiful landscape with mountains" --poll
Custom Quality and Settings
# Quality mode (speed or quality)
z-ai video -p "Ocean waves at sunset" --quality quality --poll
# Custom resolution and FPS
z-ai video \
-p "City timelapse" \
--size "1920x1080" \
--fps 60 \
--poll
# Custom duration (5 or 10 seconds)
z-ai video -p "Fireworks display" --duration 10 --poll
Image-to-Video
# Generate video from single image
z-ai video \
--image-url "https://example.com/image.png" \
--prompt "Make the scene come alive" \
--poll
# Using short option
z-ai video \
-i "https://example.com/photo.jpg" \
-p "Add motion to this scene" \
--poll
First-Last Frame Mode
# Generate video between two frames
z-ai video \
--image-url "https://example.com/start.png,https://example.com/end.png" \
--prompt "Smooth transition between frames" \
--poll
With Audio Generation
# Generate video with AI-generated audio effects
z-ai video \
-p "Thunder storm approaching" \
--with-audio \
--poll
Save Output
# Save task result to JSON file
z-ai video \
-p "Sunrise over mountains" \
--poll \
-o video_result.json
Custom Polling Parameters
# Customize polling behavior
z-ai video \
-p "Dancing robot" \
--poll \
--poll-interval 10 \
--max-polls 30
# Create task without polling (get task ID)
z-ai video -p "Abstract art animation" -o task.json
CLI Parameters
--prompt, -p <text>: Optional - Text description of the video--image-url, -i <URL>: Optional - Image URL (single or comma-separated pair)--quality, -q <mode>: Optional - Output mode:speedorquality(default: speed)--with-audio: Optional - Generate AI audio effects (default: false)--size, -s <resolution>: Optional - Video resolution (e.g., "1920x1080")--fps <rate>: Optional - Frame rate: 30 or 60 (default: 30)--duration, -d <seconds>: Optional - Duration: 5 or 10 seconds (default: 5)--model, -m <model>: Optional - Model name to use--poll: Optional - Auto-poll until task completes--poll-interval <seconds>: Optional - Polling interval (default: 5)--max-polls <count>: Optional - Maximum poll attempts (default: 60)--output, -o <path>: Optional - Output file path (JSON format)
Supported Resolutions
1024x1024768x1344864x11521344x7681152x8641440x720720x14401920x1080(and other standard resolutions)
Checking Task Status Later
If you create a task without --poll, you can check its status later:
# Get the task ID from the initial response
z-ai async-result --id "task-id-here" --poll
When to Use CLI vs SDK
Use CLI for:
- Quick video generation tests
- Simple one-off video creation
- Command-line automation scripts
- Testing different prompts and settings
Use SDK for:
- Batch video generation with custom logic
- Integration with web applications
- Custom task queue management
- Production applications with complex workflows
Video Generation Workflow
Video generation follows a two-step asynchronous pattern:
- Create Task: Submit video generation request and receive a task ID
- Poll Results: Query the task status until completion and retrieve the video URL
Basic Video Generation Implementation
Simple Text-to-Video Generation
import ZAI from 'z-ai-web-dev-sdk';
async function generateVideo(prompt) {
try {
const
Установить Video Generation в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
Вложенные файлы
FAQ
Что делает скилл Video Generation?
Implement AI-powered video generation capabilities using the z-ai-web-dev-sdk. Use this skill when the user needs to generate videos from text prompts or images, create video content programmatically, or build applications that produce video outputs. Supports asynchronous task management with status polling and result retrieval.
Как установить скилл Video Generation?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл Video Generation запускает скрипты?
Да, скилл несёт исполняемые скрипты. Проверь исходник перед установкой.
Похожие скиллы
doc-coauthoring
Guide users through a structured workflow for co-authoring documentation. Use when user wants to write documentation, proposals, technical specs, decision…
от Anthropicacademy-guide
Stop and check this skill before finishing any reply to a question about how to use Claude or a Claude product — it recommends matching courses, tutorials…
от Anthropicinternal-comms
A set of resources to help me write all kinds of internal communications, using the formats that my company likes to use. Claude should use this skill…
от Anthropicskill-development
This skill should be used when the user wants to "create a skill", "add a skill to plugin", "write a new skill", "improve skill description", "organize skill…
от Anthropic