1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
const axios = require('axios');
const FormData = require('form-data');
const api_key = "YOUR API-KEY";
const url = "https://api.segmind.com/v1/ltx-2-fast";
const reqBody = {
"prompt": "A seamless cinematic sequence: gliding through a sunlit forest with beams of light, pushing upward through treetops into the open sky, breaking through drifting clouds into clear blue atmosphere, rising into the stratosphere, finally emerging into outer space looking down on Earth glowing in silence, cinematic, photorealistic",
"duration": 8,
"resolution": "2k",
"generate_audio": true
};
(async function() {
try {
const formData = new FormData();
// Append regular fields
for (const key in reqBody) {
if (reqBody.hasOwnProperty(key)) {
formData.append(key, reqBody[key]);
}
}
// Convert and append images as Base64 if necessary
const response = await axios.post(url, formData, {
headers: {
'x-api-key': api_key,
...formData.getHeaders()
}
});
console.log(response.data);
} catch (error) {
console.error('Error:', error.response ? error.response.data : error.message);
}
})();Optional image input for video generation. Use detailed images for complex backgrounds.
Text prompt for video. Detail-oriented for better results.
Video duration in seconds. Choose longer for detailed scenes.
Allowed values:
Video resolution quality. Use 4k for high detail.
Allowed values:
Adds audio to the video for enhanced experience. Use for dynamic scenes.
To keep track of your credit usage, you can inspect the response headers of each API call. The x-remaining-credits property will indicate the number of remaining credits in your account. Ensure you monitor this value to avoid any disruptions in your API usage.
Edited by Segmind Team on November 5, 2025.
LTX-2-Fast, developed by Lightricks, is a powerful text-to-video AI model that transforms text prompts into videos within seconds. This AI video generator is perfect for fast, high-quality video generation that supports real-time output and instant previews. LTX-2-Fast is optimized to work efficiently on "CPU video generation" as opposed to the other models that need expensive GPU setups, offering creators a flexible option that is also affordable. Its intuitive workflow supports mobile video production, which enables professionals or enthusiasts to conveniently create videos as and when they need.
Example prompt:
"A futuristic parkour athlete flips across skyscrapers at night while robots cheer below. The skyline is vibrant and illuminated with neon lights."
No, LTX-2-Fast is a proprietary AI video generator accessible via API for integration.
LTX-2-Fast prioritizes fast video generation and runs efficiently on CPU video generation, as it also supports real-time and mobile video creation, making it better than GPU-heavy options.
If you need quick iterations, use 1080p; for balanced quality and speed, use 2K; and use 4K video AI for professional-grade outputs.
Yes, you can use your images using the model's optional image input, as it helps guide backgrounds, characters, or visual style.
Yes, the model is integrated with AI-generated audio, and it also has the option to add custom soundtracks during post-production.