Back to models
FLUX.2-klein-4B
Black Forest Labs' Apache-2.0 licensed 4B step-distilled rectified flow model delivering low-latency text-to-image generation and multi-reference image editing on mainstream consumer GPUs.
What you can do
- Real-time interactive text-to-image creation
- Single-GPU multi-reference image editing
- Rapid UI asset and storyboard prototyping
Input & output
- Input
- Text prompts and up to 4 optional reference images for editing or style guidance
- Output
- Fast synthesized or reference-guided edited images
Try a prompt like this
A minimalist isometric 3D icon of an automated greenhouse pod with glowing warm hydroponic trays on a matte slate background, soft studio lighting.
Things to know
Apache 2.0 licensed and runs on 12–16GB consumer GPUs (~8–13GB VRAM); step-distilled weights favor fast inference, so use `FLUX.2-klein-base-4B` for custom LoRA training.
All listed models publish open weights for self-hosted deployment; check each repository's license before commercial use.
Call it through the API
The platform exposes an OpenAI-compatible API. Use an official SDK or any HTTP client, then set the gateway URL, API key, and model ID.
- Endpoint
POST/v1/images/generations- Model repo ID
black-forest-labs/FLUX.2-klein-4B
import os
from openai import OpenAI
client = OpenAI(
base_url=os.environ["API_BASE_URL"],
api_key=os.environ["API_KEY"],
)
result = client.images.generate(
model="black-forest-labs/FLUX.2-klein-4B",
prompt="A minimalist isometric 3D icon of an automated greenhouse pod with glowing warm hydroponic trays on a matte slate background, soft studio lighting.",
size="1024x1024",
)
print(result.data[0].url)Before running a sample, set the API_BASE_URL (gateway URL) and API_KEY environment variables.
Read the full API guide