## Basic model info - Model name: krea/krea krea-3 - Model description: Krea 3 generates images from text and edits or combines up to eight reference images from a prompt, with a berry variant tuned for quality and a jam variant tuned for speed, at any size up to 4.2 megapixels. Pricing is per megapixel of output plus each reference image, with an optional high-reasoning edit mode that plans the edit before rendering. - Endpoint name: text-to-image ## Model schema The model schema is defined in the OpenAPI schema: [OpenAPI Schema](https://oapi.sunra.ai/main/krea/krea-3/latest.json) ### Model input schema The model input schema is: ```json { "description": "Input schema for Krea 3 text-to-image generation.", "properties": { "prompt": { "description": "Description of the image to generate.", "maxLength": 10000, "minLength": 1, "title": "Prompt", "type": "string", "x-sr-order": 201 }, "width": { "anyOf": [ { "maximum": 3200, "minimum": 256, "type": "integer" }, { "type": "null" } ], "description": "Output width in pixels (256–3200, rounded up to a multiple of 16). Must be set together with height; width x height must not exceed 4,220,160 pixels. Omit both to let the model pick a size of about 4 megapixels from the prompt. Price is $0.025 per output megapixel.", "title": "Width", "x-sr-order": 401 }, "height": { "anyOf": [ { "maximum": 3200, "minimum": 256, "type": "integer" }, { "type": "null" } ], "description": "Output height in pixels (256–3200). 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. Use a new seed when editing a previous output again.", "title": "Seed", "x-sr-order": 501 }, "negative_prompt": { "anyOf": [ { "maxLength": 10000, "type": "string" }, { "type": "null" } ], "description": "What to keep out of the image. Used by the berry variant only.", "title": "Negative Prompt", "x-sr-order": 202 }, "output_format": { "default": "png", "description": "Output image format.", "enum": [ "png", "jpeg" ], "title": "Output Format", "type": "string", "x-sr-order": 405 }, "reasoning_level": { "default": "medium", "description": "How much effort is spent reasoning about the prompt before generating. Higher levels are slower. Does not affect price.", "enum": [ "low", "medium" ], "title": "Reasoning Level", "type": "string", "x-sr-order": 404 }, "variant": { "default": "berry", "description": "Model variant: berry favors quality, jam favors speed. Does not affect price.", "enum": [ "berry", "jam" ], "title": "Variant", "type": "string", "x-sr-order": 403 } }, "required": [ "prompt" ], "title": "TextToImageInput", "type": "object" } ``` ### Model output schema The model output schema is: ```json { "description": "Krea 3 output with the final USD amount for per-megapixel 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 ($0.025 x billed megapixels).", "title": "Units", "type": "number" } }, "required": [ "images", "units" ], "title": "ImageGenerationOutput", "type": "object" } ``` ## Example inputs and outputs Use the following example inputs and outputs to understand the model. ### Input example ```json { "prompt": "", "width": null, "height": null, "seed": null, "negative_prompt": null, "output_format": "png", "reasoning_level": "medium", "variant": "berry" } ``` ### Output example ```json { } ``` ## Model code examples ### JavaScript ```javascript import { sunra } from "@sunra/client"; const result = await sunra.subscribe("krea/krea-3/text-to-image", { input: { prompt: '', negative_prompt: null, width: null, height: null, variant: 'berry', output_format: 'png', seed: null, reasoning_level: 'medium' }, 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( "krea/krea-3/text-to-image", arguments={ "prompt": "", "negative_prompt": None, "width": None, "height": None, "variant": "berry", "output_format": "png", "seed": None, "reasoning_level": "medium" }, 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( "krea/krea-3/text-to-image", SubscribeOptions.builder() .input(Map.of( "prompt", "", "negative_prompt", null, "width", null, "height", null, "variant", "berry", "output_format", "png", "seed", null, "reasoning_level", "medium")) .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 = "krea/krea-3/text-to-image", input = mapOf( "prompt" to "", "negative_prompt" to null, "width" to null, "height" to null, "variant" to "berry", "output_format" to "png", "seed" to null, "reasoning_level" to "medium"), 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/krea/krea-3/text-to-image \ --header "Authorization: Key $SUNRA_KEY" \ --header "Content-Type: application/json" \ --data '{"prompt":"","negative_prompt":null,"width":null,"height":null,"variant":"berry","output_format":"png","seed":null,"reasoning_level":"medium"}' ``` ## Model readme undefined