About FLUX.2 Klein 4B
FLUX.2 Klein 4B from Black Forest Labs is a lightweight version of the FLUX.2 family featuring 4 billion parameters, designed for efficient text-to-image generation with support for various aspect ratios and quality settings. It accepts text prompts and optional image inputs for reference, producing high-quality PNG, JPEG, or WebP images. Key features include customizable inference steps (1-50), guidance scale, and seed control for reproducible results. Ideal for real-time applications and resource-constrained environments.
Ready to build with FLUX.2 Klein 4B?
Try FLUX.2 Klein 4B in the Workbench to prompt it, compare outputs, and iterate on prompts without writing any code. When you're ready to ship, call the same model from our API and build your own apps on top of it.
curl -sSf -X POST https://hub.oxen.ai/api/ai/images/edit \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $OXEN_API_KEY" \
-d '{
"model": "black-forest-labs-flux-2-klein-4b",
"prompt": "A cat sitting on a chair",
"aspect_ratio": "16:9",
"output_quality": "standard",
"output_format": "png",
"num_inference_steps": 28,
"guidance_scale": 2
}'Request parameters
Every field FLUX.2 Klein 4B accepts in the request body. See the API reference for response formats.
https://hub.oxen.ai/api/ai/images/edit| Field | Type | Required | Default | Description |
|---|---|---|---|---|
prompt | string | Yes | — | Text description of the image to generate. Use @Image1, @Image2, etc. to reference the input images. |
input_image | array<string>nullable | No | — | Input images to transform or use as reference. Reference them in the prompt as @Image1, @Image2, etc. |
aspect_ratio | string | No | "16:9" | 1:116:99:164:33:4 |
output_quality | string | No | "standard" | Quality setting for output imagestandardhigh |
output_format | string | No | "png" | Format of the output imagepngjpgwebp |
seed | integer | No | — | Random seed. Leave blank to randomize |
num_inference_steps | integer | No | 28 | Number of denoising steps Range: 1 – 50 |
guidance_scale | number | No | 2 | Scale for classifier-free guidance Range: 0 – 10 |