# FLUX.2 Klein 9B - Core.Today AI API > 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. - **Provider**: Black Forest Labs - **Model ID**: black-forest-labs/flux-2-klein-9b - **Category**: Image Generation - **Credits**: 35 per image at 1MP (default); 9 at 0.25MP, 18 at 0.5MP, 70 at 2MP, 140 at 4MP - **Speed**: Fast - **Quality**: High ## Features - 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 ## 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 ## API Endpoint Base URL: https://api.core.today/v1 Create Prediction: POST /predictions Get Status: GET /predictions/{job_id} ## Authentication Header: X-API-Key: YOUR_API_KEY ## Input Parameters ### Required - **prompt**: string - Text prompt for image generation ### Optional - **images**: array (default: []) - Input images for image-to-image generation (max 5; jpeg, png, gif or webp) - **aspect_ratio**: string (default: 1:1) - Aspect ratio for the generated image. Use match_input_image to match the first input image Options: 1:1, 16:9, 9:16, 3:2, 2:3, 4:3, 3:4, 5:4, 4:5, 21:9, 9:21, match_input_image - **megapixels**: string (default: 1) - Resolution of the output image in megapixels. Higher values cost more credits Options: 0.25, 0.5, 1, 2, 4 - **seed**: integer - Random seed. Set for reproducible generation - **go_fast**: boolean (default: true) - Run faster predictions with additional optimizations - **output_format**: string (default: jpg) - Format of the output images Options: webp, jpg, png - **output_quality**: integer (default: 95) - Quality when saving the output images, from 0 to 100. 100 is best quality, 0 is lowest quality. Not relevant for .png outputs. - **disable_safety_checker**: boolean (default: false) - Disable safety checker for generated images. ## Examples ### 1MP Generation (Default) Default 1-megapixel text-to-image generation with in-image text — 35 credits ```json { "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 ```json { "model": "black-forest-labs/flux-2-klein-9b", "input": { "prompt": "A neon-lit cyberpunk alley at night, concept sketch", "megapixels": "0.25" } } ``` ## Response Format ```json { "job_id": "abc123", "status": "pending | processing | completed | failed", "result": "URL or data (when completed)" } ``` ## Usage Flow 1. POST /predictions with model and input -> receive job_id 2. GET /predictions/{job_id} -> poll until status is completed or failed 3. Result contains output URL(s) ## Tips - megapixels directly sets the price tier — use 0.25-0.5MP for previews and 2-4MP only for final renders - Supply up to 5 reference images via images to guide edits; use aspect_ratio match_input_image to keep the first image's framing - go_fast is on by default; turn it off only if you see quality issues - Pick 4B for the lowest cost and 9B when you need more detail and prompt fidelity ## Documentation https://replicate.com/black-forest-labs/flux-2-klein-9b