
CogVideoX
by ModelsLabGenerates coherent text-to-video content at 720x480 resolution, 8 FPS, with up to 6-second clips, leveraging diffusion transformers and efficient 3D variational autoencoding for smooth motion and semantic alignment.
cogvideoxInput
Output
CogVideoX
Text Sparks Video
Generate Videos Fast
- Fast EndpointText to VideoCogVideoX model turns prompts into 10-second videos at 16 fps and 768x1360 resolution.
- High FidelityExpert TransformerCogVideoX video generation uses diffusion transformer for coherent motion and text alignment.
- API ReadySimple IntegrationCogVideoX API supports fast text-to-video with diffusers pipeline in one call.
CogVideoX questions
- What is CogVideoX model?
- CogVideoX is an open-source text-to-video diffusion model from THUDM. It generates 10-second videos at 768x1360 resolution and 16 fps. Fast endpoint available via API.
- How does CogVideoX video generation work?
- It uses 3D causal VAE for compression and expert transformer for text-video alignment. Supports text prompts for coherent clips. Cogvideox model excels in motion and fidelity.
- What is cogvideox API for?
- CogVideoX API provides text-to-video endpoint for fast generation. Integrates with diffusers pipeline. Ideal for apps needing quick video output.
- Differences in cogvideox model sizes?
- Cogvideox-2B offers speed on 12 GB VRAM; 5B prioritizes quality on 20 GB VRAM. Both generate 6-10 second clips. Fast version uses optimized pipeline.
- Is CogVideoX alternative to other models?
- CogVideoX provides open weights under Apache 2.0 for 2B variant. Superior text alignment and duration over prior models. CogVideoX API simplifies access.
- Cogvideox video generation limits?
- Standard output is 5-10 seconds at 8-16 fps. Resolutions up to 1360x768. Fast endpoint focuses on text-to-video speed.
Looking for something different?
Models that trade off differently against the one you are viewing
Better quality
Newer flagship models that generally produce stronger results.
Faster Generation
Built for speed when you are iterating on a prompt.

Related Models
Discover similar models you might be interested in
About CogVideoX
Generates coherent text-to-video content at 720x480 resolution, 8 FPS, with up to 6-second clips, leveraging diffusion transformers and efficient 3D variational autoencoding for smooth motion and semantic alignment.
CogVideoX facts
- Provider
- ModelsLab
- Price
- $0.05 per generation
- Added to ModelsLab
- August 31, 2024
- Model ID
- cogvideox
Key Features
- AI video generation from text or image input
- Motion control and camera movement parameters
- Adjustable frame rate and video duration
- High-quality cinematic output up to 1080p
- Native audio generation support
Quick Start
Integrate CogVideoX into your application with a single API call. Get your API key from the pricing page to get started.
import requestsimport jsonurl = "https://modelslab.com/api/v6/video/text2video"headers = {"Content-Type": "application/json"}data = {"model_id": "cogvideox","prompt": "A suited astronaut, with the red dust of Mars clinging to their boots, reaches out to shake hands with an alien being, their skin a shimmering blue, under the pink-tinged sky of the fourth planet. In the background, a sleek silver rocket, a beacon of human ingenuity, stands tall, its engines powered down, as the two representatives of different worlds exchange a historic greeting amidst the desolate beauty of the Martian landscape.","key": "YOUR_API_KEY"}try:response = requests.post(url, headers=headers, json=data)response.raise_for_status() # Raises an HTTPError for bad responses (4XX or 5XX)result = response.json()print("API Response:")print(json.dumps(result, indent=2))except requests.exceptions.HTTPError as http_err:print(f"HTTP error occurred: {http_err} - {response.text}")except Exception as err:print(f"Other error occurred: {err}")
const endpointUrl = 'https://modelslab.com/api/v6/video/text2video';const requestBody = {"model_id": "cogvideox","prompt": "A suited astronaut, with the red dust of Mars clinging to their boots, reaches out to shake hands with an alien being, their skin a shimmering blue, under the pink-tinged sky of the fourth planet. In the background, a sleek silver rocket, a beacon of human ingenuity, stands tall, its engines powered down, as the two representatives of different worlds exchange a historic greeting amidst the desolate beauty of the Martian landscape.","key": "YOUR_API_KEY"};async function makeApiRequest() {try {const response = await fetch(endpointUrl, {method: 'POST',headers: {'Content-Type': 'application/json',},body: JSON.stringify(requestBody)});if (!response.ok) {let errorResult;try {errorResult = await response.json();} catch (e) {errorResult = { error: { message: await response.text() } };}throw new Error(`API Error (${response.status}): ${errorResult.error?.message || response.statusText || 'Unknown error'}`);}const result = await response.json();console.log('API Response:', result);return result;} catch (error) {console.error('Error making API request:', error.message);throw error;}}makeApiRequest();
curl -X POST "https://modelslab.com/api/v6/video/text2video" \-H "Content-Type: application/json" \-d '{"model_id": "cogvideox","prompt": "A suited astronaut, with the red dust of Mars clinging to their boots, reaches out to shake hands with an alien being, their skin a shimmering blue, under the pink-tinged sky of the fourth planet. In the background, a sleek silver rocket, a beacon of human ingenuity, stands tall, its engines powered down, as the two representatives of different worlds exchange a historic greeting amidst the desolate beauty of the Martian landscape.","key": "YOUR_API_KEY"}'
<?php$url = 'https://modelslab.com/api/v6/video/text2video';$headers = ['Content-Type: application/json'];$data = ['model_id' => 'cogvideox','prompt' => 'A suited astronaut, with the red dust of Mars clinging to their boots, reaches out to shake hands with an alien being, their skin a shimmering blue, under the pink-tinged sky of the fourth planet. In the background, a sleek silver rocket, a beacon of human ingenuity, stands tall, its engines powered down, as the two representatives of different worlds exchange a historic greeting amidst the desolate beauty of the Martian landscape.','key' => 'YOUR_API_KEY',];$ch = curl_init();curl_setopt($ch, CURLOPT_URL, $url);curl_setopt($ch, CURLOPT_POST, true);curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($data));curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);curl_setopt($ch, CURLOPT_TIMEOUT, 30);$response = curl_exec($ch);$httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);$curlError = curl_error($ch);if ($curlError) {echo 'Curl error: ' . $curlError;} else {echo "HTTP Status Code: " . $httpCode . "\n";$result = json_decode($response, true);if (json_last_error() !== JSON_ERROR_NONE) {echo "Error decoding JSON: " . json_last_error_msg() . "\n";echo "Raw response: " . $response . "\n";} else {echo "API Response:\n";print_r($result);}}?>
Pricing
CogVideoX API costs $0.05 per generation. Plans start at $21/month, and open-source models are unlimited on the $149/month plan. View pricing plans
Use Cases
- Marketing and promotional video creation
- Social media short-form video content
- Product demos and explainer videos
- Creative storytelling and animation












