## Basic model info - Model name: ideogram/ideogram ideogram-v4 - Model description: Generate high-quality images, posters, and logos with Ideogram V4 — native 2K resolution, exceptional typography and text rendering, and full creative control for polished, ready-to-use designs. - Endpoint name: text-to-image ## Model schema The model schema is defined in the OpenAPI schema: [OpenAPI Schema](https://oapi.sunra.ai/main/ideogram/ideogram-v4/latest.json) ### Model input schema The model input schema is: ```json { "description": "Input schema for Ideogram V4 text-to-image generation.", "properties": { "prompt": { "description": "Text prompt for image generation", "title": "Prompt", "type": "string", "x-sr-order": 201 }, "aspect_ratio": { "default": "1:1", "description": "Aspect ratio of the generated image. Used together with `resolution` unless custom `width`/`height` are provided.", "enum": [ "1:1", "4:3", "3:4", "16:9", "9:16" ], "title": "Aspect Ratio", "type": "string", "x-sr-order": 401 }, "width": { "anyOf": [ { "maximum": 14142, "minimum": 1, "type": "integer" }, { "type": "null" } ], "description": "Custom output width in pixels. When both `width` and `height` are set, they override `aspect_ratio`/`resolution`.", "title": "Width", "x-sr-order": 403 }, "height": { "anyOf": [ { "maximum": 14142, "minimum": 1, "type": "integer" }, { "type": "null" } ], "description": "Custom output height in pixels. When both `width` and `height` are set, they override `aspect_ratio`/`resolution`.", "title": "Height", "x-sr-order": 404 }, "seed": { "anyOf": [ { "maximum": 2147483647, "minimum": 0, "type": "integer" }, { "type": "null" } ], "description": "Random seed for reproducibility", "title": "Seed", "x-sr-order": 502 }, "acceleration": { "default": "none", "description": "Inference acceleration level", "enum": [ "none", "low", "regular", "high" ], "title": "Acceleration", "type": "string", "x-sr-order": 408 }, "number_of_images": { "default": 1, "description": "Number of images to generate", "maximum": 8, "minimum": 1, "title": "Number Of Images", "type": "integer", "x-sr-order": 405 }, "output_format": { "default": "jpeg", "description": "Output image format", "enum": [ "jpeg", "png" ], "title": "Output Format", "type": "string", "x-sr-order": 501 }, "prompt_enhancer_effort": { "default": "Medium", "description": "Effort level for the prompt enhancer. 'Medium' is fast; 'Large' uses the highest-quality Magic Prompt.", "enum": [ "Medium", "Large" ], "title": "Prompt Enhancer Effort", "type": "string", "x-sr-order": 407 }, "rendering_speed": { "default": "BALANCED", "description": "Rendering speed / quality tier", "enum": [ "TURBO", "BALANCED", "QUALITY" ], "title": "Rendering Speed", "type": "string", "x-sr-order": 406 }, "resolution": { "default": "1K", "description": "Target resolution (long edge ≈ 1K/2K/4K). Used together with `aspect_ratio` unless custom `width`/`height` are provided.", "enum": [ "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" } }, "required": [ "images" ], "title": "ImagesOutput", "type": "object" } ``` ## Example inputs and outputs Use the following example inputs and outputs to understand the model. ### Input example ```json { "prompt": "", "aspect_ratio": "1:1", "width": null, "height": null, "seed": null, "acceleration": "none", "number_of_images": 1, "output_format": "jpeg", "prompt_enhancer_effort": "Medium", "rendering_speed": "BALANCED", "resolution": "1K" } ``` ### Output example ```json { } ``` ## Model code examples ### JavaScript ```javascript import { sunra } from "@sunra/client"; const result = await sunra.subscribe("ideogram/ideogram-v4/text-to-image", { input: { prompt: '', aspect_ratio: '1:1', resolution: '1K', width: null, height: null, number_of_images: 1, rendering_speed: 'BALANCED', prompt_enhancer_effort: 'Medium', acceleration: 'none', output_format: 'jpeg', 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( "ideogram/ideogram-v4/text-to-image", arguments={ "prompt": "", "aspect_ratio": "1:1", "resolution": "1K", "width": None, "height": None, "number_of_images": 1, "rendering_speed": "BALANCED", "prompt_enhancer_effort": "Medium", "acceleration": "none", "output_format": "jpeg", "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( "ideogram/ideogram-v4/text-to-image", SubscribeOptions.builder() .input(Map.of( "prompt", "", "aspect_ratio", "1:1", "resolution", "1K", "width", null, "height", null, "number_of_images", 1, "rendering_speed", "BALANCED", "prompt_enhancer_effort", "Medium", "acceleration", "none", "output_format", "jpeg", "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 = "ideogram/ideogram-v4/text-to-image", input = mapOf( "prompt" to "", "aspect_ratio" to "1:1", "resolution" to "1K", "width" to null, "height" to null, "number_of_images" to 1, "rendering_speed" to "BALANCED", "prompt_enhancer_effort" to "Medium", "acceleration" to "none", "output_format" to "jpeg", "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/ideogram/ideogram-v4/text-to-image \ --header "Authorization: Key $SUNRA_KEY" \ --header "Content-Type: application/json" \ --data '{"prompt":"","aspect_ratio":"1:1","resolution":"1K","width":null,"height":null,"number_of_images":1,"rendering_speed":"BALANCED","prompt_enhancer_effort":"Medium","acceleration":"none","output_format":"jpeg","seed":null}' ``` ## Model readme undefined