⚡ NEW: Flux Klein 9B — Faster inference, stunning quality · Try Now
curl --request POST \
--url https://modelslab.com/api/v6/images/img2img \
--header 'Content-Type: application/json' \
--data '
{
"key": "<string>",
"model_id": "flux-kontext-dev",
"prompt": "<string>",
"init_image": "<string>",
"negative_prompt": "<string>",
"init_image_2": "<string>",
"safety_checker": true,
"num_inference_steps": "28",
"strength": "0.5",
"guidance": "2.5",
"enhance_prompt": true,
"width": 512,
"height": 512,
"samples": 1,
"seed": 123,
"base64": false,
"webhook": "<string>",
"track_id": "<string>",
"temp": false
}
'{
"generationTime": 123,
"id": 123,
"output": [
"<string>"
],
"proxy_links": [
"<string>"
],
"meta": {},
"nsfw_content_detected": true
}Create high quality image from text using FLUX Kontext model.
curl --request POST \
--url https://modelslab.com/api/v6/images/img2img \
--header 'Content-Type: application/json' \
--data '
{
"key": "<string>",
"model_id": "flux-kontext-dev",
"prompt": "<string>",
"init_image": "<string>",
"negative_prompt": "<string>",
"init_image_2": "<string>",
"safety_checker": true,
"num_inference_steps": "28",
"strength": "0.5",
"guidance": "2.5",
"enhance_prompt": true,
"width": 512,
"height": 512,
"samples": 1,
"seed": 123,
"base64": false,
"webhook": "<string>",
"track_id": "<string>",
"temp": false
}
'{
"generationTime": 123,
"id": 123,
"output": [
"<string>"
],
"proxy_links": [
"<string>"
],
"meta": {},
"nsfw_content_detected": true
}Documentation Index
Fetch the complete documentation index at: https://docs.modelslab.com/llms.txt
Use this file to discover all available pages before exploring further.

POST request to below endpoint and pass the required parameters as a request body.
--request POST 'https://modelslab.com/api/v6/images/img2img' \
{
"key": "your_api_key",
"init_image": "https://pub-3626123a908346a7a8be8d9295f44e26.r2.dev/livewire-tmp/SwogScBP0DtW8M90EDCMAjTYXdHFW4-metaMjhlNjgxMWE3MjY0NmY5ZmJjYTcyNGFjNWU3NTZlZGQuanBn-.jpg",
"init_image_2": "https://pub-3626123a908346a7a8be8d9295f44e26.r2.dev/livewire-tmp/CGuHsNAUtB4Uif4J0tVTbAlEaICbB7-metaMzg4ZTdmZGRiNmQyZmYxY2JiMzk4ZTZkM2VjZDBmNTEuanBn-.jpg",
"prompt": "a girl from image one holding the can from image two",
"negative_prompt": "(worst quality:2), (low quality:2), (normal quality:2), (jpeg artifacts), (blurry), (duplicate), (morbid), (mutilated), (out of frame), (extra limbs), (bad anatomy), (disfigured), (deformed), (cross-eye), (glitch), (oversaturated), (overexposed), (underexposed), (bad proportions), (bad hands), (bad feet), (cloned face), (long neck), (missing arms), (missing legs), (extra fingers), (fused fingers), (poorly drawn hands), (poorly drawn face), (mutation), (deformed eyes), watermark, text, logo, signature, grainy, tiling, censored, nsfw, ugly, blurry eyes, noisy image, bad lighting, unnatural skin, asymmetry",
"model_id": "flux-kontext-dev",
"num_inference_steps": "28",
"safety_checker": true,
"strength": "0.5",
"guidance": "2.5",
"enhance_prompt": null
}
Your API Key used for request authorization.
The ID of the model. Must be 'flux-kontext-dev' for Flux Kontext model.
A text description of the things you want in the generated image, referencing elements from the input images.
URL of the primary reference image to use as a base for the generation.
Items you don't want in the image. Helps exclude unwanted elements, artifacts, or styles from the generation.
URL of the secondary reference image to incorporate elements from. Optional for single-image workflows.
Whether to run the safety checker
The number of denoising steps. Values typically range from 1 to 50. Can be provided as integer or string.
1 <= x <= 50Controls how much the output image should resemble the input image. 0.0 means identical to input, 1.0 means completely different. Can be provided as number or string.
0 <= x <= 1Scale for classifier-free guidance. Higher values make the model follow the prompt more closely. Can be provided as number or string.
0 <= x <= 20Enhance prompts for better results. Set to null to use model defaults.
The width of the output image in pixels. Maximum value is 1024.
x <= 1024The height of the output image in pixels. Maximum value is 1024.
x <= 1024The number of images to be returned in response. Maximum value is 4.
x <= 4Used to reproduce results. The same seed will generate the same image again. Pass null for a random number.
Get response as a base64 string.
URL to receive a POST API call once image generation is complete.
This ID is returned in the response to the webhook API call and is used to identify the webhook request.
Create a temporary image link valid for 24 hours.
Flux Kontext Image to Image generation response
Status of the image generation.
success Time taken to generate the image in seconds.
Unique identifier for the image generation request.
Array of generated image URLs.
Array of proxy image URLs.
Metadata about the image generation including all parameters used.
Indicates if NSFW content was detected in the generated image.
Was this page helpful?