ModelsLab/Flux Kontext Dev
flux-kontext-devOpen-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 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 Name | Parameter | Technical Description |
|---|---|---|
| Reference Image | init_image | Please upload the reference image you want to edit. |
| Reference Image2 | init_image_2 | Second image is optional. only upload second image when you want to merge 2 image. |
| prompt | prompt | Enter the prompt for what change you wanted to make in the given image |
| Negative Prompt | negative_prompt | Things you do not want in the generated image |
| model_id | model_id | Model to use for generation |
| Steps | num_inference_steps | Steps control how many times the model refines the image. More steps = better quality, Fewer steps = faster results but less detail. |
| strength | strength | How much to follow prompt vs original (1=more prompt, 0.1=minimal change) |
| scheduler | scheduler | Sampling scheduler |
| Guidance | guidance | Guidance (CFG Scale) helps control how closely the image matches your text prompt. Higher values = more accurate to the prompt, 2.5 works best |
| Enhance prompt | enhance_prompt | Enhance prompt will add text pprompt to your original prompt. Default : false |
| base64 | base64 | Get the response as a base64 string. Pass init_image as a base64 string to get a base64 response. Default is "no". |