Video Generation

Generate videos from text prompts or images using the z-ai-web-dev-sdk asynchronous API.

Updated Mar 30, 2026
One-click install
npx skills add https://github.com/tmtgroupbot/lptracker-deploy --skill video-generation-tmtgroupbot
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: Video Generation
Source: https://github.com/tmtgroupbot/lptracker-deploy/tree/main/skills/video-generation
Command: npx skills add https://github.com/tmtgroupbot/lptracker-deploy --skill video-generation-tmtgroupbot

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires z-ai-web-dev-sdk, and includes scripts (resource) components.

What problem does it solve? Building video generation into an application requires handling asynchronous task creation, status polling, and result retrieval, which is error-prone to implement from scratch. This Skill provides ready-to-use patterns for generating videos from text prompts or images with the z-ai-web-dev-sdk. ## Core Features & Use Cases - Text-to-Video and Image-to-Video: Create videos from text descriptions, single images, or start/end keyframe pairs, with base64-encoded image input support. - Asynchronous Task Management: Create generation tasks, poll for status with fixed intervals or exponential backoff, and extract video URLs from results. - CLI and SDK Workflows: Use the z-ai CLI for quick one-off generation or the SDK for batch processing, queue management, Express.js endpoints, and WebSocket status updates. - Use Case: Build a backend endpoint that accepts a product description, generates a 5-second promotional clip at 1920x1080, polls until completion, and returns the hosted video URL to the client. ## Quick Start Ask the AI to generate a 5-second video from the prompt "A cat playing with a ball" using the z-ai video CLI with automatic polling.

Frequently Asked Questions about Video Generation

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I generate a video from a text prompt with z-ai-web-dev-sdk?

Call zai.video.generations.create with a prompt and parameters like quality, size, fps, and duration to receive a task ID. Then poll zai.async.result.query with that task ID until the status becomes SUCCESS and read the video URL from the result.

How to convert an image to video using base64 encoding?

Read the image file, detect its MIME type from the extension, and build a data URI like data:image/png;base64,... passed as the image_url parameter. Base64 input is recommended over URLs for reliability, and the MIME type must match the actual image format.

Can I use z-ai-web-dev-sdk in client-side browser code?

No, the SDK must be used in backend code only and never imported into client-side code. Expose video generation through your own server endpoints such as an Express.js API instead.

Why does my video generation task stay in PROCESSING status?

Video generation is asynchronous and can take minutes depending on duration, resolution, and quality mode. Implement polling with reasonable intervals, increase maxPolls for longer videos, and add timeout logic to avoid infinite loops.

What parameters does the video generation API support?

Supported parameters include prompt, image_url (single or two keyframes), quality (speed or quality), with_audio, size (e.g., 1920x1080), fps (30 or 60), duration (5 or 10 seconds), and model. At least one of prompt or image_url is required.