Flux Kontext Max

FLUX.1 Kontext [max] transforms textual descriptions into stunning, high-fidelity images with seamless typography integration.


API

If you're looking for an API, you can choose from your desired programming language.

POST
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 import requests api_key = "YOUR_API_KEY" url = "https://api.segmind.com/v1/flux-kontext-max" # Prepare data and files data = {} files = {} data['seed'] = 30699 data['prompt'] = "Make her take a selfie in the streets of Freiburg, it's a lovely day out" # For parameter "input_image", you can send a raw file or a URI: # files['input_image'] = open('IMAGE_PATH', 'rb') # To send a file data['input_image'] = 'https://segmind-resources.s3.amazonaws.com/input/a1adf47e-bfba-45c4-a11f-ae2b732102ad-kontext-max-ip.webp' # To send a URI data['aspect_ratio'] = "16:9" data['output_format'] = "png" data['safety_tolerance'] = 2 headers = {'x-api-key': api_key} # If no files, send as JSON if files: response = requests.post(url, data=data, files=files, headers=headers) else: response = requests.post(url, json=data, headers=headers) print(response.content) # The response is the generated image
RESPONSE
image/jpeg
HTTP Response Codes
200 - OKImage Generated
401 - UnauthorizedUser authentication failed
404 - Not FoundThe requested URL does not exist
405 - Method Not AllowedThe requested HTTP method is not allowed
406 - Not AcceptableNot enough credits
500 - Server ErrorServer had some issue with processing

Attributes


seedint ( default: 123 )

Set a random seed for consistent results. Useful for generating identical outputs in repeated tasks.


promptstr *

Describe what you want to generate. Suggest vibrant scenes for maximum creativity.


input_imagestr ( default: https://segmind-resources.s3.amazonaws.com/input/a1adf47e-bfba-45c4-a11f-ae2b732102ad-kontext-max-ip.webp )

Provide a reference image URL. Use high quality images for best guidance.


aspect_ratioenum:str ( default: 16:9 )

Select the image aspect ratio. Common choices are 16:9 for landscapes or 1:1 for portraits.

Allowed values:


output_formatenum:str ( default: png )

Output format for the generated image.

Allowed values:


safety_toleranceint ( default: 2 )

Safety tolerance, 0 is most strict and 6 is most permissive. 2 is currently the maximum allowed when input images are used.

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.

Resources to get you started

Everything you need to know to get the most out of Flux Kontext Max

# FLUX.1 Kontext [max] – Effective Usage Guide

FLUX.1 Kontext [max] by Black Forest Labs combines transformer and diffusion techniques to deliver high-fidelity image generation and non-destructive editing. Follow these best practices to get the most out of your workflows.

## 1. Craft Clear, Detailed Prompts  
- **Be specific**: “A hyperrealistic portrait of a person wearing futuristic sunglasses at sunset” outperforms “futuristic portrait.”  
- **Use descriptive adjectives**: Color palettes, lighting (e.g. “golden hour”), textures, and composition cues.  
- **Call out style or era**: “In the style of 1980s neon art” or “as a watercolor illustration.”

```json
"prompt": "A luminous 1980s cyberpunk cityscape at night, neon reflections on wet streets"

2. Aspect Ratio Selection

  • Landscapes & banners: 16:9 or 21:9
  • Portraits & editorial: 1:1 or 4:5
  • Mobile & stories: 9:16
  • Match input image: Maintain original dimensions when performing edits.
"aspect_ratio": "16:9"

3. Seed Control for Consistency

  • Reproducible results: Supply a fixed seed (e.g. 123) to regenerate identical outputs.
  • Creative exploration: Randomize the seed (or omit) to discover new variations.
"seed": 98765

4. Leverage Reference Images

  • Style transfers & edits: Provide input_image URL for targeted transformations.
  • High quality: Use clear, high-resolution sources for reliable guidance.
  • Non-destructive editing: Apply filters or typography without altering the original asset.
"input_image": "https://example.com/source-image.png"

5. Parameter Presets for Common Use Cases

Use CasePrompt Exampleaspect_ratioseedinput_image
Marketing Banner“Sleek product mockup on marble surface, soft light”16:942(none)
Editorial Cover“Bold headline typography over dramatic seascape”4:5123(none)
Social Media Story“Playful pastel illustrations of summer fruits”9:162024(none)
Product Style Swap“Match this sneaker to a vintage leather texture”match_input_image314URL of sneaker.png
Avant-Garde Art“Abstract splashes of color with metallic sheen”1:1random(none)

Tips & Tricks

  • Iterate quickly: Adjust one parameter at a time to isolate effects.
  • Combine styles: Layer multiple style cues (e.g. “oil painting meets digital glitch”).
  • Typography integration: Include text in your prompt—Kontext [max] will render it seamlessly.

Unlock the full power of FLUX.1 Kontext [max] by experimenting with advanced settings, exploring artistic styles, and refining your prompts. Happy creating!```

Other Popular Models

Discover other models you might be interested in.

Cookie settings

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.