## Basic model info - Model name: topazlabs/topazlabs image-upscaler - Model description: Use the powerful and accurate Topaz image enhancer to enhance your images. - Endpoint name: image-upscale ## Model schema The model schema is defined in the OpenAPI schema: [OpenAPI Schema](https://oapi.sunra.ai/main/topazlabs/image-upscaler/latest.json) ### Model input schema The model input schema is: ```json { "properties": { "prompt": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "description": "Text prompt to guide generative upscaling (max 1024 chars). Applies to Redefine model only.", "title": "Prompt", "x-sr-order": 408 }, "autoprompt": { "anyOf": [ { "type": "boolean" }, { "type": "null" } ], "description": "Enable automatic prompt generation for generative upscaling. Applies to Redefine model only.", "title": "Autoprompt", "x-sr-order": 409 }, "creativity": { "anyOf": [ { "maximum": 6, "minimum": 1, "type": "integer" }, { "type": "null" } ], "description": "Creativity level for generative upscaling (1–6). Applies to Redefine model only.", "title": "Creativity", "x-sr-order": 406 }, "crop_to_fill": { "default": false, "description": "Whether to crop the output to fill the target dimensions.", "title": "Crop To Fill", "type": "boolean", "x-sr-order": 404 }, "denoise": { "anyOf": [ { "maximum": 1, "minimum": 0, "multipleOf": 0.01, "type": "number" }, { "type": "null" } ], "description": "Denoising level (0–1). Applies to Standard V2, Low Resolution V2, CGI, High Fidelity V2, Text Refine, and Redefine", "title": "Denoise", "x-sr-order": 402 }, "enhance_model": { "default": "Standard V2", "description": "Enhancement model: Standard V2 (general purpose), Low Resolution V2 (for low-res inputs), CGI (for digital art/renders), High Fidelity V2 (preserves fine details), Text Refine (optimized for text and documents), Recovery (restore damaged images), Recovery V2 (improved recovery with subject detection), Redefine (generative AI upscaling), Standard MAX (maximum quality standard), Wonder (creative enhancement)", "enum": [ "Standard V2", "Low Resolution V2", "CGI", "High Fidelity V2", "Text Refine", "Recovery", "Recovery V2", "Redefine", "Standard MAX", "Wonder" ], "title": "Enhance Model", "type": "string", "x-sr-order": 301 }, "face_enhancement": { "default": true, "description": "Apply AI face enhancement. Applies to Standard, Low Resolution, CGI, High Fidelity, and Recovery V2 models", "title": "Face Enhancement", "type": "boolean", "x-sr-order": 304 }, "face_enhancement_creativity": { "default": 0, "description": "Creativity level for face enhancement (0–1). Ignored if face_enhancement is disabled", "maximum": 1, "minimum": 0, "multipleOf": 0.01, "title": "Face Enhancement Creativity", "type": "number", "x-sr-order": 305 }, "face_enhancement_strength": { "default": 0.8, "description": "How sharp enhanced faces appear relative to the background (0–1). Ignored if face_enhancement is disabled", "maximum": 1, "minimum": 0, "multipleOf": 0.01, "title": "Face Enhancement Strength", "type": "number", "x-sr-order": 306 }, "fix_compression": { "anyOf": [ { "maximum": 1, "minimum": 0, "multipleOf": 0.01, "type": "number" }, { "type": "null" } ], "description": "Compression artifact removal level (0–1). Applies to Standard V2, Low Resolution V2, High Fidelity V2, and Text Refine", "title": "Fix Compression", "x-sr-order": 403 }, "image": { "anyOf": [ { "format": "uri", "maxLength": 2083, "minLength": 1, "type": "string" }, { "type": "string" } ], "description": "Image to enhance", "title": "Image", "x-sr-order": 201 }, "output_format": { "default": "jpeg", "description": "Output image format", "enum": [ "jpeg", "jpg", "png" ], "title": "Output Format", "type": "string", "x-sr-order": 404 }, "sharpen": { "anyOf": [ { "maximum": 1, "minimum": 0, "multipleOf": 0.01, "type": "number" }, { "type": "null" } ], "description": "Sharpening level (0–1). Applies to Standard V2, Low Resolution V2, CGI, High Fidelity V2, Text Refine, and Redefine", "title": "Sharpen", "x-sr-order": 401 }, "strength": { "anyOf": [ { "maximum": 1, "minimum": 0.01, "multipleOf": 0.01, "type": "number" }, { "type": "null" } ], "description": "Enhancement strength (0.01–1). Applies to Text Refine model only.", "title": "Strength", "x-sr-order": 405 }, "subject_detecting": { "default": "None", "description": "Subject detection mode. None/All = process entire image, Foreground = enhance foreground only, Background = enhance background only", "enum": [ "None", "All", "Foreground", "Background" ], "title": "Subject Detecting", "type": "string", "x-sr-order": 303 }, "texture": { "anyOf": [ { "maximum": 5, "minimum": 1, "type": "integer" }, { "type": "null" } ], "description": "Texture detail level for generative upscaling (1–5). Applies to Redefine model only.", "title": "Texture", "x-sr-order": 407 }, "upscale_factor": { "anyOf": [ { "enum": [ "None", "2x", "4x" ], "type": "string" }, { "maximum": 4, "minimum": 1, "type": "number" } ], "default": "None", "description": "How much to upscale the image. None = enhance only (no resize), 2x = double resolution, 4x = quadruple resolution, or a float between 1.0–4.0", "title": "Upscale Factor", "x-sr-order": 302 } }, "required": [ "image" ], "title": "ImageUpscalerInput", "type": "object" } ``` ### Model output schema The model output schema is: ```json { "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" }, "output_pixel_count": { "title": "Output Pixel Count", "type": "integer" }, "units": { "title": "Units", "type": "number" } }, "required": [ "image", "output_pixel_count", "units" ], "title": "ImageUpscalerOutput", "type": "object" } ``` ## Example inputs and outputs Use the following example inputs and outputs to understand the model. ### Input example ```json { "prompt": null, "autoprompt": null, "creativity": null, "crop_to_fill": false, "denoise": null, "enhance_model": "Standard V2", "face_enhancement": true, "face_enhancement_creativity": 0, "face_enhancement_strength": 0.8, "fix_compression": null, "image": "", "output_format": "jpeg", "sharpen": null, "strength": null, "subject_detecting": "None", "texture": null, "upscale_factor": "None" } ``` ### Output example ```json { } ``` ## Model code examples ### JavaScript ```javascript import { sunra } from "@sunra/client"; const result = await sunra.subscribe("topazlabs/image-upscaler/image-upscale", { input: { image: '', enhance_model: 'Standard V2', upscale_factor: 'None', subject_detecting: 'None', face_enhancement: true, face_enhancement_creativity: 0, face_enhancement_strength: 0.8, sharpen: null, denoise: null, fix_compression: null, crop_to_fill: false, strength: null, creativity: null, texture: null, prompt: null, autoprompt: null, output_format: 'jpeg' }, 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( "topazlabs/image-upscaler/image-upscale", arguments={ "image": "", "enhance_model": "Standard V2", "upscale_factor": "None", "subject_detecting": "None", "face_enhancement": True, "face_enhancement_creativity": 0, "face_enhancement_strength": 0.8, "sharpen": None, "denoise": None, "fix_compression": None, "crop_to_fill": False, "strength": None, "creativity": None, "texture": None, "prompt": None, "autoprompt": None, "output_format": "jpeg" }, 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( "topazlabs/image-upscaler/image-upscale", SubscribeOptions.builder() .input(Map.of( "image", "", "enhance_model", "Standard V2", "upscale_factor", "None", "subject_detecting", "None", "face_enhancement", true, "face_enhancement_creativity", 0, "face_enhancement_strength", 0.8, "sharpen", null, "denoise", null, "fix_compression", null, "crop_to_fill", false, "strength", null, "creativity", null, "texture", null, "prompt", null, "autoprompt", null, "output_format", "jpeg")) .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 = "topazlabs/image-upscaler/image-upscale", input = mapOf( "image" to "", "enhance_model" to "Standard V2", "upscale_factor" to "None", "subject_detecting" to "None", "face_enhancement" to true, "face_enhancement_creativity" to 0, "face_enhancement_strength" to 0.8, "sharpen" to null, "denoise" to null, "fix_compression" to null, "crop_to_fill" to false, "strength" to null, "creativity" to null, "texture" to null, "prompt" to null, "autoprompt" to null, "output_format" to "jpeg"), 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/topazlabs/image-upscaler/image-upscale \ --header "Authorization: Key $SUNRA_KEY" \ --header "Content-Type: application/json" \ --data '{"image":"","enhance_model":"Standard V2","upscale_factor":"None","subject_detecting":"None","face_enhancement":true,"face_enhancement_creativity":0,"face_enhancement_strength":0.8,"sharpen":null,"denoise":null,"fix_compression":null,"crop_to_fill":false,"strength":null,"creativity":null,"texture":null,"prompt":null,"autoprompt":null,"output_format":"jpeg"}' ``` ## Model readme undefined