1const axios = require('axios');
2const FormData = require('form-data');
3
4
5const api_key = "YOUR API-KEY";
6const url = "https://api.segmind.com/v1/minimax-ai-director";
7
8const reqBody = {
9 "prompt": "A bear playfully poses for a selfie with a man, who smiles and says, ‘Hi!’ as he looks into the camera, [Pedestal up] sharing a lighthearted moment with his friend.[Zoom out]",
10 "first_frame_image": "https://segmind-resources.s3.amazonaws.com/input/7aaa699e-d5d1-417d-93e3-42e8b0ff0adf-minimax-v2-input.png",
11 "prompt_optimizer": true
12};
13
14(async function() {
15 try {
16 const formData = new FormData();
17
18 // Append regular fields
19 for (const key in reqBody) {
20 if (reqBody.hasOwnProperty(key)) {
21 formData.append(key, reqBody[key]);
22 }
23 }
24
25 // Convert and append images as Base64 if necessary
26
27
28 const response = await axios.post(url, formData, {
29 headers: {
30 'x-api-key': api_key,
31 ...formData.getHeaders()
32 }
33 });
34 console.log(response.data);
35 } catch (error) {
36 console.error('Error:', error.response ? error.response.data : error.message);
37 }
38})();
Text prompt for video generation. Camera movement instructions can be added using square brackets (e.g. [Pan left] or [Zoom in]). You can use up to 3 combined movements per prompt. Supported movements: Truck left/right, Pan left/right, Push in/Pull out, Pedestal up/down, Tilt up/down, Zoom in/out, Shake, Tracking shot, Static shot. For example: [Truck left, Pan right, Zoom in]
First frame image for video generation
Use prompt optimizer
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.
Generate high-definition videos with Minimax video-01-director using specific camera movements. The minimax/video-01-director model supports 720p resolution at 25fps and creates videos up to 5 seconds. Control camera movements using bracketed commands or natural language within the promp
AI Video Generation: Creates videos from text or images.
Cinematic Camera Movements: Allows control over camera movements like pan, tilt, zoom, and tracking.
High Definition: Supports 720p resolution at 25fps.
Camera Movement Control:
Use bracketed commands (e.g., [Pan left, Tilt up]).
Incorporate natural language descriptions within the prompt.
Supported Camera Movements: Includes horizontal, vertical, depth, and special movements.
Horizontal: [Truck left], [Truck right], [Pan left], [Pan right].
Vertical: [Pedestal up], [Pedestal down], [Tilt up], [Tilt down].
Depth: [Push in], [Pull out], [Zoom in], [Zoom out].
Special: [Tracking shot], [Shake], [Static shot].
Preset Shot Combinations: Offers preset combinations for circling, walking, and dynamic shots.
Circling shots: [truck left, pan right, tracking shot] (left circling), [truck right, pan left, tracking shot] (right circling).
Walking shots: [truck left, tracking shot] (left walking), [truck right, tracking shot] (right walking).
Dynamic shots: [push in, pedestal up] (upward tilt), [truck left, pedestal up] (scenic shot), [pan right, zoom in] / [pan left, zoom in] (stage shots), [pedestal down, tilt up] (downward tilt)
Be specific in camera movement descriptions.
Place movement commands at logical points in the prompt.
Combine natural language with bracketed commands for precise control.
Limit combined movements to 3 or fewer.
Start with a clear subject description.
Include camera movements in brackets where they should occur.
Add details about style, mood, or environment.
Consider sequential timing of movements