
Apache-licensed 4B FLUX.2 Klein image generation and editing model with text-to-image, reference-image editing, and creative workflow support.
Apache-licensed 4B FLUX.2 Klein image generation and editing model with text-to-image, reference-image editing, and creative workflow support.
flux-2-klein-4bPOST /v1/images/generationsLive pay-as-you-go rates from the EmpirioLabs catalog. You are billed only for what you use, with no monthly minimum.
FLUX.2 Klein 4B runs through POST /v1/images/generations. The request returns a job_id right away; poll GET /v1/jobs/{job_id} until the job completes and read the output URLs from the result. Or add "sync": true to skip polling: the request stays open and returns the finished OpenAI-style image response directly, so OpenAI SDKs work as-is. Get an API key from the EmpirioLabs dashboard.
curl https://api.empiriolabs.ai/v1/images/generations \
-H "Authorization: Bearer $EMPIRIOLABS_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "flux-2-klein-4b",
"prompt": "Describe what you want FLUX.2 Klein 4B to generate."
}'curl https://api.empiriolabs.ai/v1/jobs/JOB_ID \
-H "Authorization: Bearer $EMPIRIOLABS_API_KEY"import requests
response = requests.post(
"https://api.empiriolabs.ai/v1/images/generations",
headers={"Authorization": "Bearer YOUR_EMPIRIOLABS_API_KEY"},
json={
"model": "flux-2-klein-4b",
"prompt": "Describe what you want FLUX.2 Klein 4B to generate.",
},
)
job = response.json()
# Generation runs as an async job. Poll until it completes.
import time
while True:
status = requests.get(
f"https://api.empiriolabs.ai/v1/jobs/{job['job_id']}",
headers={"Authorization": "Bearer YOUR_EMPIRIOLABS_API_KEY"},
).json()
if status.get("status") in ("completed", "failed"):
print(status)
break
time.sleep(5)Request parameters supported by the FLUX.2 Klein 4B API on EmpirioLabs. Defaults apply when a field is omitted.
| Parameter | Type | Default | Range / values | Description |
|---|---|---|---|---|
| prompt | string | - | - | Text description of the image to generate. |
| negative_prompt | string | - | - | Text description of what to avoid in the image. |
| aspect_ratio | enum | 1:1 | 1:1, 16:9, 9:16, 4:3, 3:4, 3:2, 2:3 | Output aspect ratio (1:1, 16:9, 9:16, 4:3, 3:2, etc.). |
| size | string | - | - | Explicit WIDTHxHEIGHT override. Width x height must be at most 1,048,576 pixels. Leave unset to use aspect_ratio. |
| width | number | - | 256 to 2048 | Output width in pixels. Set width and height together. Width x height must be at most 1,048,576 pixels. |
| height | number | - | 256 to 2048 | Output height in pixels. Set width and height together. Width x height must be at most 1,048,576 pixels. |
| num_inference_steps | number | 4 | 1 to 12 | Number of denoising steps. Higher = better quality but slower. |
| guidance_scale | number | 1 | 0 to 8 | Prompt adherence. Higher = closer to prompt but less creative. |
| seed | number | - | - | Random seed for reproducibility. Same seed + prompt = same output. |
| num_images | number | 1 | 1 to 4 | How many images to generate (1-4). |
| format | enum | webp | webp, png, jpg, jpeg | Image file codec for the generated output. |
| response_format | enum | url | url, b64_json | Return a signed media URL by default, or base64 JSON when requested. |
| return_base64 | boolean | false | - | Compatibility alias for response_format=b64_json. |
| max_sequence_length | number | 512 | 64 to 512 | Max prompt-token length the model conditions on. |
Supports prompt, size/aspect ratio or explicit width/height, seed, n/num_images, and reference images. Width x height must be at most 1,048,576 pixels. Examples: 1024x1024, 1344x768, 768x1344, or 2048x512. Billing is per returned image, so num_images: 4 creates and bills 4 images. negative_prompt is accepted for compatibility but ignored by the distilled Klein pipeline.
On EmpirioLabs, FLUX.2 Klein 4B is billed pay as you go: Image generation $0.0085 (was $0.014) per image. The live rate card on this page always matches what the API charges.
FLUX.2 Klein 4B is served through POST /v1/images/generations on api.empiriolabs.ai with standard bearer-token authentication.
Yes. The EmpirioLabs playground runs FLUX.2 Klein 4B in the browser with the same parameters the API exposes, so you can test prompts before writing code.
Create an EmpirioLabs account, then generate a key under API Keys in the dashboard. Billing is pay-as-you-go credits, so you only pay for the requests you make.
Explore our models, or contact us about business inquiries, custom deployments, or anything else.