1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
const axios = require('axios');
const api_key = "YOUR API-KEY";
const url = "https://api.segmind.com/v1/cog-video-5b-t2v";
const data = {
"prompt": "A golden retriever, sporting sleek black sunglasses, with its lengthy fur flowing in the breeze, sprints playfully across a rooftop terrace, recently refreshed by a light rain. The scene unfolds from a distance, the dog's energetic bounds growing larger as it approaches the camera, its tail wagging with unrestrained joy, while droplets of water glisten on the concrete behind it. The overcast sky provides a dramatic backdrop, emphasizing the vibrant golden coat of the canine as it dashes towards the viewer.",
"negative_prompt": "low quality, blurry",
"input_frames": 49,
"steps": 45,
"guidance_scale": 6,
"seed": 806286757407563,
"frame_rate": 8
};
(async function() {
try {
const response = await axios.post(url, data, { headers: { 'x-api-key': api_key } });
console.log(response.data);
} catch (error) {
console.error('Error:', error.response.data);
}
})();
Text prompt for generating the video
Text to describe what should be avoided in the generated video
Number of input frames for the video generation
min : 16,
max : 60
Number of steps for generating each frame
min : 25,
max : 50
Scale for guidance during generation
min : 5,
max : 10
Seed for random number generation to ensure reproducibility
Frame rate for the video output
min : 8,
max : 10
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.
Cog Video represents a significant advancement in the field of video generation. This model is designed to convert textual descriptions into high-quality, coherent video sequences, leveraging state-of-the-art deep learning techniques. Cog Video’s architecture is built upon the principles of transformer models, which are known for their efficiency and scalability in handling large datasets and complex tasks.
Text-to-Video Synthesis: Cog Video excels in generating videos from textual inputs, making it a powerful tool for content creators, educators, and entertainment industries.
High-Quality Output: The model produces videos with high resolution and smooth transitions, ensuring a visually appealing output.
Scalability: Built on a robust architecture, Cog Video can handle extensive datasets, making it suitable for large-scale applications.
Versatility: It supports a wide range of video genres and styles, from realistic scenes to animated sequences.
Performance: Demonstrates superior performance in generating coherent and contextually accurate videos from textual descriptions.
Content Creation: Ideal for generating video content for social media, marketing, and educational purposes.
Virtual Reality: Enhances VR experiences by creating immersive video content based on user inputs.
Entertainment: Used in the film and gaming industries to create dynamic and engaging video sequences.
Cog Video sets a new benchmark in the video generation domain, offering unparalleled capabilities and applications. Its innovative approach and robust performance make it a valuable asset for various industries looking to leverage AI for video content creation.