flux-pro-1.1
Flux Pro 1.1 is a cutting-edge image generation tool offering exceptional speed, quality, and customization. Ideal for digital artists, designers, and content creators.
1import requests
2import json
3
4url = "https://api.segmind.com/v1/flux-1.1-pro"
5headers = {
6 "x-api-key": "YOUR_API_KEY",
7 "Content-Type": "application/json"
8}
9
10data = {
11 "seed": 12345,
12 "width": 1024,
13 "height": 1024,
14 "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.",
15 "aspect_ratio": "1:1",
16 "output_format": "png",
17 "output_quality": 80,
18 "safety_tolerance": 2,
19 "prompt_upsampling": false
20}
21
22response = requests.post(url, headers=headers, json=data)
23
24if response.status_code == 200:
25 result = response.json()
26 print(json.dumps(result, indent=2))
27else:
28 print(f"Error: {response.status_code}")
29 print(response.text) 1import requests
2import json
3
4url = "https://api.segmind.com/v1/flux-1.1-pro"
5headers = {
6 "x-api-key": "YOUR_API_KEY",
7 "Content-Type": "application/json"
8}
9
10data = {
11 "seed": 12345,
12 "width": 1024,
13 "height": 1024,
14 "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.",
15 "aspect_ratio": "1:1",
16 "output_format": "png",
17 "output_quality": 80,
18 "safety_tolerance": 2,
19 "prompt_upsampling": false
20}
21
22response = requests.post(url, headers=headers, json=data)
23
24if response.status_code == 200:
25 result = response.json()
26 print(json.dumps(result, indent=2))
27else:
28 print(f"Error: {response.status_code}")
29 print(response.text)API Endpoint
https://api.segmind.com/v1/flux-1.1-proParameters
promptrequiredstringText prompt for image generation
"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_ratiooptionalstringAn enumeration.
"1:1""custom""1:1""16:9""2:3""3:2""4:5""5:4""9:16""3:4""4:3"heightoptionalintegerHeight 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.
1024Range: 256 - 1440image_promptoptionalstring (uri)Provide the URL of the image to be relit. Use a URL from cloud storage like S3.
output_formatoptionalstringAn enumeration.
"webp""webp""jpg""png"output_qualityoptionalintegerQuality when saving the output images, from 0 to 100. 100 is best quality, 0 is lowest quality. Not relevant for .png outputs
80Range: 0 - 100prompt_upsamplingoptionalbooleanAutomatically modify the prompt for more creative generation
falsesafety_toleranceoptionalintegerSafety tolerance, 1 is most strict and 5 is most permissive
2Range: 1 - 5seedoptionalintegerRandom seed. Set for reproducible generation
nullwidthoptionalintegerWidth 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.
1024Range: 256 - 1440Response Type
Returns: Text/JSON
Common Error Codes
The API returns standard HTTP status codes. Detailed error messages are provided in the response body.
Bad Request
Invalid parameters or request format
Unauthorized
Missing or invalid API key
Forbidden
Insufficient permissions
Not Found
Model or endpoint not found
Insufficient Credits
Not enough credits to process request
Rate Limited
Too many requests
Server Error
Internal server error
Bad Gateway
Service temporarily unavailable
Timeout
Request timed out