# Flux.2 Dev Text to Image > Flux.2 Dev is a high-performance, developer-focused text-to-image generative model designed for experimentation, customization, and advanced creative workflows. ## Overview - **Model ID**: `flux-2-dev` - **Category**: flux - **Provider**: modelslab - **Status**: model_ready - **Screenshot**: `https://assets.modelslab.com/generations/f1873d96-09ac-4321-971f-0a6fb24fe07c.png` ## API Information This model can be used via our HTTP API. See the API documentation and usage examples below. ### Endpoint - **URL**: `https://modelslab.com/api/v6/images/text2img` - **Method**: POST ### Parameters - **`prompt`** (required): - Type: textarea - **`width`** (required): width of the image - Type: number (range: 512-1024) - **`height`** (required): Height of the Image - Type: number (range: 512-1024) - **`samples`** (required): The number of images to be returned in response. Maximum is 4. Required range: x <= 4 - Type: number (range: 1-4) ## Usage Examples ### cURL ```bash curl --request POST \ --url https://modelslab.com/api/v6/images/text2img \ --header "Content-Type: application/json" \ --data '{ "key": "YOUR_API_KEY", "model_id": "flux-2-dev", "prompt": "A hyper-realistic cinematic portrait of a woman standing in warm golden-hour sunlight, soft rim lighting around her hair, shallow depth of field, ultra-sharp facial details, film-grade color tones, Leica 50mm lens look, atmospheric haze, dramatic yet natural expression.", "width": "1024", "height": "1024", "samples": "4" }' ``` ### Python ```python import requests response = requests.post( "https://modelslab.com/api/v6/images/text2img", headers={ "Content-Type": "application/json" }, json={ "key": "YOUR_API_KEY", "model_id": "flux-2-dev", "prompt": "A hyper-realistic cinematic portrait of a woman standing in warm golden-hour sunlight, soft rim lighting around her hair, shallow depth of field, ultra-sharp facial details, film-grade color tones, Leica 50mm lens look, atmospheric haze, dramatic yet natural expression.", "width": "1024", "height": "1024", "samples": "4" } ) print(response.json()) ``` ### JavaScript ```javascript fetch("https://modelslab.com/api/v6/images/text2img", { method: "POST", headers: { "Content-Type": "application/json" }, body: JSON.stringify({ "key": "YOUR_API_KEY", "model_id": "flux-2-dev", "prompt": "A hyper-realistic cinematic portrait of a woman standing in warm golden-hour sunlight, soft rim lighting around her hair, shallow depth of field, ultra-sharp facial details, film-grade color tones, Leica 50mm lens look, atmospheric haze, dramatic yet natural expression.", "width": "1024", "height": "1024", "samples": "4" }) }) .then(response => response.json()) .then(data => console.log(data)); ``` ## Links - [Model Playground](https://modelslab.com/models/flux2-dev-text-to-image/flux-2-dev) - [API Documentation](https://docs.modelslab.com) - [ModelsLab Platform](https://modelslab.com)