Runflow
Back to Gallery

black-forest-labs/flux-2-klein-4b

Compact 4-billion parameter text-to-image model from Black Forest Labs. Step-distilled to 4 inference steps for sub-second generation. Unifies text-to-image and image editing in a single architecture with Apache 2.0 licensing.

$0.014/megapixel 2026-04-06

Install

pip install requests

Run the model

import requests

response = requests.post(
    "https://api.runflow.io/v1/run/flux-2-klein-4b",
    headers={"Authorization": "Bearer RUNFLOW_API_KEY"},
    json={
    "prompt": "A vintage travel poster for 'RUNFLOW AIRWAYS' featuring a retro DC-3 airplane..."
    },
)

data = response.json()
print(data["images"][0]["url"])

Input schema

ParameterTypeDescription
promptstringText description of the image to generate.
image_sizestringSize preset for the generated image. Alternatively use width/height for custom dimensions.
num_imagesintegerNumber of images to generate (1-4).
num_inference_stepsintegerNumber of denoising steps. Default 4 for distilled variant, use higher for base variant.
guidance_scalenumberClassifier-free guidance scale. Higher values follow the prompt more closely.
seedintegerRandom seed for reproducible generation. Leave empty for random.
output_formatstringOutput image format.
enable_safety_checkerbooleanEnable NSFW content filtering.
sync_modebooleanWait for the result synchronously instead of returning a request ID.

Output schema

FieldTypeDescription
imagesjsonArray of generated images with url, width, height, and content_type.
seedintegerThe seed used for generation.
has_nsfw_conceptsjsonBoolean array indicating NSFW detection per image.
promptstringThe prompt used for generation.
timingsjsonTiming breakdown of the generation process.

Related models

Start generating with FLUX.2 [klein] 4B

Get API access in minutes. No GPU setup, no infrastructure to manage.