## Basic model info - Model name: midjourney/midjourney v7-reverse - Model description: Generate and edit images with Midjourney v7 via reverse-engineered channel. - Endpoint name: text-to-image ## Model schema The model schema is defined in the OpenAPI schema: [OpenAPI Schema](https://oapi.sunra.ai/main/midjourney/v7-reverse/latest.json) ### Model input schema The model input schema is: ```json { "description": "Input model for text-to-image generation.", "properties": { "prompt": { "description": "The text prompt for image generation", "title": "Prompt", "type": "string", "x-sr-order": 201 }, "aspect_ratio": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "description": "(`--ar`) Image aspect ratio, e.g. '1:1', '16:9', '9:16', '3:4', '4:3', '2:3', '3:2'", "title": "Aspect Ratio", "x-sr-order": 401 }, "seed": { "anyOf": [ { "maximum": 4294967295, "minimum": 0, "type": "integer" }, { "type": "null" } ], "description": "(`--seed`) Seed number for reproducible results. Same seed + prompt produces similar images", "title": "Seed", "x-sr-order": 407 }, "negative_prompt": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "description": "(`--no`) Elements to exclude from the image, e.g. 'text, watermark, blurry'", "title": "Negative Prompt", "x-sr-order": 410 }, "chaos": { "anyOf": [ { "maximum": 100, "minimum": 0, "type": "integer" }, { "type": "null" } ], "description": "(`--chaos`) How varied the four initial results will be. Range 0–100. Higher values produce more unusual, unexpected compositions", "title": "Chaos", "x-sr-order": 405 }, "exp": { "anyOf": [ { "maximum": 100, "minimum": 0, "type": "integer" }, { "type": "null" } ], "description": "(`--exp`) Enhanced detail level. Range 0–100, sweet spot 10–25. Increases prompt adherence and fine detail", "title": "Exp", "x-sr-order": 404 }, "image_references": { "anyOf": [ { "items": { "anyOf": [ { "format": "uri", "maxLength": 2083, "minLength": 1, "type": "string" }, { "type": "string" } ] }, "type": "array" }, { "type": "null" } ], "description": "Reference images for image prompting (垫图). Provide 1–5 image URLs to visually influence the generation", "title": "Image References", "x-sr-order": 301 }, "image_weight": { "anyOf": [ { "maximum": 3, "minimum": 0, "type": "number" }, { "type": "null" } ], "description": "(`--iw`) How strongly reference images (image_references) influence the result. Range 0–3, default 1", "title": "Image Weight", "x-sr-order": 416 }, "mode": { "default": "fast", "description": "Generation mode: slow for higher quality, fast for quicker results, turbo for the fastest results", "enum": [ "slow", "fast", "turbo" ], "title": "Mode", "type": "string", "x-sr-order": 101 }, "omni_weight": { "anyOf": [ { "maximum": 1000, "minimum": 0, "type": "integer" }, { "type": "null" } ], "description": "(`--ow`) How strongly the omni reference influences the result. Range 0–1000, default 100", "title": "Omni Weight", "x-sr-order": 414 }, "oref": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "description": "(`--oref`) Omni reference URL: a single reference image that influences style, character, and composition simultaneously", "title": "Oref", "x-sr-order": 413 }, "personalize": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "description": "(`--p`) Personalization profile code to apply your custom aesthetic preferences. Leave empty for default personalization", "title": "Personalize", "x-sr-order": 415 }, "sref": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "description": "(`--sref`) Style reference: URL of a reference image or a numeric sref code to apply its visual style", "title": "Sref", "x-sr-order": 411 }, "stop": { "anyOf": [ { "maximum": 100, "minimum": 10, "type": "integer" }, { "type": "null" } ], "description": "(`--stop`) Stop generation early at the specified percentage. Range 10–100", "title": "Stop", "x-sr-order": 408 }, "style": { "anyOf": [ { "const": "raw", "type": "string" }, { "type": "null" } ], "description": "(`--style`) Style preset: 'raw' reduces Midjourney's default beautification for more photographic results", "title": "Style", "x-sr-order": 403 }, "style_weight": { "anyOf": [ { "maximum": 1000, "minimum": 0, "type": "integer" }, { "type": "null" } ], "description": "(`--sw`) How strongly the style reference (sref) influences the result. Range 0–1000, default 100", "title": "Style Weight", "x-sr-order": 412 }, "stylize": { "anyOf": [ { "maximum": 1000, "minimum": 0, "type": "integer" }, { "type": "null" } ], "description": "(`--stylize`) How strongly Midjourney's default aesthetic is applied. Range 0–1000, default 100. Higher values produce more artistic results", "title": "Stylize", "x-sr-order": 402 }, "tile": { "anyOf": [ { "type": "boolean" }, { "type": "null" } ], "description": "(`--tile`) Generate seamlessly tiling patterns, useful for textures and wallpapers", "title": "Tile", "x-sr-order": 409 }, "weird": { "anyOf": [ { "maximum": 3000, "minimum": 0, "type": "integer" }, { "type": "null" } ], "description": "(`--weird`) Injects quirky and offbeat qualities into images. Range 0–3000", "title": "Weird", "x-sr-order": 406 } }, "required": [ "prompt" ], "title": "TextToImageInput", "type": "object" } ``` ### Model output schema The model output schema is: ```json { "properties": { "action_type": { "title": "Action Type", "type": "string" }, "images": { "items": { "properties": { "actions": { "items": { "properties": { "custom_id": { "title": "Custom Id", "type": "string" }, "label": { "title": "Label", "type": "string" }, "task_id": { "title": "Task Id", "type": "string" } }, "required": [ "task_id", "custom_id", "label" ], "title": "ImageS1OutputActionItem", "type": "object" }, "title": "Actions", "type": "array" }, "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", "actions" ], "title": "ImageS1ImageOutputItem", "type": "object" }, "title": "Images", "type": "array" }, "mode": { "title": "Mode", "type": "string" }, "units_used": { "title": "Units Used", "type": "integer" } }, "required": [ "images", "action_type", "mode", "units_used" ], "title": "ImageS1Output", "type": "object" } ``` ## Example inputs and outputs Use the following example inputs and outputs to understand the model. ### Input example ```json { "prompt": "", "aspect_ratio": null, "seed": null, "negative_prompt": null, "chaos": null, "exp": null, "image_references": null, "image_weight": null, "mode": "fast", "omni_weight": null, "oref": null, "personalize": null, "sref": null, "stop": null, "style": null, "style_weight": null, "stylize": null, "tile": null, "weird": null } ``` ### Output example ```json { } ``` ## Model code examples ### JavaScript ```javascript import { sunra } from "@sunra/client"; const result = await sunra.subscribe("midjourney/v7-reverse/text-to-image", { input: { prompt: '', mode: 'fast', image_references: null, aspect_ratio: null, stylize: null, style: null, exp: null, chaos: null, weird: null, seed: null, stop: null, tile: null, negative_prompt: null, sref: null, style_weight: null, oref: null, omni_weight: null, personalize: null, image_weight: 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( "midjourney/v7-reverse/text-to-image", arguments={ "prompt": "", "mode": "fast", "image_references": None, "aspect_ratio": None, "stylize": None, "style": None, "exp": None, "chaos": None, "weird": None, "seed": None, "stop": None, "tile": None, "negative_prompt": None, "sref": None, "style_weight": None, "oref": None, "omni_weight": 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/v7-reverse/text-to-image", SubscribeOptions.builder() .input(Map.of( "prompt", "", "mode", "fast", "image_references", null, "aspect_ratio", null, "stylize", null, "style", null, "exp", null, "chaos", null, "weird", null, "seed", null, "stop", null, "tile", null, "negative_prompt", null, "sref", null, "style_weight", null, "oref", null, "omni_weight", 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/v7-reverse/text-to-image", input = mapOf( "prompt" to "", "mode" to "fast", "image_references" to null, "aspect_ratio" to null, "stylize" to null, "style" to null, "exp" to null, "chaos" to null, "weird" to null, "seed" to null, "stop" to null, "tile" to null, "negative_prompt" to null, "sref" to null, "style_weight" to null, "oref" to null, "omni_weight" 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/v7-reverse/text-to-image \ --header "Authorization: Key $SUNRA_KEY" \ --header "Content-Type: application/json" \ --data '{"prompt":"","mode":"fast","image_references":null,"aspect_ratio":null,"stylize":null,"style":null,"exp":null,"chaos":null,"weird":null,"seed":null,"stop":null,"tile":null,"negative_prompt":null,"sref":null,"style_weight":null,"oref":null,"omni_weight":null,"personalize":null,"image_weight":null}' ``` ## Model readme >