1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
const axios = require('axios');
const api_key = "YOUR API-KEY";
const url = "https://api.segmind.com/v1/flux-2-pro";
const data = {
"prompt": "Iridescent neon 3D letters in sapphire blue, ultraviolet purple, and laser-green glowing against a futuristic dusk skyline. Set on a rooftop helipad with brushed-steel textures, holographic signage, and soft under-lighting. Shot on Fuji Velvia with a Mamiya RZ67 — crisp contrast, cool-magenta twilight tones, and a cinematic cyber-noir atmosphere. Subtle chromatic aberration, gentle bokeh from distant city lights, and a faint blue lens flare sweeping across the frame. Sleek air-drones drift in the background above a neon-lined metropolis, while the glossy letters in the foreground spell out “Try FLUX.2 Pro on Segmind!”",
"seed": 42,
"width": 1024,
"height": 1024,
"safety_tolerance": 3,
"output_format": "png"
};
(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 guides image creation. Use descriptive phrases for detailed images.
Provide URLs for reference images. Ensure URLs are valid and image quality is high.
Seed allows image reproducibility. Use specific numbers for consistency, random for variety.
Set image width. Use larger sizes for detail, smaller for quick generation.
Set image height. Adjust based on aspect ratio needs or desired output dimension.
Adjust safety levels for moderation. Higher values for stricter checking.
min : 0,
max : 6
Choose image format. Use 'jpeg' for quality, 'png' for transparency.
Allowed values:
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.
Edited by Segmind Team on November 27, 2025.
FLUX.2 Pro, developed by Black Forest Labs, is a high-performance image generation model designed for precise and consistent photorealistic creation and editing. It is a significant improvement over basic text-to-image models as FLUX.2 Pro focuses on multi-reference image generation to preserve character identity, object details, and stylistic uniformity across extensive visual sets using reference inputs. While offering unmatched control like never before, the model delivers outputs of up to 4MP resolution, achieving remarkable accuracy in spatial structure, lighting dynamics, and perspective alignment.
Marketing & Branding: It can be used to create consistent campaign visuals across multiple channels while maintaining exact brand colors and typography.
Product Visualization: It generates marketing assets showing products in various contexts without expensive photoshoots.
E-commerce: It is ideal for producing consistent product imagery with different backgrounds, angles, and lifestyle settings.
Content Production: It can maintain character consistency across storyboards, concept art, and creative pitches.
Design Workflows: It is perfect for rapid iterations of visual concepts while preserving key elements and brand identity.
Writing Effective Prompts: Use clear, descriptive language that specifies desired details, including lighting conditions, composition, mood, and technical aspects like "shallow depth of field" or "golden hour lighting."
Reference Image Quality: Provide high-resolution reference images via image_urls for best results as the model extracts key visual elements to maintain consistency.
Resolution Settings: Adjust width and height based on your project requirements, such as '1024×1024' for social media, higher dimensions (up to 4MP) for print and professional use.
Seed Control: Use the seed parameter for reproducibility; the same seed with the same inputs produces consistent results, which is essential for iterative refinement.
Safety Settings: Adjust safety_tolerance (0-6) based on content requirements; higher values enforce stricter content moderation.
Is FLUX.2 Pro open-source?
FLUX.2 Pro is a proprietary model from Black Forest Labs and is available via API rather than open source distribution.
How does FLUX.2 Pro differ from FLUX.1 and other models?
FLUX.2 Pro offers superior multi-reference consistency, higher resolution output (4MP), and specialized capabilities for maintaining character identity and brand elements across multiple generations, making it far better than FLUX.1.
What's the best resolution for my use case?
Use '1024×1024' for web and social content; '2048×2048' for detailed marketing materials, and a maximum of '4MP' dimensions for print and professional production.
Can I control output reproducibility?
Yes, you will have a great level of control over the output; set a specific seed value to generate identical outputs with the same prompt and reference images, perfect for iterative refinement workflows.
What reference image formats work best?
Provide high-quality images in standard formats (JPEG, PNG) via direct URLs; higher-quality images will yield more consistent outputs.
How do I maintain brand consistency across generations?
To achieve reproducible results aligned with brand guidelines, combine detailed prompts specifying brand colors, reference images showing brand elements, and consistent seed values.