Multi Image Kontext Pro

Transform text into stunning, professional-grade images with precise editing capabilities.


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 27 28 29 import requests api_key = "YOUR_API_KEY" url = "https://api.segmind.com/v1/multi-image-kontext-pro" # Prepare data and files data = {} files = {} data['seed'] = None data['prompt'] = "A woman is taking a selfie with the man in front of the Taj Mahal." 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/80b5e919-9150-43eb-a07c-b56f73ea3dcb-image_31.png' # 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/9c4b025f-dad6-4dae-88ab-d01765f0c2b8-man2.png' # To send a URI 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: 1 )

Set a random seed for reproducibility. leave blank for random outcomes.


promptstr *

Describe how to transform images.


aspect_ratioenum:str ( default: match_input_image )

Choose the output aspect ratio. '16:9' for widescreen or '1:1' for square images.

Allowed values:


input_image_1str *

Provide the first image URL.


input_image_2str *

Provide the second image URL.


output_formatenum:str ( default: png )

Select the output file format. Use 'png' for high quality or 'jpg' for smaller file size.

Allowed values:


safety_toleranceint ( default: 2 )

Adjust safety levels: '0' for strict filtering, '2' for more lenient results.

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.

Resources to get you started

Everything you need to know to get the most out of Multi Image Kontext Pro

# Guide to Using FLUX.1 Kontext Pro Effectively

FLUX.1 Kontext Pro is a powerful text-guided image editing model that automates complex visual transformations via REST API. This guide covers essential parameters, best practices, and tailored recommendations for common workflows.

## Getting Started
1. **API Call Structure**  
   • POST `/edit` with JSON body:  
     ```json
     {
       "prompt": "Merge the images to create a dreamy sunset scene",
       "input_image_1": "https://example.com/img1.png",
       "input_image_2": "https://example.com/img2.png",
       "aspect_ratio": "16:9",
       "seed": 42,
       "output_format": "png",
       "safety_tolerance": 1
     }
  1. Required Fields
    • prompt (str): Natural-language description.
    • input_image_1, input_image_2 (URLs): High-resolution JPEG, PNG, GIF, or WEBP.

Key Parameters

  • aspect_ratio (advanced):
    match_input_image for minimal cropping
    • Common presets: 1:1, 16:9, 4:3
  • seed (advanced):
    • Fixed integer (e.g., 1234) for reproducibility
    • Omit for randomized variations
  • output_format (advanced):
    png for maximum fidelity
    jpg for smaller file size
  • safety_tolerance (advanced):
    0 = strict filtering
    1 = balanced
    2 = lenient, creative freedom

Use Case Recommendations

  1. Automated Marketing Visuals

    • aspect_ratio: 16:9 (banners) or 1:1 (social)
    • output_format: jpg for faster load times
    • seed: omit for diverse A/B testing
    • safety_tolerance: 1 to block unwanted content
  2. E-Commerce Product Mockups

    • aspect_ratio: 4:3 or match_input_image
    • output_format: png for transparency and crisp detail
    • seed: fixed (e.g., 1234) for consistent catalog styling
    • safety_tolerance: 0 to enforce brand-safe imagery
  3. Creative Prototyping

    • aspect_ratio: match_input_image or unconventional 9:16 vertical
    • output_format: png
    • seed: random (omit) to explore variations
    • safety_tolerance: 2 for unrestricted creativity
  4. App & Web Integration

    • aspect_ratio: adapt to UI slots (1:1 for avatars, 21:9 for headers)
    • output_format: jpg if bandwidth-sensitive
    • seed: dynamic (variable per session)
    • safety_tolerance: 1 to balance safety and flexibility

Best Practices

  • Be descriptive in your prompt: mention styles, colors, objects, and moods.
  • Use high-resolution inputs (≥1024×1024 px) to maintain crisp composites.
  • Iterate: preview results, tweak parameters, and refine prompts.
  • Lock the seed when you need exact reproducibility across runs.
  • Start with safety_tolerance=1 and adjust based on your content guidelines.

By following this guide, you’ll unlock FLUX.1 Kontext Pro’s full potential—delivering fast, reliable, and high-quality image edits for any application.

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.