## Basic model info - Model name: bria/bria fibo-2 - Model description: Bria FIBO 2 generates and edits images through VGL, a structured JSON scene description that is returned with every image so a result can be reproduced or refined field by field. text-to-image works from a prompt, a reference image or a VGL document, in 21 aspect ratios at about one megapixel, with four photographic style presets; edit follows a plain-language instruction across up to four images, optionally limited to a mask. Trained on licensed data. $0.04 per image. - Endpoint name: text-to-image ## Model schema The model schema is defined in the OpenAPI schema: [OpenAPI Schema](https://oapi.sunra.ai/main/bria/fibo-2/latest.json) ### Model input schema The model input schema is: ```json { "description": "Input schema for FIBO 2 image generation.", "properties": { "prompt": { "anyOf": [ { "maxLength": 4000, "type": "string" }, { "type": "null" } ], "description": "What to generate, in free-form English. FIBO 2 expands it into a structured scene description (VGL) that is returned with the image. With vgl, it is the change to make to that scene. Required unless vgl or reference_image is given.", "title": "Prompt", "x-sr-order": 201 }, "aspect_ratio": { "default": "1:1", "description": "Aspect ratio of the image. Output is about one megapixel at every ratio.", "enum": [ "1:1", "1:2", "1:3", "1:4", "1:5", "2:1", "2:3", "3:1", "3:2", "3:4", "4:1", "4:3", "4:5", "5:1", "5:4", "9:16", "9:21", "10:16", "16:9", "16:10", "21:9" ], "title": "Aspect Ratio", "type": "string", "x-sr-order": 401 }, "seed": { "anyOf": [ { "maximum": 2147483647, "minimum": 0, "type": "integer" }, { "type": "null" } ], "description": "Random seed for reproducibility (the model uses 5555 when omitted).", "title": "Seed", "x-sr-order": 501 }, "reference_image": { "anyOf": [ { "format": "uri", "maxLength": 2083, "minLength": 1, "type": "string" }, { "type": "string" }, { "type": "null" } ], "description": "Optional reference image (public URL) to draw inspiration from. With a prompt, the model generates a new image of the prompt's scene in the reference's look; on its own, it generates a new image inspired by the reference.", "title": "Reference Image", "x-sr-order": 301 }, "style": { "anyOf": [ { "enum": [ "Kodak Film", "Hard Flash", "Hazy Dreamy", "Rough Realism" ], "type": "string" }, { "type": "null" } ], "description": "Optional photographic style preset. Requires a prompt; cannot be combined with reference_image or vgl.", "title": "Style", "x-sr-order": 402 }, "vgl": { "anyOf": [ { "additionalProperties": true, "type": "object" }, { "type": "null" } ], "description": "Advanced: a VGL (Visual Generation Language) scene description, usually the vgl returned by a previous request. On its own it is rendered as-is; with a prompt it is refined by the prompt first.", "title": "Vgl", "x-sr-order": 403 } }, "title": "TextToImageInput", "type": "object" } ``` ### Model output schema The model output schema is: ```json { "anyOf": [ { "description": "Generated image plus the VGL scene description it was rendered from.", "properties": { "image": { "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" }, "vgl": { "anyOf": [ { "additionalProperties": true, "type": "object" }, { "type": "null" } ], "description": "VGL the image was rendered from; send it back as vgl to reproduce or refine the image.", "title": "Vgl" } }, "required": [ "image" ], "title": "TextToImageOutput", "type": "object" }, { "description": "Edited image plus the VGL the edit ran.", "properties": { "image": { "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" }, "vgl": { "anyOf": [ { "additionalProperties": true, "type": "object" }, { "type": "null" } ], "description": "VGL the edit ran, including its edit_instruction; send it back as vgl to reproduce the edit.", "title": "Vgl" } }, "required": [ "image" ], "title": "EditOutput", "type": "object" } ], "title": "Response Get Request Result Requests Request Id Get" } ``` ## Example inputs and outputs Use the following example inputs and outputs to understand the model. ### Input example ```json { "prompt": null, "aspect_ratio": "1:1", "seed": null, "reference_image": null, "style": null, "vgl": null } ``` ### Output example ```json { } ``` ## Model code examples ### JavaScript ```javascript import { sunra } from "@sunra/client"; const result = await sunra.subscribe("bria/fibo-2/text-to-image", { input: { prompt: null, reference_image: null, aspect_ratio: '1:1', style: null, vgl: null, seed: 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( "bria/fibo-2/text-to-image", arguments={ "prompt": None, "reference_image": None, "aspect_ratio": "1:1", "style": None, "vgl": None, "seed": 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( "bria/fibo-2/text-to-image", SubscribeOptions.builder() .input(Map.of( "prompt", null, "reference_image", null, "aspect_ratio", "1:1", "style", null, "vgl", null, "seed", 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 = "bria/fibo-2/text-to-image", input = mapOf( "prompt" to null, "reference_image" to null, "aspect_ratio" to "1:1", "style" to null, "vgl" to null, "seed" 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/bria/fibo-2/text-to-image \ --header "Authorization: Key $SUNRA_KEY" \ --header "Content-Type: application/json" \ --data '{"prompt":null,"reference_image":null,"aspect_ratio":"1:1","style":null,"vgl":null,"seed":null}' ``` ## Model readme >