1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
import requests
api_key = "YOUR_API_KEY"
url = "https://api.segmind.com/v1/flux-1.1-pro"
# Prepare data and files
data = {}
files = {}
data['seed'] = None
data['width'] = None
data['height'] = None
data['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."
data['aspect_ratio'] = "1:1"
data['output_format'] = "png"
data['output_quality'] = 80
data['safety_tolerance'] = 2
data['prompt_upsampling'] = False
headers = {'x-api-key': api_key}
response = requests.post(url, data=data, files=files, headers=headers)
print(response.content) # The response is the generated image
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.