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
40
41
42
43
44
const axios = require('axios');
const FormData = require('form-data');
const api_key = "YOUR API-KEY";
const url = "https://api.segmind.com/v1/flux-1.1-pro";
const reqBody = {
"seed": 12345,
"width": 1024,
"height": 1024,
"prompt": "A photo of an astronaut with a mirrored helmet standing in a field of sunflowers. The spacesuit has a NASA logo on it. The astronaut is covered in dirt and has vines wrapped around his body. The sky is dark and cloudy.",
"aspect_ratio": "1:1",
"output_format": "png",
"output_quality": 80,
"safety_tolerance": 2,
"prompt_upsampling": false
};
(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);
}
})();
Random seed. Set for reproducible generation
Width of the generated image in text-to-image mode. Only used when aspect_ratio=custom. Must be a multiple of 16 (if it's not, it will be rounded to nearest multiple of 16). Note: Ignored in img2img and inpainting modes.
min : 256,
max : 1440
Height of the generated image in text-to-image mode. Only used when aspect_ratio=custom. Must be a multiple of 16 (if it's not, it will be rounded to nearest multiple of 16). Note: Ignored in img2img and inpainting modes.
min : 256,
max : 1440
Text prompt for image generation
An enumeration.
Allowed values:
An enumeration.
Allowed values:
Quality when saving the output images, from 0 to 100. 100 is best quality, 0 is lowest quality. Not relevant for .png outputs
min : 0,
max : 100
Safety tolerance, 1 is most strict and 5 is most permissive
min : 1,
max : 5
Automatically modify the prompt for more creative generation
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.
Flux 1.1 Pro by Black Forest Labs is a cutting-edge image generation model engineered to redefine the boundaries of AI-powered creativity. Flux 1.1 Pro delivers exceptional image quality, speed, and customization capabilities, making it an indispensable tool for professionals across various industries.
Unparalleled Efficiency: Experience up to 6x faster image generation with Flux 1.1 Pro's optimized architecture and parallel processing capabilities.
Superior Image Quality: Produce high-resolution images (up to 2k) with exceptional detail and accuracy, thanks to advanced prompt adherence algorithms.
Tailored Customization: Choose from a variety of model configurations to suit your specific needs, including resolution, content moderation, and more.
Seamless Integration: Easily integrate Flux 1.1 Pro into your workflows on Pixeflow, enabling scalable and customizable solutions.
Flux 1.1 Pro has achieved the highest Elo score on the Artificial Analysis image arena leaderboard, demonstrating its superior performance.
Minimal Latency: Benefit from reduced latency for real-time applications and high-demand environments.
Digital Art and Design: Create stunning visuals with ease and efficiency.
Content Creation: Generate engaging and visually appealing content for marketing, social media, and more.
Research and Development: Advance your image processing and AI projects with a powerful tool.