# Topaz Upscale Image > Upscale and enhance your images using a variety of powerful AI models. Increase resolution up to 4x, restore details, and use specialized modes for photos, CGI, and text, with optional face enhancement for professional-quality results. ## Overview - **Endpoint**: `https://queue.modelrunner.run/topazlabs/upscale/image` - **Model ID**: `topazlabs/upscale/image` - **Category**: upscaler - **Kind**: inference - **Tags**: image-to-image ## Pricing - **up to 24 megapixels**: $0.08 - **up to 48 megapixels**: $0.16 - **up to 96 megapixels**: $0.32 - **up to 512 megapixels**: $1.36 ## Request Lifecycle This model runs on the ModelRunner **asynchronous queue API** — a single POST does not return the output. Every call requires an `Authorization: Key $MODEL_RUNNER_KEY` header. Run three steps: 1. **Submit** — `POST https://queue.modelrunner.run/topazlabs/upscale/image` with a JSON body holding the input fields at the top level. The body may also include a reserved top-level `metadata` object — a flat string map (max 16 keys, key ≤64 / value ≤512 chars) stored on the request for your own tagging. It is never sent to the model; filter your request history with `GET https://queue.modelrunner.run/requests?metadata=` (exact key=value matches, AND-ed). The response carries request handles only (no output yet): ```json { "status": "IN_QUEUE", "request_id": "<21-char id>", "status_url": "https://queue.modelrunner.run/topazlabs/upscale/image/requests//status", "response_url": "https://queue.modelrunner.run/topazlabs/upscale/image/requests/", "cancel_url": "https://queue.modelrunner.run/topazlabs/upscale/image/requests//cancel" } ``` 2. **Poll status** — `GET ` until `status` is `COMPLETED`. Possible values are `IN_QUEUE`, `IN_PROGRESS`, `COMPLETED`, `FAILED`, `CANCELLED`. A `FAILED` request responds with HTTP 400 and an `error` field. 3. **Read result** — `GET `. Returns the finished request, including the generated `output`: ```json { "id": "", "status": "COMPLETED", "output": ..., "input": ... } ``` The JavaScript and Python SDKs below perform steps 2–3 for you. In any language without an SDK (Swift, Go, Kotlin, etc.) you must implement the polling loop and the final result fetch yourself — see the cURL example for the full flow. ### Input Schema - **`model`** (`Model`, _optional_): Model to use for image enhancement. - Default: `"Standard V2"` - Options: `"Low Resolution V2"`, `"Standard V2"`, `"CGI"`, `"High Fidelity V2"`, `"Text Refine"`, `"Recovery"`, `"Redefine"`, `"Recovery V2"` - **`image_url`** (`string`, _required_): Url of the image to be upscaled - **`crop_to_fill`** (`boolean`, _optional_): - Default: `false` - **`output_format`** (`OutputFormat`, _optional_): Output format of the upscaled image. - Default: `"jpeg"` - Options: `"jpeg"`, `"png"` - **`upscale_factor`** (`number`, _optional_): Factor to upscale the video by (e.g. 2.0 doubles width and height) - Default: `2` - Range: `1` to `4` - **`face_enhancement`** (`boolean`, _optional_): Whether to apply face enhancement to the image. - Default: `true` - **`subject_detection`** (`SubjectDetection`, _optional_): Subject detection mode for the image enhancement. - Default: `"All"` - Options: `"All"`, `"Foreground"`, `"Background"` - **`face_enhancement_strength`** (`number`, _optional_): Strength of the face enhancement. 0.0 means no enhancement, 1.0 means maximum enhancement. Ignored if face ehnancement is disabled. - Default: `0.8` - Range: `0` to `1` - **`face_enhancement_creativity`** (`number`, _optional_): Creativity level for face enhancement. 0.0 means no creativity, 1.0 means maximum creativity. Ignored if face ehnancement is disabled. - Default: `0` - Range: `0` to `1` ### Output Schema _No `Output` schema properties are available._ ## Usage Examples ### cURL The queue API is asynchronous: submit the request, poll `status_url` until it is `COMPLETED`, then read the result from `response_url`. Requires `jq`. ```bash # 1. Submit the request (returns request handles, not the output) SUBMIT=$(curl --silent --request POST \ --url https://queue.modelrunner.run/topazlabs/upscale/image \ --header "Authorization: Key $MODEL_RUNNER_KEY" \ --header "Content-Type: application/json" \ --data '{ "image_url": "" }') STATUS_URL=$(echo "$SUBMIT" | jq -r '.status_url') RESPONSE_URL=$(echo "$SUBMIT" | jq -r '.response_url') # 2. Poll until the request leaves the queue / in-progress state while true; do STATUS=$(curl --silent --url "$STATUS_URL" \ --header "Authorization: Key $MODEL_RUNNER_KEY" | jq -r '.status') echo "Status: $STATUS" case "$STATUS" in COMPLETED) break ;; FAILED|CANCELLED) echo "Request $STATUS"; exit 1 ;; esac sleep 1 done # 3. Read the finished request, including the generated output curl --silent --url "$RESPONSE_URL" \ --header "Authorization: Key $MODEL_RUNNER_KEY" ``` ### JavaScript ```javascript import { modelrunner } from "@modelrunner/client"; const result = await modelrunner.subscribe("topazlabs/upscale/image", { input: { "image_url": "" } }); console.log(result.data); ``` ### Python ```python import asyncio import modelrunner_ai async def main(): response = await modelrunner_ai.submit_async( "topazlabs/upscale/image", arguments={ "image_url": "" } ) result = await response.get() print(result["output"]) asyncio.run(main()) ``` ## Additional Resources - [Playground](https://modelrunner.ai/models/topazlabs/upscale/image) - [OpenAPI Schema](https://modelrunner.ai/models/topazlabs/upscale/image/openapi.json) - [LLM Instructions](https://modelrunner.ai/models/topazlabs/upscale/image/llms.txt)