## Basic model info - Model name: black-forest-labs/black-forest-labs flux-3-image-klein - Model description: FLUX 3 Image Klein is Black Forest Labs' fast, low-cost FLUX 3 image model: text-to-image at any size up to native 4K with optional bounding-box layout control, and editing or composition with up to 10 reference images. Billed per image by output resolution tier, from $0.008 (768x768) to $0.036 (4K). - Endpoint name: text-to-image ## Model schema The model schema is defined in the OpenAPI schema: [OpenAPI Schema](https://oapi.sunra.ai/main/black-forest-labs/flux-3-image-klein/latest.json) ### Model input schema The model input schema is: ```json { "description": "Input schema for FLUX 3 Image Klein text-to-image generation.", "properties": { "prompt": { "description": "Text prompt. The model is trained on detailed captions: describe framing, subject, background, lighting and style.", "maxLength": 10000, "minLength": 1, "title": "Prompt", "type": "string", "x-sr-order": 201 }, "prompt_enhancer": { "default": true, "description": "Expand the prompt into a detailed caption before generation (grounded in the reference images when editing).", "title": "Prompt Enhancer", "type": "boolean", "x-sr-order": 404 }, "width": { "anyOf": [ { "maximum": 4096, "minimum": 256, "type": "integer" }, { "type": "null" } ], "description": "Output width in pixels (256–4096, rounded to a multiple of 16). Must be set together with height; width x height must not exceed 16,777,216 pixels. Price per image depends on the output area: up to 768x768 $0.008, up to 1024x1024 $0.009, up to 1536x1536 $0.011, up to 2048x2048 $0.014, larger (native 4K) $0.036.", "title": "Width", "x-sr-order": 401 }, "height": { "anyOf": [ { "maximum": 4096, "minimum": 256, "type": "integer" }, { "type": "null" } ], "description": "Output height in pixels (256–4096). Must be set together with width.", "title": "Height", "x-sr-order": 402 }, "seed": { "anyOf": [ { "minimum": 0, "type": "integer" }, { "type": "null" } ], "description": "Random seed for reproducibility.", "title": "Seed", "x-sr-order": 501 }, "bounding_boxes": { "anyOf": [ { "items": { "description": "Layout hint for text-to-image: draw the described object inside the box.", "properties": { "box": { "description": "Where the object goes in the output image.", "properties": { "x_max": { "description": "Right edge as a fraction of the image width (0–1).", "maximum": 1, "minimum": 0, "title": "X Max", "type": "number" }, "x_min": { "description": "Left edge as a fraction of the image width (0–1).", "maximum": 1, "minimum": 0, "title": "X Min", "type": "number" }, "y_max": { "description": "Bottom edge as a fraction of the image height (0–1).", "maximum": 1, "minimum": 0, "title": "Y Max", "type": "number" }, "y_min": { "description": "Top edge as a fraction of the image height (0–1).", "maximum": 1, "minimum": 0, "title": "Y Min", "type": "number" } }, "required": [ "x_min", "y_min", "x_max", "y_max" ], "title": "Box", "type": "object" }, "description": { "description": "What to draw in this box: the object and its look.", "maxLength": 500, "minLength": 1, "title": "Description", "type": "string" }, "label": { "anyOf": [ { "maxLength": 100, "type": "string" }, { "type": "null" } ], "description": "Short name for the object, e.g. `fox`. Write `` in the prompt to tie the box to those words.", "title": "Label" } }, "required": [ "description", "box" ], "title": "BoundingBox", "type": "object" }, "maxItems": 32, "type": "array" }, { "type": "null" } ], "description": "Optional layout: draw each described object inside its box. Name boxes in the prompt by label, e.g. `A red fox sits under a red umbrella `.", "title": "Bounding Boxes", "x-sr-order": 406 }, "number_of_images": { "default": 1, "description": "Number of images to generate. Each image is billed separately.", "maximum": 4, "minimum": 1, "title": "Number Of Images", "type": "integer", "x-sr-order": 403 }, "output_format": { "default": "png", "description": "Output image format.", "enum": [ "jpeg", "png", "webp" ], "title": "Output Format", "type": "string", "x-sr-order": 405 } }, "required": [ "prompt" ], "title": "TextToImageInput", "type": "object" } ``` ### Model output schema The model output schema is: ```json { "description": "FLUX 3 Image Klein output with the final USD amount for per-image tier billing.", "properties": { "images": { "items": { "properties": { "content_type": { "description": "The mime type of the file.", "title": "Content Type", "type": "string" }, "file_name": { "description": "The name of the file. It will be auto-generated if not provided.", "title": "File Name", "type": "string" }, "file_size": { "description": "The size of the file in bytes.", "title": "File Size", "type": "integer" }, "url": { "description": "The URL where the file can be downloaded from.", "title": "Url", "type": "string" } }, "required": [ "content_type", "file_name", "file_size", "url" ], "title": "SunraFile", "type": "object" }, "title": "Images", "type": "array" }, "units": { "description": "Final billable amount in USD (per-image price by output resolution tier, summed).", "title": "Units", "type": "number" } }, "required": [ "images", "units" ], "title": "Flux3KleinOutput", "type": "object" } ``` ## Example inputs and outputs Use the following example inputs and outputs to understand the model. ### Input example ```json { "prompt": "", "prompt_enhancer": true, "width": null, "height": null, "seed": null, "bounding_boxes": null, "number_of_images": 1, "output_format": "png" } ``` ### Output example ```json { } ``` ## Model code examples ### JavaScript ```javascript import { sunra } from "@sunra/client"; const result = await sunra.subscribe("black-forest-labs/flux-3-image-klein/text-to-image", { input: { prompt: '', width: null, height: null, number_of_images: 1, prompt_enhancer: true, output_format: 'png', seed: null, bounding_boxes: null }, logs: true, onQueueUpdate: (update) => { console.log(`Status Update: ${update.status}, Request ID: ${update.request_id}`); }, }); console.log(result.data); console.log(result.requestId); ``` ### Python ```python import sunra_client result = sunra_client.subscribe( "black-forest-labs/flux-3-image-klein/text-to-image", arguments={ "prompt": "", "width": None, "height": None, "number_of_images": 1, "prompt_enhancer": True, "output_format": "png", "seed": None, "bounding_boxes": None }, with_logs=True, on_enqueue=print, on_queue_update=print, ) print(result) ``` ### Java ```java import ai.sunra.client.*; import java.util.Map; import com.google.gson.JsonObject; var client = SunraClient.withEnvCredentials(); var response = client.subscribe( "black-forest-labs/flux-3-image-klein/text-to-image", SubscribeOptions.builder() .input(Map.of( "prompt", "", "width", null, "height", null, "number_of_images", 1, "prompt_enhancer", true, "output_format", "png", "seed", null, "bounding_boxes", null)) .resultType(JsonObject.class) .onQueueUpdate(update -> System.out.printf( "\nStatus Update: %s, Request ID: %s%n", update.getStatus(), update.getRequestId() )) .logs(true) .build() ); System.out.println("Completed!"); System.out.println(response.getData()); ``` ### Kotlin ```kotlin import ai.sunra.client.kt.* import com.google.gson.JsonObject val client = createSunraClient() val response = client.subscribe( endpointId = "black-forest-labs/flux-3-image-klein/text-to-image", input = mapOf( "prompt" to "", "width" to null, "height" to null, "number_of_images" to 1, "prompt_enhancer" to true, "output_format" to "png", "seed" to null, "bounding_boxes" to null), options = ai.sunra.client.kt.SubscribeOptions(logs = true), onUpdate = { update -> println("\nStatus Update: ${update.status}, Request ID: ${update.requestId}") } ) println("Completed!") println(response.data) ``` ### Curl ```bash curl --request POST \ --url https://api.sunra.ai/v1/queue/black-forest-labs/flux-3-image-klein/text-to-image \ --header "Authorization: Key $SUNRA_KEY" \ --header "Content-Type: application/json" \ --data '{"prompt":"","width":null,"height":null,"number_of_images":1,"prompt_enhancer":true,"output_format":"png","seed":null,"bounding_boxes":null}' ``` ## Model readme >