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.
pip install requestsimport 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"])| Parameter | Type | Description |
|---|---|---|
| prompt | string | Text description of the image to generate. |
| image_size | string | Size preset for the generated image. Alternatively use width/height for custom dimensions. |
| num_images | integer | Number of images to generate (1-4). |
| num_inference_steps | integer | Number of denoising steps. Default 4 for distilled variant, use higher for base variant. |
| guidance_scale | number | Classifier-free guidance scale. Higher values follow the prompt more closely. |
| seed | integer | Random seed for reproducible generation. Leave empty for random. |
| output_format | string | Output image format. |
| enable_safety_checker | boolean | Enable NSFW content filtering. |
| sync_mode | boolean | Wait for the result synchronously instead of returning a request ID. |
| Field | Type | Description |
|---|---|---|
| images | json | Array of generated images with url, width, height, and content_type. |
| seed | integer | The seed used for generation. |
| has_nsfw_concepts | json | Boolean array indicating NSFW detection per image. |
| prompt | string | The prompt used for generation. |
| timings | json | Timing breakdown of the generation process. |
Get API access in minutes. No GPU setup, no infrastructure to manage.