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.

~14.08s
$0.05 per generation
 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

POSThttps://api.segmind.com/v1/flux-1.1-pro

Parameters

promptrequired
string

Text prompt for image generation

Default: "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_ratiooptional
string

An enumeration.

Default: "1:1"
Allowed values :
"custom""1:1""16:9""2:3""3:2""4:5""5:4""9:16""3:4""4:3"
heightoptional
integer

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.

Default: 1024Range: 256 - 1440
image_promptoptional
string (uri)

Provide the URL of the image to be relit. Use a URL from cloud storage like S3.

output_formatoptional
string

An enumeration.

Default: "webp"
Allowed values :
"webp""jpg""png"
output_qualityoptional
integer

Quality when saving the output images, from 0 to 100. 100 is best quality, 0 is lowest quality. Not relevant for .png outputs

Default: 80Range: 0 - 100
prompt_upsamplingoptional
boolean

Automatically modify the prompt for more creative generation

Default: false
safety_toleranceoptional
integer

Safety tolerance, 1 is most strict and 5 is most permissive

Default: 2Range: 1 - 5
seedoptional
integer

Random seed. Set for reproducible generation

Default: null
widthoptional
integer

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.

Default: 1024Range: 256 - 1440

Response Type

Returns: Text/JSON

Common Error Codes

The API returns standard HTTP status codes. Detailed error messages are provided in the response body.

400

Bad Request

Invalid parameters or request format

401

Unauthorized

Missing or invalid API key

403

Forbidden

Insufficient permissions

404

Not Found

Model or endpoint not found

406

Insufficient Credits

Not enough credits to process request

429

Rate Limited

Too many requests

500

Server Error

Internal server error

502

Bad Gateway

Service temporarily unavailable

504

Timeout

Request timed out

We value your privacy

We use cookies to enhance your browsing experience, analyze site traffic, and personalize content. By clicking "Accept all", you consent to our use of cookies. Learn more