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/image-01";
const reqBody = {
"prompt": "movie scene violent tsunami hitting the city, dynamic motion, realistic, cinematic, 4k",
"aspect_ratio": "1:1",
"number_of_images": 1,
"prompt_optimizer": 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);
}
})();
Text prompt for generation
Aspect ratio of the ouput image
Allowed values:
Number of images to generate
min : 1,
max : 9
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.
MiniMax Image-01 is a groundbreaking text-to-image generation model that empowers users worldwide to transform their ideas into visually stunning imagery. Built upon MiniMax's expertise in prompt adherence, this accessible tool offers precise prompt control and exceptional visual quality, making professional-grade AI creation available to everyone at an unprecedented value.
Precise Prompt Control - Achieve exceptional prompt-to-image fidelity and logical consistency, allowing you to reliably translate intricate textual descriptions into high-quality visuals with stunning artistic quality.
Advanced Visual Composition - Generate imagery with nuanced lighting, rich environmental details, and complex scene composition, bringing depth and vividness to your conceptual ideas with cinematic precision.
Compelling Characters and Object Authenticity - Render both human subjects with lifelike skin textures and natural expressions and objects with intricate details and rich materials, all with photorealistic precision.
Flexible Creative Options - Create images across all standard aspect ratios (16:9, 4:3, 3:2, 2:3, 3:4, 9:16, and 21:9), with each output maintaining crystal-clear resolution and high pixel density to suit various needs from social media to commercial projects.
Content Creation for Social Media - Generate engaging visuals for social media storytelling with various aspect ratios and high resolution, capturing specific moods and details described in text.
Marketing and Advertising Materials - Produce compelling imagery for marketing campaigns and advertisements, accurately depicting products and scenes based on detailed prompts with photorealistic quality.
Concept Art and Visualization - Quickly visualize ideas and concepts for design projects across industries, from game development to architecture, by translating textual descriptions into detailed visual representations.
Product Design and Prototyping - Generate detailed images of product designs with accurate material properties, aiding in the visualization and iteration process.
Personalized Art and Creative Exploration - Explore creative possibilities and generate unique artwork based on personal textual prompts, bringing imaginative ideas to life.
MiniMax Image-01 offers a powerful yet accessible solution for text-to-image generation, providing precise prompt control and exceptional visual quality. Its cost-effectiveness and versatile features make it an ideal tool for individuals and businesses looking to unleash their creativity and bring their textual ideas to life in stunning visuals.