## Basic model info - Model name: black-forest-labs/black-forest-labs flux-3-image - Model description: FLUX 3 Image is Black Forest Labs' newest image model: detailed, well-composed images in native 1K, 2K and 4K with precise layout control and improved text rendering. The image-editing endpoint makes precise local edits and combines up to 10 reference images into one balanced result. - 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/latest.json) ### Model input schema The model input schema is: ```json { "description": "Input for FLUX 3 Image text-to-image generation.", "properties": { "prompt": { "description": "Text prompt describing the image to generate or edit.", "minLength": 1, "title": "Prompt", "type": "string", "x-sr-order": 201 }, "aspect_ratio": { "default": "auto", "description": "auto lets the model choose (text-to-image: from the prompt; image-editing: follows the first reference image); any other value is enforced", "enum": [ "auto", "21:9", "2:1", "16:9", "3:2", "7:5", "4:3", "5:4", "1:1", "4:5", "3:4", "5:7", "2:3", "9:16", "1:2" ], "title": "Aspect Ratio", "type": "string", "x-sr-order": 401 }, "enable_prompt_expansion": { "default": false, "description": "Whether to expand the prompt before generation.", "title": "Enable Prompt Expansion", "type": "boolean", "x-sr-order": 403 }, "output_format": { "default": "jpeg", "description": "Output image format.", "enum": [ "jpeg", "png" ], "title": "Output Format", "type": "string", "x-sr-order": 501 }, "resolution": { "default": "1k", "description": "Output resolution tier (equal-pixel-area classes; exact size depends on aspect ratio). Billing is per output megapixel rounded up per image: 768sq ≈ 1 MP, 1k = 1–2 MP, 2k = 4–5 MP, 4k = 16–17 MP. 4k can take several minutes.", "enum": [ "768sq", "1k", "2k", "4k" ], "title": "Resolution", "type": "string", "x-sr-order": 402 } }, "required": [ "prompt" ], "title": "TextToImageInput", "type": "object" } ``` ### Model output schema The model output schema is: ```json { "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" }, "output_megapixels": { "description": "Billable output megapixels: for each delivered image ceil(width × height / 1,048,576), summed", "minimum": 1, "title": "Output Megapixels", "type": "integer" } }, "required": [ "images", "output_megapixels" ], "title": "Flux3ImageOutput", "type": "object" } ``` ## Example inputs and outputs Use the following example inputs and outputs to understand the model. ### Input example ```json { "prompt": "", "aspect_ratio": "auto", "enable_prompt_expansion": false, "output_format": "jpeg", "resolution": "1k" } ``` ### Output example ```json { } ``` ## Model code examples ### JavaScript ```javascript import { sunra } from "@sunra/client"; const result = await sunra.subscribe("black-forest-labs/flux-3-image/text-to-image", { input: { prompt: '', aspect_ratio: 'auto', resolution: '1k', enable_prompt_expansion: false, output_format: 'jpeg' }, 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/text-to-image", arguments={ "prompt": "", "aspect_ratio": "auto", "resolution": "1k", "enable_prompt_expansion": False, "output_format": "jpeg" }, 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/text-to-image", SubscribeOptions.builder() .input(Map.of( "prompt", "", "aspect_ratio", "auto", "resolution", "1k", "enable_prompt_expansion", false, "output_format", "jpeg")) .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/text-to-image", input = mapOf( "prompt" to "", "aspect_ratio" to "auto", "resolution" to "1k", "enable_prompt_expansion" to false, "output_format" to "jpeg"), 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/text-to-image \ --header "Authorization: Key $SUNRA_KEY" \ --header "Content-Type: application/json" \ --data '{"prompt":"","aspect_ratio":"auto","resolution":"1k","enable_prompt_expansion":false,"output_format":"jpeg"}' ``` ## Model readme >