Create Stunning Videos with MiniMax Video-01 Cognitive Actions

In the world of digital content creation, the ability to generate high-quality videos quickly and efficiently is invaluable. The MiniMax Video-01 Cognitive Actions enable developers to create captivating six-second videos using descriptive text prompts or images. This powerful tool utilizes advanced video generation capabilities, including cinematic camera movement, to produce content at 720p resolution and 25 frames per second (fps). By integrating these pre-built actions into your applications, you can enhance user engagement and creativity.
Prerequisites
Before diving into the integration of MiniMax Video-01 Cognitive Actions, ensure you have the following:
- An API key for accessing the Cognitive Actions platform.
- A basic understanding of JSON and how to structure API requests.
- Familiarity with making HTTP requests in your preferred programming language.
Typically, authentication involves passing the API key in the request headers, allowing secure access to the Cognitive Actions.
Cognitive Actions Overview
Generate Video with Prompts or Images
Description: This action enables you to create high-definition six-second videos by providing either text prompts or images. It features cinematic camera movements and supports diverse styles, making it an excellent choice for creative projects.
- Category: Video Generation
Input
The input for this action requires a JSON object that includes the following fields:
- prompt (required): A descriptive text prompt guiding the video generation.
Example:"a woman is walking through a busy Tokyo street at night, she is wearing dark sunglasses" - firstFrameImage (optional): A URI pointing to the first frame image for video generation, influencing the aspect ratio.
- promptOptimizer (optional): A boolean indicating whether to use the prompt optimizer, enhancing prompt processing. Defaults to
true. - subjectReference (optional): A URI to an image for character reference, used as the subject in the generated video.
Example Input:
{
"prompt": "a woman is walking through a busy Tokyo street at night, she is wearing dark sunglasses",
"promptOptimizer": true
}
Output
The action returns a URL pointing to the generated video. Here’s a typical output example:
"https://assets.cognitiveactions.com/invocations/c7aceded-3344-4f5e-8d87-b9b9927efd84/3155aba2-701c-4312-a2e4-dc3e28f0269c.mp4"
Conceptual Usage Example (Python)
Below is a conceptual Python code snippet demonstrating how to call the MiniMax Video-01 Cognitive Action to generate a video:
import requests
import json
# Replace with your Cognitive Actions API key and endpoint
COGNITIVE_ACTIONS_API_KEY = "YOUR_COGNITIVE_ACTIONS_API_KEY"
COGNITIVE_ACTIONS_EXECUTE_URL = "https://api.cognitiveactions.com/actions/execute" # Hypothetical endpoint
action_id = "10b29712-ce5d-4048-98a0-a365b2f4f818" # Action ID for Generate Video with Prompts or Images
# Construct the input payload based on the action's requirements
payload = {
"prompt": "a woman is walking through a busy Tokyo street at night, she is wearing dark sunglasses",
"promptOptimizer": true
}
headers = {
"Authorization": f"Bearer {COGNITIVE_ACTIONS_API_KEY}",
"Content-Type": "application/json"
}
try:
response = requests.post(
COGNITIVE_ACTIONS_EXECUTE_URL,
headers=headers,
json={"action_id": action_id, "inputs": payload} # Hypothetical structure
)
response.raise_for_status() # Raise an exception for bad status codes (4xx or 5xx)
result = response.json()
print("Action executed successfully:")
print(json.dumps(result, indent=2))
except requests.exceptions.RequestException as e:
print(f"Error executing action {action_id}: {e}")
if e.response is not None:
print(f"Response status: {e.response.status_code}")
try:
print(f"Response body: {e.response.json()}")
except json.JSONDecodeError:
print(f"Response body: {e.response.text}")
In this code, ensure you replace YOUR_COGNITIVE_ACTIONS_API_KEY with your actual API key. The payload is structured according to the action's input schema, and the request is sent to the hypothetical Cognitive Actions execution endpoint.
Conclusion
The MiniMax Video-01 Cognitive Actions provide a straightforward and powerful way to generate engaging video content using prompts or images. By leveraging these actions, developers can streamline their content creation processes and enhance user experiences. Consider exploring additional use cases such as marketing videos, social media content, or educational materials to maximize the potential of this innovative technology. Happy coding!