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.
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
Attributes
Set a random seed for consistent results. Useful for generating identical outputs in repeated tasks.
Describe what you want to generate. Suggest vibrant scenes for maximum creativity.
Provide a reference image URL. Use high quality images for best guidance.
Select the image aspect ratio. Common choices are 16:9 for landscapes or 1:1 for portraits.
Allowed values:
Output format for the generated image.
Allowed values:
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
or21:9
- •Portraits & editorial:
1:1
or4: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 Case | Prompt Example | aspect_ratio | seed | input_image |
---|---|---|---|---|
Marketing Banner | “Sleek product mockup on marble surface, soft light” | 16:9 | 42 | (none) |
Editorial Cover | “Bold headline typography over dramatic seascape” | 4:5 | 123 | (none) |
Social Media Story | “Playful pastel illustrations of summer fruits” | 9:16 | 2024 | (none) |
Product Style Swap | “Match this sneaker to a vintage leather texture” | match_input_image | 314 | URL of sneaker.png |
Avant-Garde Art | “Abstract splashes of color with metallic sheen” | 1:1 | random | (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.
sdxl-img2img
SDXL Img2Img is used for text-guided image-to-image translation. This model uses the weights from Stable Diffusion to generate new images from an input image using StableDiffusionImg2ImgPipeline from diffusers

insta-depth
InstantID aims to generate customized images with various poses or styles from only a single reference ID image while ensuring high fidelity

codeformer
CodeFormer is a robust face restoration algorithm for old photos or AI-generated faces.

sd2.1-faceswapper
Take a picture/gif and replace the face in it with a face of your choice. You only need one image of the desired face. No dataset, no training
