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
27
28
29
import requests
api_key = "YOUR_API_KEY"
url = "https://api.segmind.com/v1/multi-image-kontext-max"
# Prepare data and files
data = {}
files = {}
data['seed'] = 42
data['prompt'] = "put the green dress on the woman while maintaining the pose of the woman as it is"
data['aspect_ratio'] = "1:1"
# For parameter "input_image_1", you can send a raw file or a URI:
# files['input_image_1'] = open('IMAGE_PATH', 'rb') # To send a file
data['input_image_1'] = 'https://segmind-resources.s3.amazonaws.com/output/9cb479d3-5c5f-4d5d-a782-972acbc42598-c1.jpg' # To send a URI
# For parameter "input_image_2", you can send a raw file or a URI:
# files['input_image_2'] = open('IMAGE_PATH', 'rb') # To send a file
data['input_image_2'] = 'https://segmind-resources.s3.amazonaws.com/output/79feee7b-d09f-4bde-bec3-c8e8a8703f04-d2.png' # To send a URI
data['output_format'] = "jpg"
data['safety_tolerance'] = 1
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
Sets seed for reproducibility.
Describes the prompt for image transformation.
Sets output aspect ratio. Use '16:9' for wide images.
Allowed values:
First image for transformation
Second image for transformation.
Sets output forma.
Allowed values:
Controls content safety level. Use 1 for moderate strictness.
min : 0,
max : 2
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 Kontext [max] â Image Generation and Editing Model
What is FLUX.1 Kontext [max]?
FLUX.1 Kontext [max] is an advanced AI image generation and editing model from Black Forest Labs. Using a cutting-edge multimodal transformer-diffusion architecture, it converts rich text prompts and one or more input images into stunning, photorealistic visuals with integrated typography. Developers, creators, and product managers leverage its rapid inference to innovate in branding, editorial design, social media, and beyondâwithout extensive prompt tuning.
Key Features
⢠Multimodal Transformer-Diffusion
â Deep text understanding meets diffusion-based image synthesis for lifelike results.
⢠Dynamic Style Transfer
â Blend textures, colors, and forms from two inputs (input_image_1
, input_image_2
) in a single pass.
⢠Native Typography Integration
â Auto-place and style headlines, captions, and logos within generated imagery.
⢠Robust Prompt Comprehension
â Handles complex instructions (âA futuristic cityscape at dusk with neon typographyâ) out of the box.
⢠Aspect Ratio & Format Control
â Supports common ratios (1:1, 16:9, 9:16, 4:3, 21:9) and output_format
choices (jpg
, png
).
⢠Reproducibility & Safety
â Set a seed
(default 42) for consistent outputs and adjust safety_tolerance
(0â2) to meet compliance needs.
Best Use Cases
- Branding & Logo Creation: Generate cohesive brand assets with on-canvas typography.
- Editorial & Magazine Layouts: Craft high-resolution visuals aligned with article styles.
- Social Media Campaigns: Produce platform-specific formats (e.g., 9:16 for Stories, 1:1 for feeds).
- Creative Prototyping: Rapidly iterate between hyperrealistic, retro, and avant-garde aesthetics.
- Commercial Storytelling: Enhance product mockups, advertisements, and packaging design.
Prompt Tips and Output Quality
⢠Be Descriptive: Include setting, materials, lighting, and perspective.
⢠Specify Typography: Add font style descriptors (âbold serifâ, âneon cursiveâ) for precise text integration.
⢠Use Technical Tags: Combine natural language with tags like #retro or #neon to hint style.
⢠Adjust Aspect Ratio Early: Choose aspect_ratio
to match final medium (print, web, mobile).
⢠Control Reproducibility: Use seed
to lock randomness and regenerate identical outputs.
⢠Match Format to Deliverables: Select jpg
for smaller files or png
when transparency is needed.
FAQs
Q: How do I get the most photorealistic images?
A: Provide detailed prompts with lighting, camera angle, materials, and supply high-quality input images.
Q: Can I merge two source images?
A: Yesâuse input_image_1
and input_image_2
together. The model blends them via style-transfer techniques.
Q: Which aspect ratios are available?
A: From match_input_image to 1:1, 16:9, 9:16, 4:3, 3:2, 21:9, 9:21, and moreâchoose based on your target platform.
Q: How is consistency maintained across runs?
A: Set the integer seed
parameter; identical seeds yield reproducible results.
Q: Do I need lengthy prompt engineering?
A: No. FLUX.1 Kontext [max] excels at interpreting nuanced prompts with minimal iteration.
Other Popular Models
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

fooocus
Fooocus enables high-quality image generation effortlessly, combining the best of Stable Diffusion and Midjourney.

faceswap-v2
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

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