Make sure you add your s3 details for flux server, so you can receive image generated in your bucket. Images generated without s3 details being added will be delete after 24hours

Request

Make a POST request to below endpoint and pass the required parameters as a request body to the endpoint.
curl
--request POST 'https://modelslab.com/api/v1/enterprise/flux_kontext_dev/img2img' \

Body

json
{
    
    "key": "enterprise_api_key",
    "prompt": "The girl from image one holding the can from image two.",
    "negative_prompt": "bad quality",
    "init_image": "https://assets.modelslab.com/generations/4a89e381-cdd0-46fc-b13e-00d8824d8171",
    "init_image_2":"https://assets.modelslab.com/generations/85b9944d-74c5-46b2-9be5-ec7a5e212789",
    "width": "512",
    "height": "512",
    "samples": "1",
    "temp": false,
    "safety_checker": false,
    "strength":0.7,
    "seed": null,
    "webhook": null,
    "track_id": null
}

Body Attributes

key
string
required
Your API Key used for request authorization.
prompt
string
required
Text prompt with description of the things you want in the image to be generated.
negative_prompt
string
Items you don’t want in the image.
init_image
string
Upload the reference image you want to edit.
init_image_2
string
Second image is optional. only upload second image when you want to merge 2 image.
width
number
Max Width: 1024px
height
number
Max Height: 1024px
samples
number
Number of images to be returned in response. The maximum value is 4.
safety_checker
boolean
A checker for NSFW images. If such an image is detected, it will be replaced by a blank image.
base64
boolean
default:"false"
Get response as base64 string, default: false, options: true or false.
strength
number
Prompt strength when using init image. 1.0 corresponds to full destruction of information in the init image.
instant_response
boolean
default:"false"
Queue response instantly before processing finishes instead of waiting a minimum amount of time default: false, options: true or false.
seed
number
Seed is used to reproduce results, same seed will give you same image in return again. Pass null for a random number.
webhook
string
Set an URL to get a POST API call once the image generation is complete.
track_id
string
This ID is returned in the response to the webhook API call. This will be used to identify the webhook request.