POST
javascript
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 30 31 32 33 34 35 36 37 38 39 const axios = require('axios'); const FormData = require('form-data'); const api_key = "YOUR API-KEY"; const url = "https://api.segmind.com/v1/flux-kontext-max"; const reqBody = { "seed": 30699, "prompt": "Make her take a selfie in the streets of Freiburg, it's a lovely day out", "input_image": "https://segmind-resources.s3.amazonaws.com/input/a1adf47e-bfba-45c4-a11f-ae2b732102ad-kontext-max-ip.webp", "aspect_ratio": "16:9" }; (async function() { try { const formData = new FormData(); // Append regular fields for (const key in reqBody) { if (reqBody.hasOwnProperty(key)) { formData.append(key, reqBody[key]); } } // Convert and append images as Base64 if necessary const response = await axios.post(url, formData, { headers: { 'x-api-key': api_key, ...formData.getHeaders() } }); console.log(response.data); } catch (error) { console.error('Error:', error.response ? error.response.data : error.message); } })();
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:

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.

Discovering the Potential of FLUX.1 Kontext [max] by Black Forest Labs

FLUX.1 Kontext [max] is an advanced image editing and generation model from Black Forest Labs, engineered to deliver exceptional results in text-to-image manipulation through innovative features and high-fidelity output. It provides developers, creators, and executives with precise and efficient tools to execute complex image transformations and aesthetically rich designs.

For developers, this model offers superior prompt precision, eliminating the need for extensive tuning or specialized prompt engineering. You can embed detailed prompts in your image generation tasks, relying on Kontext [max]'s nuanced understanding of natural language to reflect your vision accurately. Creators will appreciate its ability to generate and integrate typography within images seamlessly—a pivotal feature for branding and editorial designs. The model also excels in style transfer, accommodating a spectrum of visual styles, from hyperrealistic to avant-garde.

Kontext [max]'s efficient and high-quality image synthesis, powered by a cutting-edge multimodal transformer-diffusion architecture, generates photorealistic images swiftly, making it an asset in various creative and commercial applications. Executives can capitalize on its capability to transform existing visuals or generate new scenes entirely, highlighting competitive advantages and potential business impact.

To maximize this model's potential, users should craft clear, detailed prompts and leverage its typography and non-destructive editing capabilities. Experiment with artistic styles and provide reference images to guide transformations. FLUX.1 Kontext [max] is a versatile tool for unlocking new creative avenues in visual storytelling and branding.