ModelsLab/Flux
fluxGenerate 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 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 Name | Parameter | Technical Description |
|---|---|---|
| model_id | model_id | Model to use for generation |
| prompt | prompt | enter prompt to generate an image |
| samples | samples | Number of samples you want to generate. min 1, max 4 |
| negative_prompt | negative_prompt | In negative prompt you enter things that you do not want to see in image |
| width | width | width of the image |
| height | height | height of the image |
| clip_skip | clip_skip | CLIP layers to skip |
| enhance_prompt | enhance_prompt | Enhance prompt add additional prompt at the end of your original prompt. recommended value (false/no) |
| guidance_scale | guidance_scale | How closely to follow the prompt (1-10) |
| safety_checker | safety_checker | A checker for NSFW images. If detected, such images will be replaced by a blank image. Default is "yes" |
| watermark | watermark | No description available |
| base64 | base64 | Get response as a base64 string. Default is no. Options: yes/no |
| seed | seed | Seed for reproducible results |
| num_inference_steps | num_inference_steps | The number of denoising steps. Values range from 1 to 20, and any value above 20 will be capped at 20. |
| safety_checker_type | safety_checker_type | How to modify the image if NSFW content is found. Available options: blur, sensitive_content_text, pixelate, black |
| webhook | webhook | URL to receive a POST API call once image generation is complete. |
| track_id | track_id | Unique ID used in webhook response to identify the request. |