## Basic model info - Model name: midjourney/midjourney v8.2 - Model description: Generate and edit images with Midjourney v8.2. - Endpoint name: text-to-image ## Model schema The model schema is defined in the OpenAPI schema: [OpenAPI Schema](https://oapi.sunra.ai/main/midjourney/v8.2/latest.json) ### Model input schema The model input schema is: ```json { "description": "Input model for Midjourney v8.2 image generation.", "properties": { "prompt": { "description": "The text prompt for image generation. Inline -- parameters are ignored: the prompt is truncated at the first flag-like token. Use structured fields to set parameters. Curly braces/permutations are unsupported.", "pattern": "^(?:[^{}]*)$(?![\\s\\S])", "title": "Prompt", "type": "string", "x-sr-order": 201 }, "aspect_ratio": { "anyOf": [ { "maxLength": 7, "pattern": "^(?![\\s\\S]*(?:-[­͏؀-؅؜۝܏࢐-࢑࣢᠎​-‏‪-‮⁠-⁤⁦--𑂽𑃍𓐰-𓐿𛲠-𛲣𝅳-𝅺󠀁󠀠-󠁿]*-[­͏؀-؅؜۝܏࢐-࢑࣢᠎​-‏‪-‮⁠-⁤⁦--𑂽𑃍𓐰-𓐿𛲠-𛲣𝅳-𝅺󠀁󠀠-󠁿]*[A-Za-z]|(? { 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( "midjourney/v8.2/text-to-image", arguments={ "prompt": "", "image_references": None, "aspect_ratio": None, "hd": False, "stylize": None, "style": None, "exp": None, "chaos": None, "weird": None, "seed": None, "stop": None, "tile": None, "sref": None, "style_weight": None, "sv": None, "personalize": None, "image_weight": 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( "midjourney/v8.2/text-to-image", SubscribeOptions.builder() .input(Map.of( "prompt", "", "image_references", null, "aspect_ratio", null, "hd", false, "stylize", null, "style", null, "exp", null, "chaos", null, "weird", null, "seed", null, "stop", null, "tile", null, "sref", null, "style_weight", null, "sv", null, "personalize", null, "image_weight", 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 = "midjourney/v8.2/text-to-image", input = mapOf( "prompt" to "", "image_references" to null, "aspect_ratio" to null, "hd" to false, "stylize" to null, "style" to null, "exp" to null, "chaos" to null, "weird" to null, "seed" to null, "stop" to null, "tile" to null, "sref" to null, "style_weight" to null, "sv" to null, "personalize" to null, "image_weight" 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/midjourney/v8.2/text-to-image \ --header "Authorization: Key $SUNRA_KEY" \ --header "Content-Type: application/json" \ --data '{"prompt":"","image_references":null,"aspect_ratio":null,"hd":false,"stylize":null,"style":null,"exp":null,"chaos":null,"weird":null,"seed":null,"stop":null,"tile":null,"sref":null,"style_weight":null,"sv":null,"personalize":null,"image_weight":null}' ``` ## Model readme >