🎉 New Year Sale: Get 20% OFF on all plans — Use code NEWYEAR2026.

Upgrade now
Flux Kontext Dev thumbnail

ModelsLab/Flux Kontext Dev

flux-kontext-dev
Open-weight 12B parameter multimodal flow transformer enabling precise, iterative image editing with superior character retention, local edits, style transfer, and fast real-time performance.
API PlaygroundAPI Documentation

API Endpoint URL

Base URL for all API requests to this endpoint.

https://modelslab.com/api/v6/images/img2img

API Authentication

Authentication requires a valid API key included in the request. Generate and manage your API keys from your developer dashboard. Include the key in the key parameter for all API requests.

Integration Examples

Production-ready code samples for API integration

{
"init_image": "https://assets.modelslab.com/generations/f0009374-6da5-4612-81f1-4b599090a782",
"init_image_2": "https://assets.modelslab.com/generations/b8bb2cd3-549a-46bb-863d-434f4310b2af",
"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",
"strength": "0.7",
"scheduler": "DPMSolverMultistepScheduler",
"guidance": "2.5",
"enhance_prompt": false,
"base64": "no",
"key": "YOUR_API_KEY"
}

SDKs

Official SDKs

Production-ready SDKs and client libraries for all major programming languages

API Parameters

Technical specifications for API request parameters.

Field NameParameterTechnical Description
Reference Imageinit_imagePlease upload the reference image you want to edit.
Reference Image2init_image_2Second image is optional. only upload second image when you want to merge 2 image.
promptpromptEnter the prompt for what change you wanted to make in the given image
Negative Promptnegative_promptThings you do not want in the generated image
model_idmodel_idModel to use for generation
Stepsnum_inference_stepsSteps control how many times the model refines the image. More steps = better quality, Fewer steps = faster results but less detail.
strengthstrengthHow much to follow prompt vs original (1=more prompt, 0.1=minimal change)
schedulerschedulerSampling scheduler
GuidanceguidanceGuidance (CFG Scale) helps control how closely the image matches your text prompt. Higher values = more accurate to the prompt, 2.5 works best
Enhance promptenhance_promptEnhance prompt will add text pprompt to your original prompt. Default : false
base64base64Get the response as a base64 string. Pass init_image as a base64 string to get a base64 response. Default is "no".