Skip to main content
Black Forest LabsFastHigh

FLUX.2 Klein 9B

4-step distilled FLUX.2 [klein] 9B โ€” fast, higher-capacity sibling of Klein 4B for text-to-image generation and multi-reference image editing (up to 5 input images), with selectable output megapixels.

35 credits
per image at 1MP (default); 9 at 0.25MP, 18 at 0.5MP, 70 at 2MP, 140 at 4MP
4-step distilled 9B model โ€” sub-second to few-second inference
Text-to-image and multi-reference image editing (up to 5 images)
Selectable output resolution from 0.25MP to 4MP
go_fast optimizations on by default
Billed by output megapixels, so small previews cost less

Run it right now

Test this model instantly in the Console Playground โ€” no code required

Sign in to try

Use with AI Assistant

Copy usage instructions for Claude, ChatGPT, or other AI

Quick Start

curl -X POST "https://api.core.today/v1/predictions" \
  -H "Content-Type: application/json" \
  -H "X-API-Key: cdt_your_api_key" \
  -d '{
  "model": "black-forest-labs/flux-2-klein-9b",
  "input": {
    "images": [],
    "prompt": "A surreal cosmic garden scene with bioluminescent flora against a deep navy blue to black background, glowing particles floating like plankton, cinematic lighting. With large white text in the center \"FLUX.2 [klein] 9B\"",
    "go_fast": true,
    "megapixels": "1",
    "aspect_ratio": "1:1",
    "output_format": "jpg",
    "output_quality": 95
  }
}'

Parameters

ParameterTypeRequiredDefaultDescription
promptstringYes-Text prompt for image generation
imagesarrayNo[]Input images for image-to-image generation (max 5; jpeg, png, gif or webp)
aspect_ratiostringNo1:1Aspect ratio for the generated image. Use match_input_image to match the first input image
1:116:99:163:22:34:33:45:44:521:99:21match_input_image
megapixelsstringNo1Resolution of the output image in megapixels. Higher values cost more credits
0.250.5124
seedintegerNo-Random seed. Set for reproducible generation
go_fastbooleanNotrueRun faster predictions with additional optimizations
output_formatstringNojpgFormat of the output images
webpjpgpng
output_qualityintegerNo95Quality when saving the output images, from 0 to 100. 100 is best quality, 0 is lowest quality. Not relevant for .png outputs.
disable_safety_checkerbooleanNofalseDisable safety checker for generated images.

How to Provide File Input

There are 3 ways to provide files for the images parameter:

Recommended

Image URL

Pass a publicly accessible URL directly. With the Storage API (POST /v1/files/upload-url) the file uploads straight to S3 (50MB per file) and you pass the returned file_url.

{
  "model": "black-forest-labs/flux-2-klein-9b",
  "input": {
    "prompt": "your prompt here",
    "images": ["https://example.com/image.jpg"]
  }
}

Direct Upload (Multipart)

Attach files directly to POST /v1/predictions/upload. No separate upload step, but the bytes pass through the API server so the whole request is capped at 10MB.

curl -X POST "https://api.core.today/v1/predictions/upload" \
  -H "X-API-Key: cdt_your_api_key" \
  -F "model=black-forest-labs/flux-2-klein-9b" \
  -F 'input={"prompt":"your prompt here"}' \
  -F "file:images=@your_file.png"
See the File Upload docs for more upload methods including Presigned URLs.

Common Parameters

Common parameters used when calling POST /v1/predictions.

ParameterTypeRequiredDefaultDescription
modelstringYes-Model identifier
inputobjectYes-Object containing the model-specific parameters from the table above
output_folderstringNo-Folder path for output files (max 256 chars, '..' not allowed)
webhook_urlstringNo-Webhook URL to call on completion
is_publicbooleanNofalseIf true, output files are also available via permanent public URLs

Examples

1MP Generation (Default)

Default 1-megapixel text-to-image generation with in-image text โ€” 35 credits

1MP Generation (Default)
curl -X POST "https://api.core.today/v1/predictions" \
  -H "Content-Type: application/json" \
  -H "X-API-Key: cdt_your_api_key" \
  -d '{
  "model": "black-forest-labs/flux-2-klein-9b",
  "input": {
    "images": [],
    "prompt": "A surreal cosmic garden scene with bioluminescent flora against a deep navy blue to black background, glowing particles floating like plankton, cinematic lighting. With large white text in the center \"FLUX.2 [klein] 9B\"",
    "go_fast": true,
    "megapixels": "1",
    "aspect_ratio": "1:1",
    "output_format": "jpg",
    "output_quality": 95
  }
}'

Low-Cost Preview

0.25-megapixel draft for quick prompt iteration โ€” 9 credits

curl -X POST "https://api.core.today/v1/predictions" \
  -H "Content-Type: application/json" \
  -H "X-API-Key: cdt_your_api_key" \
  -d '{
  "model": "black-forest-labs/flux-2-klein-9b",
  "input": {
    "prompt": "A neon-lit cyberpunk alley at night, concept sketch",
    "megapixels": "0.25"
  }
}'

Tips & Best Practices

1megapixels directly sets the price tier โ€” use 0.25-0.5MP for previews and 2-4MP only for final renders
2Supply up to 5 reference images via images to guide edits; use aspect_ratio match_input_image to keep the first image's framing
3go_fast is on by default; turn it off only if you see quality issues
4Pick 4B for the lowest cost and 9B when you need more detail and prompt fidelity

Use Cases

Near real-time image generation in interactive apps
Reference-guided edits combining up to 5 images
Low-cost drafts before a final high-resolution render
High-throughput batch generation pipelines

Model Info

ProviderBlack Forest Labs
Version-
CategoryImage Generation
Price35 credits

API Endpoint

POST /v1/predictions
Try in ConsoleBack to Docs