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

Upgrade now
Flux thumbnail

ModelsLab/Flux

flux
Generate high-resolution, diverse images up to 2 megapixels with a 12 billion parameter flow transformer using advanced flow matching, rotary embeddings, and parallel attention layers for precise prompt adherence and style control.
API PlaygroundAPI Documentation

API Endpoint URL

Base URL for all API requests to this endpoint.

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

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

{
"model_id": "flux",
"prompt": "A minion from despicable me, red skin, Darth Maul like spikes on head, dressed in a dark Sith lord robe, Dark Jedi, (one eye:1.2), angry expression, scowling, (looking at viewer:1.1), holding a red lightsaber, pitch black background only illuminated by red lightsaber, perfect lightsaber, lightsaber pointed at viewer, Highest quality, masterpiece, 4k, concept art",
"samples": "1",
"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",
"width": "768",
"height": "1024",
"clip_skip": "1",
"enhance_prompt": false,
"guidance_scale": "7.5",
"safety_checker": false,
"watermark": "no",
"base64": "no",
"seed": "0",
" num_inference_steps": "20",
"safety_checker_type": null,
"webhook": null,
" track_id": null,
"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
model_idmodel_idModel to use for generation
promptpromptenter prompt to generate an image
samplessamplesNumber of samples you want to generate. min 1, max 4
negative_promptnegative_promptIn negative prompt you enter things that you do not want to see in image
widthwidthwidth of the image
heightheightheight of the image
clip_skipclip_skipCLIP layers to skip
enhance_promptenhance_promptEnhance prompt add additional prompt at the end of your original prompt. recommended value (false/no)
guidance_scaleguidance_scaleHow closely to follow the prompt (1-10)
safety_checkersafety_checkerA checker for NSFW images. If detected, such images will be replaced by a blank image. Default is "yes"
watermarkwatermarkNo description available
base64base64Get response as a base64 string. Default is no. Options: yes/no
seedseedSeed for reproducible results
num_inference_steps num_inference_stepsThe number of denoising steps. Values range from 1 to 20, and any value above 20 will be capped at 20.
safety_checker_typesafety_checker_typeHow to modify the image if NSFW content is found. Available options: blur, sensitive_content_text, pixelate, black
webhookwebhookURL to receive a POST API call once image generation is complete.
track_id track_idUnique ID used in webhook response to identify the request.