# FLUX.2 [flex] > Black Forest Labs' precision image generation model with maximum control, reliable text rendering, and complete creative control supporting up to 4MP output ## Quick Reference - Model ID: flux.2-flex - Creator: Black Forest Labs - Status: active - Family: flux.2 - Base URL: https://api.lumenfall.ai/openai/v1 ## Specifications - Max Resolution: 2048x2048 - Max Input Images: 10 - Input Modalities: text, image - Output Modalities: image - Supported Modes: Text to Image, Image Edit ## API Parameters The compiled parameter schema for this model is available via the API: `GET /v1/models/flux.2-flex?schema=true`. ### Core Parameters - `prompt` (string) — REQUIRED: Text prompt for image generation. Modes: Text to Image, Image Edit - `seed` (integer): Random seed for reproducibility. Modes: Text to Image, Image Edit ### Size & Layout - `size` (string): Image dimensions as WxH pixels (e.g. "1024x1024") or aspect ratio (e.g. "16:9"). Values: auto, 1365x768, 768x1365, 1254x836, 836x1254, 887x1182, 1024x1024, 1145x916, 916x1145, 1183x887. Modes: Text to Image, Image Edit - `aspect_ratio` (string): Aspect ratio of the output image (e.g. "16:9", "1:1"). Values: auto, 9:16, 2:3, 3:4, 4:5, 1:1, 5:4, 4:3, 3:2, 16:9. Modes: Text to Image, Image Edit - `resolution` (string): Output resolution tier (e.g. "1K", "4K"). Values: auto, 1K. Modes: Text to Image, Image Edit ### Media Inputs - `image` (file) — REQUIRED: Input image(s) to edit. Modes: Image Edit ### Output & Format - `response_format` (string): How to return the image. Default: url. Values: url, b64_json. Modes: Text to Image, Image Edit - `output_format` (string): Output image format. Values: png, jpeg, gif, webp, avif. Modes: Text to Image, Image Edit - `output_compression` (integer): Compression level for lossy formats (JPEG, WebP, AVIF). Modes: Text to Image, Image Edit - `n` (integer): Number of images to generate. Default: 1. Modes: Text to Image, Image Edit ### Additional Parameters - `cfg_scale` (number): Classifier-free guidance scale — higher values stick more closely to the prompt. Modes: Text to Image, Image Edit - `enable_safety_checker` (boolean): Whether to enable the safety checker.. Modes: Text to Image, Image Edit. Only available via fal - `height` (integer): Height of the generated image. Only used when aspect_ratio=custom. Must be a multiple of 16 (if it's not, it will be rounded to nearest multiple of 16).. Modes: Text to Image, Image Edit. Only available via replicate - `num_inference_steps` (integer): The number of inference steps to perform.. Modes: Text to Image, Image Edit. Only available via fal - `output_quality` (integer): Quality when saving the output images, from 0 to 100. 100 is best quality, 0 is lowest quality. Not relevant for .png outputs. Modes: Text to Image, Image Edit. Only available via replicate - `prompt_upsampling` (boolean): Automatically modify the prompt for more creative generation. Modes: Text to Image, Image Edit. Only available via replicate - `safety_tolerance` (string): The safety tolerance level for the generated image. 1 being the most strict and 5 being the most permissive.. Values: 1, 2, 3, 4, 5. Modes: Text to Image, Image Edit - `steps` (integer): Number of inference steps. Modes: Text to Image, Image Edit. Only available via replicate - `sync_mode` (boolean): If `True`, the media will be returned as a data URI and the output data won't be available in the request history.. Modes: Text to Image, Image Edit. Only available via fal - `width` (integer): Width of the generated image. Only used when aspect_ratio=custom. Must be a multiple of 16 (if it's not, it will be rounded to nearest multiple of 16).. Modes: Text to Image, Image Edit. Only available via replicate ## Model Identifiers - Primary Slug: flux.2-flex - Aliases: flux-2-flex ## Tags image-generation, text-to-image, image-editing, text-rendering, creative-control ## Available Providers ### fal.ai - Config Key: fal/flux.2-flex - Provider Model ID: fal-ai/flux-2-flex - Pricing: $0.060/megapixel - Source: https://fal.ai/models/fal-ai/flux-2-flex ### fal.ai - Config Key: fal/flux.2-flex-edit - Provider Model ID: fal-ai/flux-2-flex/edit - Pricing: $0.060/megapixel, $0.060/megapixel - Note: Resolution is rounded up to the next megapixel, separately for each reference image and the generated image - Note: 1 megapixel = 1024x1024 pixels - Note: Each reference image is counted separately (minimum 1 MP each) - Note: Images exceeding 4 megapixels are resized to 4 megapixels - Source: https://fal.ai/models/fal-ai/flux-2-flex ### Replicate - Config Key: replicate/flux.2-flex - Provider Model ID: black-forest-labs/flux-2-flex - Pricing: $0.060/megapixel, $0.060/megapixel - Note: Resolution is rounded up to the next megapixel, separately for each reference image and the generated image - Note: 1 megapixel = 1024x1024 pixels - Note: Each reference image is counted separately (minimum 1 MP each) - Note: Images exceeding 4 megapixels are resized to 4 megapixels - Source: https://replicate.com/black-forest-labs/flux-2-flex ## Performance Metrics Provider performance over the last 30 days. ### fal - Median Generation Time (p50): 15813ms - 95th Percentile Generation Time (p95): 27184ms - Average Generation Time: 17002ms - Success Rate: 100.0% - Total Requests: 15 - Time to First Byte (p50): 15397ms - Time to First Byte (p95): 24295ms ### replicate - Median Generation Time (p50): 16534ms - 95th Percentile Generation Time (p95): 22532ms - Average Generation Time: 17573ms - Success Rate: 100.0% - Total Requests: 26 - Time to First Byte (p50): 15962ms - Time to First Byte (p95): 22707ms ## Arena Benchmarks ### Intricate Floral Mandala - Elo: 1294 - Record: 17W / 9L / 5T (31 battles) - Rank: #2 of 15 ### Heroic Super Hero Portrait - Elo: 1253 - Record: 19W / 8L / 4T (31 battles) - Rank: #3 of 21 ### Man and Car in California - Elo: 1251 - Record: 54W / 35L / 4T (93 battles) - Rank: #8 of 13 ### Isometric Miniature Diorama Scenes - Elo: 1213 - Record: 15W / 11L / 4T (30 battles) - Rank: #8 of 21 ### Geometric Composition - Elo: 1204 - Record: 10W / 14L / 4T (28 battles) - Rank: #7 of 22 ### Victorian Greenhouse Oasis - Elo: 1178 - Record: 6W / 7L / 3T (16 battles) - Rank: #13 of 17 ### Adorable Baby Animals in Sunny Meadow - Elo: 1174 - Record: 11W / 7L / 1T (19 battles) - Rank: #14 of 25 ### Modern Clean Menu - Elo: 1159 - Record: 10W / 19L / 3T (32 battles) - Rank: #16 of 19 ### Apollo 11: Journey to Tranquility - Elo: 1155 - Record: 8W / 13L / 1T (22 battles) - Rank: #12 of 19 ### Night Sky Transformation - Elo: 1149 - Record: 14W / 21L / 1T (36 battles) - Rank: #15 of 16 ### Candid Street Photography - Elo: 1119 - Record: 7W / 14L / 1T (22 battles) - Rank: #22 of 24 ### Vintage Cafe Logo - Elo: 1084 - Record: 4W / 7L / 1T (12 battles) - Rank: #20 of 21 ## Use Cases & Category Performance ### Photorealism (Image Editing) - Rank: #5 of 16 - Elo: 1245 - Record: 68W / 56L / 5T (129 battles) - Win Rate: 52.7% ### Photorealism (Text-to-Image) - Rank: #19 of 25 - Elo: 1165 - Record: 7W / 14L / 1T (22 battles) - Win Rate: 31.8% ### Text Rendering (Text-to-Image) - Rank: #19 of 24 - Elo: 1193 - Record: 22W / 39L / 3T (64 battles) - Win Rate: 34.4% ### Product, Branding & Commercial (Text-to-Image) - Rank: #21 of 22 - Elo: 1114 - Record: 4W / 7L / 1T (12 battles) - Win Rate: 33.3% ## Image Gallery 16 images available for this model. Browse all at https://lumenfall.ai/models/black-forest-labs/flux.2-flex/gallery ### Curated Examples - [Cinematic wide shot of a futuristic tech laboratory, a sleek holographic display on a glass wall ...](https://assets.lumenfall.ai/3l_V48q8UeWZIJDCLZrGuxCOKbog-LHkshAXzYSWRbg/rs:fit:1500:1500/plain/gs://lumenfall-prod-assets/2r966botkm8678kvb0kognssz43z@jpeg) - [A vibrant double exposure of a neon-lit cyberpunk city silhouette contained within the glass body...](https://assets.lumenfall.ai/PkOI-sRF1py4WWss79ovcXFmI8BAKJk3yGPouZsR9bE/rs:fit:1500:1500/plain/gs://lumenfall-prod-assets/vx1l33wxj0jshyqih40h70k7o7ab@jpeg) - [A hyper-realistic close-up of a neon-lit glass bottle. Inside, 3D glowing liquid threads morph in...](https://assets.lumenfall.ai/scI6ZYQTE1RiI1hyMt1NJ810jAEOJleQFtxLgGThFl0/rs:fit:1500:1500/plain/gs://lumenfall-prod-assets/m1znys30zsd7txtuir3bc8g4t6hz@jpeg) - [A vibrant neon storefront at night with a glowing glass sign that reads "MIDNIGHT COFFEE" in eleg...](https://assets.lumenfall.ai/4BgxBOlV45YyW977DlWoc71nooqDMYSsAi0ae6fabz4/rs:fit:1500:1500/plain/gs://lumenfall-prod-assets/fuwec2049centmuw3u7mlrg6al5i@jpeg) ### Arena Competition Results - [Intricate Floral Mandala](https://assets.lumenfall.ai/62x2FtPYxpZSO7_ArFTovXJOW_W3_r6QNMD-rroKROA/rs:fit:1500:1500/plain/gs://lumenfall-prod-assets/y7u35cloufdvk5d4sz482hkc63nn@jpeg): #2 of 15 (Elo 1294) - [Heroic Super Hero Portrait](https://assets.lumenfall.ai/YpX6O8STlF4eN5HYCMypT8IJDJjlPt1gsegmcazW0ws/rs:fit:1500:1500/plain/gs://lumenfall-prod-assets/uw75ad4123sgfezq3c21av7s2miw@jpeg): #3 of 21 (Elo 1253) - [Man and Car in California](https://assets.lumenfall.ai/b4u7_rmVdVRx_m6WtWCHcBdzzoe0Qh6umtbZAsgsBzQ/rs:fit:1500:1500/plain/gs://lumenfall-prod-assets/dkxj9jztrkleqjdkus537zl1fwls@jpeg): #8 of 13 (Elo 1251) - [Isometric Miniature Diorama Scenes](https://assets.lumenfall.ai/8mwxhRArbH5n_qfLpSXPA_eN7hF9FK7MEDAn46qpu2o/rs:fit:1500:1500/plain/gs://lumenfall-prod-assets/pgrg37d47cmpzmch3sr5cgsu1r8s@jpeg): #8 of 21 (Elo 1213) - [Geometric Composition](https://assets.lumenfall.ai/-7YjAmgPGi4OQh3MpM-ZlKmdnY5Qv9VC8H3iN831i9g/rs:fit:1500:1500/plain/gs://lumenfall-prod-assets/w4bxatpbtwh4gv7f6mstf07ruz96@jpeg): #7 of 22 (Elo 1204) - [Victorian Greenhouse Oasis](https://assets.lumenfall.ai/P2R2jZ7FIlQI8KlciQbOh_d1so0ly8Z2LsmYc59GlG8/rs:fit:1500:1500/plain/gs://lumenfall-prod-assets/nva4zey19ot733jab03kasiyfin1@jpeg): #13 of 17 (Elo 1178) - [Adorable Baby Animals in Sunny Meadow](https://assets.lumenfall.ai/xqJjTz28EjXkBVxKqoGjnOvP_3-T9MTP7p8bW03jocs/rs:fit:1500:1500/plain/gs://lumenfall-prod-assets/799clznmqmddepbosg3xu3vjei7l@jpeg): #14 of 25 (Elo 1174) - [Modern Clean Menu](https://assets.lumenfall.ai/-uKycYaKnvLymMNYCsP2uBXwriy2X65LBdskJ5i5KJw/rs:fit:1500:1500/plain/gs://lumenfall-prod-assets/aq1gbi8p78bhuv5buspm7v7g3a3g@jpeg): #16 of 19 (Elo 1159) - [Apollo 11: Journey to Tranquility](https://assets.lumenfall.ai/-mqUAL8Yi2Ug0HqaTM3io0skcWHGV0H8_xNP5tbuDEs/rs:fit:1500:1500/plain/gs://lumenfall-prod-assets/in6ufxd1z9tyd8qmo8sptvqm7kd2@jpeg): #12 of 19 (Elo 1155) - [Night Sky Transformation](https://assets.lumenfall.ai/Yn5H6OD8DsVsTIn_XxJ4Vp8PuuuemDiQ4bHQZo0_zy8/rs:fit:1500:1500/plain/gs://lumenfall-prod-assets/x2xbtlsn6my8mwynxpv5dl48w03l@jpeg): #15 of 16 (Elo 1149) - [Candid Street Photography](https://assets.lumenfall.ai/kofHDoD27XL24eH6-uWoBijbt1CA96_Qa95_TLXP9yQ/rs:fit:1500:1500/plain/gs://lumenfall-prod-assets/dragl6di5hk8lfpw21ehh5uj45lh@jpeg): #22 of 24 (Elo 1119) - [Vintage Cafe Logo](https://assets.lumenfall.ai/QNYk5Q3lDdqnfgMSdwjGA5u6_LmccYrhqGMpCoDq9SI/rs:fit:1500:1500/plain/gs://lumenfall-prod-assets/uawgmsfen1428hbkfghrne9k0ocf@jpeg): #20 of 21 (Elo 1084) ## Example Prompt The following prompt was used to generate an example image in our playground: A vibrant neon storefront at night with a glowing glass sign that reads "MIDNIGHT COFFEE" in elegant cursive. Rain reflects on the pavement where a tiny capybara sits quietly under a café table in the blurry background. High-contrast, 8k. ## Code Examples ### Text to Image (/v1/images/generations) #### cURL curl -X POST \ https://api.lumenfall.ai/openai/v1/images/generations \ -H "Authorization: Bearer $LUMENFALL_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "model": "flux.2-flex", "prompt": "", "size": "1024x1024" }' # Response: # { "created": 1234567890, "data": [{ "url": "https://...", "revised_prompt": "..." }] } #### JavaScript import OpenAI from 'openai'; const client = new OpenAI({ apiKey: 'YOUR_API_KEY', baseURL: 'https://api.lumenfall.ai/openai/v1' }); const response = await client.images.generate({ model: 'flux.2-flex', prompt: '', size: '1024x1024' }); // { created: 1234567890, data: [{ url: "https://...", revised_prompt: "..." }] } console.log(response.data[0].url); #### Python from openai import OpenAI client = OpenAI( api_key="YOUR_API_KEY", base_url="https://api.lumenfall.ai/openai/v1" ) response = client.images.generate( model="flux.2-flex", prompt="", size="1024x1024" ) # { created: 1234567890, data: [{ url: "https://...", revised_prompt: "..." }] } print(response.data[0].url) ### Image Edit (/v1/images/edits) #### cURL curl -X POST \ https://api.lumenfall.ai/openai/v1/images/edits \ -H "Authorization: Bearer $LUMENFALL_API_KEY" \ -F "model=flux.2-flex" \ -F "image=@source.png" \ -F "prompt=Add a starry night sky to this image" \ -F "size=1024x1024" # Response: # { "created": 1234567890, "data": [{ "url": "https://...", "revised_prompt": "..." }] } #### JavaScript import OpenAI from 'openai'; import fs from 'fs'; const client = new OpenAI({ apiKey: 'YOUR_API_KEY', baseURL: 'https://api.lumenfall.ai/openai/v1' }); const response = await client.images.edit({ model: 'flux.2-flex', image: fs.createReadStream('source.png'), prompt: 'Add a starry night sky to this image', size: '1024x1024' }); // { created: 1234567890, data: [{ url: "https://...", revised_prompt: "..." }] } console.log(response.data[0].url); #### Python from openai import OpenAI client = OpenAI( api_key="YOUR_API_KEY", base_url="https://api.lumenfall.ai/openai/v1" ) response = client.images.edit( model="flux.2-flex", image=open("source.png", "rb"), prompt="Add a starry night sky to this image", size="1024x1024" ) # { created: 1234567890, data: [{ url: "https://...", revised_prompt: "..." }] } print(response.data[0].url) ## About ## Overview FLUX.2 [flex] is a high-resolution image generation model developed by Black Forest Labs, designed specifically for workflows requiring high precision and administrative control over visual output. It supports generation up to 4 megapixels (4MP), significantly exceeding the standard 1MP outputs of many contemporary latent diffusion models. The model is built to bridge the gap between creative prompt engineering and technical asset production by prioritizing structural reliability and legible typography. ## Strengths * **High-Resolution Native Output:** Supports images up to 4MP, allowing for greater detail in large-format prints, digital signage, and high-fidelity textures without immediate need for secondary upscaling. * **Reliable Text Rendering:** Demonstrates high accuracy in rendering complex strings, signage, and user-defined typography within generated scenes, a traditional failure point for many diffusion architectures. * **Compositional Precision:** Offers granular control over spatial arrangements and object placement, making it suitable for professional design layouts where specific element positioning is required. * **Multi-Modal Flexibility:** Operates effectively across text-to-image and image-to-image pipelines, maintaining stylistic consistency during iterative editing or refinement tasks. ## Limitations * **Computational Intensity:** The increased pixel density and precision requirements result in a higher resource cost, reflected in its starting price of $0.06 per generation, making it less efficient for rapid, low-fidelity prototyping. * **Latency Tradeoffs:** Due to the complexity of generating 4MP outputs and the underlying FLUX.2 architecture, inference times are generally longer compared to "schnell" or distilled variants focused on speed. ## Technical Background FLUX.2 [flex] belongs to the FLUX.2 family of models, characterized by an evolved transformer-based diffusion architecture. It utilizes a flow-tracking approach to image synthesis, which improves the model's ability to follow complex prompts and maintain global coherence at high resolutions. Black Forest Labs optimized this specific variant to maximize the signal-to-noise ratio in high-frequency details, allowing for the 4MP ceiling while maintaining anatomical and structural accuracy. ## Best For FLUX.2 [flex] is ideal for professional graphic design, advertising campaigns requiring specific font integration, and high-resolution digital art where detail and control are paramount. Developers can leverage this model to build applications for automated marketing collateral or high-fidelity asset generation where "hallucinated" text or blurry background details would be unacceptable. You can experiment with FLUX.2 [flex] parameters and integrate it into your production environments via the Lumenfall unified API and interactive playground. ## Frequently Asked Questions ### How much does FLUX.2 [flex] cost? FLUX.2 [flex] starts at $0.06 per image through Lumenfall. Pricing varies by provider. Lumenfall does not add any markup to provider pricing. ### How do I use FLUX.2 [flex] via API? You can use FLUX.2 [flex] through Lumenfall's OpenAI-compatible API. Send requests to the unified endpoint with model ID "flux.2-flex". Code examples are available in Python, JavaScript, and cURL. ### Which providers offer FLUX.2 [flex]? FLUX.2 [flex] is available through fal.ai and Replicate on Lumenfall. Lumenfall automatically routes requests to the best available provider. ### What is the maximum resolution for FLUX.2 [flex]? FLUX.2 [flex] supports images up to 2048x2048 resolution. ## Links - Model Page: https://lumenfall.ai/models/black-forest-labs/flux.2-flex - About: https://lumenfall.ai/models/black-forest-labs/flux.2-flex/about - Providers, Pricing & Performance: https://lumenfall.ai/models/black-forest-labs/flux.2-flex/providers - API Reference: https://lumenfall.ai/models/black-forest-labs/flux.2-flex/api - Benchmarks: https://lumenfall.ai/models/black-forest-labs/flux.2-flex/benchmarks - Use Cases: https://lumenfall.ai/models/black-forest-labs/flux.2-flex/use-cases - Gallery: https://lumenfall.ai/models/black-forest-labs/flux.2-flex/gallery - Playground: https://lumenfall.ai/playground?model=flux.2-flex - API Documentation: https://docs.lumenfall.ai