# FLUX.2 [klein] 4B > Black Forest Labs' compact, open-source image generation model with sub-second inference, optimized for production and near real-time applications with multi-reference support ## Quick Reference - Model ID: flux.2-klein-4b - Creator: Black Forest Labs - Status: active - Family: flux.2 - Base URL: https://api.lumenfall.ai/openai/v1 ## Specifications - Max Resolution: 2048x2048 - Max Input Images: 4 - 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-klein-4b?schema=true`. ### Core Parameters - `prompt` (string) — REQUIRED: Edit instruction for the image. Modes: Image Edit, Text to Image - `seed` (integer): Random seed for reproducibility. Modes: Image Edit, Text to Image ### Size & Layout - `size` (string): Image dimensions as WxH pixels (e.g. "1024x1024") or aspect ratio (e.g. "16:9"). Values: auto, 1563x670, 670x1564, 1365x768, 768x1365, 1254x836, 836x1254, 887x1182, 1024x1024, 1145x916, 916x1145, 1183x887. Modes: Image Edit, Text to Image - `aspect_ratio` (string): Aspect ratio of the output image (e.g. "16:9", "1:1"). Values: auto, 9:21, 9:16, 2:3, 3:4, 4:5, 1:1, 5:4, 4:3, 3:2, 16:9, 21:9. Modes: Image Edit, Text to Image - `resolution` (string): Output resolution tier (e.g. "1K", "4K"). Values: auto, 1K. Modes: Image Edit, Text to Image ### 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: Image Edit, Text to Image - `output_format` (string): Output image format. Values: png, jpeg, gif, webp, avif. Modes: Image Edit, Text to Image - `output_compression` (integer): Compression level for lossy formats (JPEG, WebP, AVIF). Modes: Image Edit, Text to Image - `n` (integer): Number of images to generate. Default: 1. Modes: Image Edit, Text to Image ### Additional Parameters - `disable_safety_checker` (boolean): Disable safety checker for generated images.. Modes: Text to Image, Image Edit. Only available via replicate - `enable_safety_checker` (boolean): If set to true, the safety checker will be enabled.. Modes: Image Edit, Text to Image. Only available via fal - `go_fast` (boolean): Run faster predictions with additional optimizations.. Modes: Text to Image, Image Edit. Only available via replicate - `num_inference_steps` (integer): The number of inference steps to perform.. Modes: Image Edit, Text to Image. Only available via fal - `output_megapixels` (string): Resolution of the output image in megapixels. Values: 0.25, 0.5, 1, 2, 4. Modes: Text to Image, Image Edit. Only available via replicate - `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 - `sync_mode` (boolean): If `True`, the media will be returned as a data URI. Output is not stored when this is True.. Modes: Image Edit, Text to Image. Only available via fal ## Model Identifiers - Primary Slug: flux.2-klein-4b - Aliases: flux-2-klein-4b ## Dates - Released: January 2026 ## Tags image-generation, text-to-image, image-editing, open-weights ## Available Providers ### fal.ai - Config Key: fal/flux.2-klein-4b-edit - Provider Model ID: fal-ai/flux-2/klein/4b/edit - Pricing: $0.010/megapixel, $0.010/megapixel - Source: https://fal.ai/models/fal-ai/flux-2/klein/4b/edit ### Replicate - Config Key: replicate/flux.2-klein-4b - Provider Model ID: black-forest-labs/flux-2-klein-4b - Pricing: $0.0010/megapixel, $0.0010/megapixel - Source: https://replicate.com/black-forest-labs/flux-2-klein-4b ### fal.ai - Config Key: fal/flux.2-klein-4b - Provider Model ID: fal-ai/flux-2/klein/4b - Pricing: $0.0050/megapixel - Source: https://fal.ai/models/fal-ai/flux-2/klein/4b ## Performance Metrics Provider performance over the last 30 days. ### fal - Median Generation Time (p50): 3517ms - 95th Percentile Generation Time (p95): 15869ms - Average Generation Time: 5507ms - Success Rate: 100.0% - Total Requests: 11 - Time to First Byte (p50): 971ms - Time to First Byte (p95): 24819ms ## Arena Benchmarks ### Modern Clean Menu - Elo: 1227 - Record: 1W / 2L / 1T (4 battles) - Rank: #7 of 69 ### Geometric Composition - Elo: 1177 - Record: 7W / 2L / 2T (11 battles) - Rank: #32 of 70 ### The Halloween Invitation - Elo: 1157 - Record: 8W / 5L / 0T (13 battles) - Rank: #26 of 70 ### Pose & Character Mashup - Elo: 1146 - Record: 4W / 3L / 0T (7 battles) - Rank: #6 of 33 ### Man and Car in California - Elo: 1145 - Record: 3W / 1L / 1T (5 battles) - Rank: #22 of 35 ### The Reversed Rodeo - Elo: 1123 - Record: 3W / 6L / 0T (9 battles) - Rank: #28 of 68 ### Chalkboard Menu - Elo: 1112 - Record: 5W / 3L / 0T (8 battles) - Rank: #39 of 69 ### Adorable Baby Animals in Sunny Meadow - Elo: 1112 - Record: 2W / 5L / 0T (7 battles) - Rank: #53 of 72 ### Magic Burger Explosion: Fiery Photorealism Challenge - Elo: 1084 - Record: 2W / 3L / 0T (5 battles) - Rank: #53 of 69 ### The Capybara Taxi Driver - Elo: 1076 - Record: 3W / 1L / 1T (5 battles) - Rank: #52 of 69 ### Candid Street Photography - Elo: 1066 - Record: 1W / 5L / 0T (6 battles) - Rank: #58 of 68 ### Fantasy Warrior - Elo: 1014 - Record: 0W / 4L / 0T (4 battles) - Rank: #63 of 71 ### Vintage Cafe Logo - Elo: 994 - Record: 0W / 5L / 1T (6 battles) - Rank: #70 of 70 ## Use Cases & Category Performance ### Art (Text-to-Image) - Rank: #22 of 57 - Elo: 1191 - Record: 11W / 11L / 0T (22 battles) - Win Rate: 50.0% ### Lighting, Shadows & Materials (Image Editing) - Rank: #18 of 36 - Elo: 1207 - Record: 10W / 8L / 2T (20 battles) - Win Rate: 50.0% ### Face & Identity (Image Editing) - Rank: #19 of 32 - Elo: 1141 - Record: 3W / 1L / 0T (4 battles) - Win Rate: 75.0% ### Preservation (Image Editing) - Rank: #22 of 37 - Elo: 1183 - Record: 12W / 11L / 2T (25 battles) - Win Rate: 48.0% ### Aesthetics (Image Editing) - Rank: #21 of 33 - Elo: 1155 - Record: 4W / 5L / 2T (11 battles) - Win Rate: 36.4% ### Product, Branding & Commercial (Text-to-Image) - Rank: #39 of 61 - Elo: 1203 - Record: 16W / 20L / 2T (38 battles) - Win Rate: 42.1% ### People & Poses (Image Editing) - Rank: #18 of 27 - Elo: 1147 - Record: 4W / 5L / 1T (10 battles) - Win Rate: 40.0% ### Photorealism (Image Editing) - Rank: #24 of 36 - Elo: 1178 - Record: 6W / 5L / 2T (13 battles) - Win Rate: 46.2% ### Prompt Adherence (Text-to-Image) - Rank: #42 of 62 - Elo: 1208 - Record: 23W / 25L / 4T (52 battles) - Win Rate: 44.2% ### Text Rendering (Text-to-Image) - Rank: #42 of 61 - Elo: 1197 - Record: 16W / 21L / 2T (39 battles) - Win Rate: 41.0% ### Adding & Editing Objects (Image Editing) - Rank: #21 of 29 - Elo: 1153 - Record: 4W / 3L / 1T (8 battles) - Win Rate: 50.0% ### Prompt Adherence (Image Editing) - Rank: #21 of 29 - Elo: 1175 - Record: 6W / 6L / 0T (12 battles) - Win Rate: 50.0% ### 3D Imaging & Modeling (Text-to-Image) - Rank: #44 of 61 - Elo: 1157 - Record: 7W / 3L / 2T (12 battles) - Win Rate: 58.3% ### Photorealism (Text-to-Image) - Rank: #46 of 62 - Elo: 1162 - Record: 23W / 29L / 3T (55 battles) - Win Rate: 41.8% ### Aesthetics (Text-to-Image) - Rank: #48 of 62 - Elo: 1195 - Record: 27W / 39L / 5T (71 battles) - Win Rate: 38.0% ### Artistic Restyling (Image Editing) - Rank: #22 of 28 - Elo: 1098 - Record: 2W / 3L / 0T (5 battles) - Win Rate: 40.0% ### Creativity (Image Editing) - Rank: #22 of 28 - Elo: 1098 - Record: 2W / 3L / 0T (5 battles) - Win Rate: 40.0% ### Backgrounds & Scenes (Image Editing) - Rank: #21 of 26 - Elo: 1128 - Record: 3W / 1L / 1T (5 battles) - Win Rate: 60.0% ### Creativity (Text-to-Image) - Rank: #55 of 62 - Elo: 1162 - Record: 11W / 23L / 1T (35 battles) - Win Rate: 31.4% ### Portraits (Text-to-Image) - Rank: #48 of 50 - Elo: 1015 - Record: 0W / 4L / 0T (4 battles) - Win Rate: 0.0% ### Cartoon, Anime & Fantasy (Text-to-Image) - Rank: #48 of 50 - Elo: 1015 - Record: 0W / 4L / 0T (4 battles) - Win Rate: 0.0% ## Image Gallery 17 images available for this model. Browse all at https://lumenfall.ai/models/black-forest-labs/flux.2-klein-4b/gallery ### Curated Examples - [A cinematic, wide-angle shot of a high-end, minimalist luxury boutique at dusk. The storefront fe...](https://assets.lumenfall.ai/Gs49uwhZZN2OOWBVU1lRSGcuIJ6aLp2ImNXk3H1WgLI/rs:fit:1500:1500/plain/gs://lumenfall-prod-assets/66cmc8xq5wo9zgds13qitr1rx68n@jpeg) - [An ethereal macro photograph of a single translucent dandelion seed resting on a calm, dark obsid...](https://assets.lumenfall.ai/wGWV_gMzmLehFjcMdJg99ZTKeKkf6wdq5s6DZu1xIJc/rs:fit:1500:1500/plain/gs://lumenfall-prod-assets/zcz7tfbqrvirlmvalqlue77n86d4@jpeg) - [A highly detailed, macro photograph of a weathered leather craftsman's workbench. In the center s...](https://assets.lumenfall.ai/cuUzzw7AMb8JY7jrk02zLgN4y9fFdelF7XdA6mxXtsE/rs:fit:1500:1500/plain/gs://lumenfall-prod-assets/3kz7oaduvbgfmg6wvepiyedzlylv@jpeg) - [A rustic wooden storefront of a boutique bakery named "CRUST & CO." in elegant gold serif letteri...](https://assets.lumenfall.ai/afrFooKKTTVFFOobuZCHXXs0jkOjAP01V5Km7RtX6b0/rs:fit:1500:1500/plain/gs://lumenfall-prod-assets/ikkzci1ebbtrp2k816qzfo83a6pp@jpeg) ### Arena Competition Results - [Modern Clean Menu](https://assets.lumenfall.ai/G4o8c0AY4unyKnjIR8n9symsX6ZnPcaCnNXL6_pMO9o/rs:fit:1500:1500/plain/gs://lumenfall-prod-assets/th2mgeqchnn2lzalwws7cb4i6e5e@jpeg): #7 of 69 (Elo 1227) - [Geometric Composition](https://assets.lumenfall.ai/kOYgeUVTgQi9Y99qc9GiKJrvcRinQDnTP1FkX7QnnO4/rs:fit:1500:1500/plain/gs://lumenfall-prod-assets/zzcfoppq6vyzefdmriub9l7tzmq2@jpeg): #32 of 70 (Elo 1177) - [The Halloween Invitation](https://assets.lumenfall.ai/p8prgAQf9v7ZTtrTFcktCKi4OCaSeUeI4TLufF1RVC4/rs:fit:1500:1500/plain/gs://lumenfall-prod-assets/u33uc79zbn7ktufizrty7rofndi3@jpeg): #25 of 70 (Elo 1157) - [Pose & Character Mashup](https://assets.lumenfall.ai/yUQ84GtYzV6Naes4eHNhUA6FW5G9qJMySxA5PqTuKfA/rs:fit:1500:1500/plain/gs://lumenfall-prod-assets/gp742sjywy2darnay5ozppaew9wd@jpeg): #6 of 33 (Elo 1146) - [Man and Car in California](https://assets.lumenfall.ai/8OHLGkgg8-8aU67lCQ02mGSOEr896qFaewgZL2gYKZM/rs:fit:1500:1500/plain/gs://lumenfall-prod-assets/nbhg80r80vcbqkv7wloz7ulvmk5j@jpeg): #22 of 35 (Elo 1145) - [The Reversed Rodeo](https://assets.lumenfall.ai/YtBYJb5pSloQON1Jhl_B7TjjxArHqn-EXKSO-ImUy0I/rs:fit:1500:1500/plain/gs://lumenfall-prod-assets/1t0noxmrschh0w43x76aciyhtgx7@jpeg): #28 of 68 (Elo 1123) - [Fantasy Warrior](https://assets.lumenfall.ai/3r0kFXKkdGKuuR1xgzGfuzXLReUBFNJv_G9U_xMTa-0/rs:fit:1500:1500/plain/gs://lumenfall-prod-assets/1u9bcx7ydkn0a70xdzum6f46sz3g@jpeg): #45 of 71 (Elo 1113) - [Chalkboard Menu](https://assets.lumenfall.ai/e9dSHJGhWHGCfz34z5C9AEJHyD-x2mqwOlnRXfz4gOE/rs:fit:1500:1500/plain/gs://lumenfall-prod-assets/qmkt7ydojt3hbjxd8hhba4yd5r58@jpeg): #39 of 69 (Elo 1112) - [Adorable Baby Animals in Sunny Meadow](https://assets.lumenfall.ai/qMHFnDmanYD5kppvQYgKKmwrQ4zBJLBgqUuBvJgOJ0c/rs:fit:1500:1500/plain/gs://lumenfall-prod-assets/o0fszfb06rq9pca6y7wij05v0rs9@jpeg): #53 of 72 (Elo 1112) - [Magic Burger Explosion: Fiery Photorealism Challenge](https://assets.lumenfall.ai/gtd6I5Q9Ny3q2tCujOBJ9mBsMxl1vd3B5-mieP1KKBs/rs:fit:1500:1500/plain/gs://lumenfall-prod-assets/uilhh3b86qay23ooagg0art1pax9@jpeg): #53 of 69 (Elo 1084) - [The Capybara Taxi Driver](https://assets.lumenfall.ai/B2YeztXOC8HvQsuwEPcE5noxdrUzyiN7oxfzm6O3qa4/rs:fit:1500:1500/plain/gs://lumenfall-prod-assets/91nopmblq4fhbiv5q1y74fpzxl73@jpeg): #53 of 69 (Elo 1076) - [Candid Street Photography](https://assets.lumenfall.ai/51h7xQE11_RDWlbJdRqklO1ZjXloQM-A7hcL_vcuAYA/rs:fit:1500:1500/plain/gs://lumenfall-prod-assets/ki4qjrai6mv7bs9f9o4pew4wfuj6@jpeg): #58 of 68 (Elo 1066) - [Vintage Cafe Logo](https://assets.lumenfall.ai/9Wmb5VGn8ZuWXskk7CrlEKHxpjcdC5VkUrtoJT4mkF8/rs:fit:1500:1500/plain/gs://lumenfall-prod-assets/2uegvfwzh44arg5pnn6x68fc6zkp@jpeg): #70 of 70 (Elo 994) ## Example Prompt The following prompt was used to generate an example image in our playground: A rustic wooden storefront of a boutique bakery named "CRUST & CO." in elegant gold serif lettering. Through the large glass window, a small capybara sits quietly on a floor rug near a display of sourdough bread. Low morning sun, cinematic. ## 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-klein-4b", "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-klein-4b', 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-klein-4b", 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-klein-4b" \ -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-klein-4b', 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-klein-4b", 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) ## Frequently Asked Questions ### How much does FLUX.2 [klein] 4B cost? FLUX.2 [klein] 4B starts at $0.001 per image through Lumenfall. Pricing varies by provider. Lumenfall does not add any markup to provider pricing. ### How do I use FLUX.2 [klein] 4B via API? You can use FLUX.2 [klein] 4B through Lumenfall's OpenAI-compatible API. Send requests to the unified endpoint with model ID "flux.2-klein-4b". Code examples are available in Python, JavaScript, and cURL. ### Which providers offer FLUX.2 [klein] 4B? FLUX.2 [klein] 4B 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 [klein] 4B? FLUX.2 [klein] 4B supports images up to 2048x2048 resolution. ## Links - Model Page: https://lumenfall.ai/models/black-forest-labs/flux.2-klein-4b - About: https://lumenfall.ai/models/black-forest-labs/flux.2-klein-4b/about - Providers, Pricing & Performance: https://lumenfall.ai/models/black-forest-labs/flux.2-klein-4b/providers - API Reference: https://lumenfall.ai/models/black-forest-labs/flux.2-klein-4b/api - Benchmarks: https://lumenfall.ai/models/black-forest-labs/flux.2-klein-4b/benchmarks - Use Cases: https://lumenfall.ai/models/black-forest-labs/flux.2-klein-4b/use-cases - Gallery: https://lumenfall.ai/models/black-forest-labs/flux.2-klein-4b/gallery - Playground: https://lumenfall.ai/models/black-forest-labs/flux.2-klein-4b/playground - API Documentation: https://docs.lumenfall.ai