> For the complete documentation index, see [llms.txt](https://developer.topazlabs.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://developer.topazlabs.com/image-models/upscaling-and-enhancement/generative.md).

# Generative Upscaling

Generative Upscaling for Images

* **Mixed, light-to-moderate problems.** Some noise, some softness, some compression, fixed in a single pass that also upscales.
* **One request instead of a pipeline.** Replace a chained Denoise → Sharpen → Upscale workflow with one Wonder call for most real-world photos.
* **Old and low-quality photos.** Restore natural, non-synthetic detail in sources that conventional upscaling can't improve.
* **Severe single problems.** Step to the dedicated model when one issue dominates: Denoise Max for heavy noise, Super Focus 3 for heavy blur, Dust & Scratch 2 for physical damage, Face Recovery 3 for faces, Recover 3 for almost-no-detail sources. Run it first, then Wonder.

{% hint style="success" %}
We recommend using **Wonder 4** for generative upscaling.
{% endhint %}

<table data-view="cards"><thead><tr><th></th><th></th><th data-hidden data-card-cover data-type="image">Cover image</th><th data-hidden data-card-target data-type="content-ref"></th></tr></thead><tbody><tr><td><strong>Wonder 4</strong></td><td>Our most advanced generative upscaler. Fixes noise, blur, and compression in one pass.</td><td><a href="https://938351258-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fik4tc42rkpL9SRR51NLK%2Fuploads%2Fu1ynI20dyDUh6nH5LQcP%2FWonder4_ex5-fur_slider.jpg?alt=media&amp;token=98581f32-df16-45b1-a010-e6b6eae122d6">Wonder4_ex5-fur_slider.jpg</a></td><td><a href="https://developer.topazlabs.com/image-models/upscaling-and-enhancement/generative/wonder-4.md">Wonder 4</a></td></tr><tr><td><strong>Recover 3</strong></td><td>Recovers natural detail in heavily degraded, very low-resolution photos.</td><td><a href="https://4007072434-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FJkSwaYgAsTQke14gpXAF%2Fuploads%2FvRLzvnBPMlTOFNle90E3%2FRecover_3_(Ex_1)_slider.jpg?alt=media&#x26;token=bcc3eb1b-1493-491e-a0b7-7aa16b0bea0a">https://4007072434-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FJkSwaYgAsTQke14gpXAF%2Fuploads%2FvRLzvnBPMlTOFNle90E3%2FRecover_3_(Ex_1)_slider.jpg?alt=media&#x26;token=bcc3eb1b-1493-491e-a0b7-7aa16b0bea0a</a></td><td><a href="https://developer.topazlabs.com/image-models/upscaling-and-enhancement/generative/recover-3.md">Recover 3</a></td></tr><tr><td><strong>Redefine</strong></td><td>Prompt, creativity, and texture controls over how much is regenerated.</td><td><a href="https://4007072434-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FJkSwaYgAsTQke14gpXAF%2Fuploads%2FqF9NHT6FpcaYWbLlp7CY%2FRedefine_Realistic_-_Creative_(Ex_1)_slider.jpg?alt=media&#x26;token=fdf2e41d-e6d9-4b44-8dbb-07f0ced617c5">https://4007072434-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FJkSwaYgAsTQke14gpXAF%2Fuploads%2FqF9NHT6FpcaYWbLlp7CY%2FRedefine_Realistic_-_Creative_(Ex_1)_slider.jpg?alt=media&#x26;token=fdf2e41d-e6d9-4b44-8dbb-07f0ced617c5</a></td><td><a href="https://developer.topazlabs.com/image-models/upscaling-and-enhancement/generative/redefine.md">Redefine</a></td></tr><tr><td><strong>Standard Max</strong></td><td>Faster generative upscaling with natural results.</td><td><a href="https://4007072434-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FJkSwaYgAsTQke14gpXAF%2Fuploads%2FBYjkdCtmh1TYSyHYbU4P%2FStandard_Max_(Ex_1)_slider.jpg?alt=media&#x26;token=829b74b4-8d6a-47a4-8eb0-684bb85552eb">https://4007072434-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FJkSwaYgAsTQke14gpXAF%2Fuploads%2FBYjkdCtmh1TYSyHYbU4P%2FStandard_Max_(Ex_1)_slider.jpg?alt=media&#x26;token=829b74b4-8d6a-47a4-8eb0-684bb85552eb</a></td><td><a href="https://developer.topazlabs.com/image-models/upscaling-and-enhancement/generative/standard-max.md">Standard Max</a></td></tr></tbody></table>

{% hint style="warning" %}
Wonder 1, Wonder 2, Wonder 3, Wonder 3.5, Recover 1, and Recover 2 are legacy models and are no longer recommended. Wonder 4 replaces Wonder 1, Wonder 2, Wonder 3, and Wonder 3.5. Recover 3 replaces Recover 1 and Recover 2. These models will be retired no sooner than December 9, 2026. See [Model Deprecations](https://developer.topazlabs.com/resources/model-deprecations.md) for dates and migration steps.
{% endhint %}

### Endpoints

| Endpoint                                               | Models                                      |
| ------------------------------------------------------ | ------------------------------------------- |
| `https://api.topazlabs.com/image/v1/enhance-gen/async` | Wonder 4, Recover 3, Redefine, Standard Max |

Requests are `multipart/form-data`. Pass the image as the `image` field (or reference a previous upload with `source_id` or `source_url`), set `model` to the value shown on the model's page, and set the output size with `output_width` and/or `output_height`. The response returns a `process_id` and `eta`; poll `GET /status/{process_id}` and download the result from `GET /download/{process_id}`.

{% tabs %}
{% tab title="cURL" %}

```bash
curl -X POST "https://api.topazlabs.com/image/v1/enhance-gen/async" \
  -H "X-API-Key: $TOPAZ_API_KEY" \
  -F "image=@photo.jpg" \
  -F "model=Wonder 4" \
  -F "output_width=3840" \
  -F "output_format=png"
```

{% endtab %}

{% tab title="JavaScript" %}

```javascript
import fs from 'fs';
import FormData from 'form-data';

const form = new FormData();
form.append("image", fs.createReadStream("photo.jpg"));
form.append("model", "Wonder 4");
form.append("output_width", "3840");
form.append("output_format", "png");

const response = await fetch("https://api.topazlabs.com/image/v1/enhance-gen/async", {
  method: 'POST',
  headers: {
    'X-API-Key': process.env.TOPAZ_API_KEY,
    ...form.getHeaders(),
  },
  body: form,
});

if (!response.ok) {
  throw new Error(`Request failed: ${response.status} ${await response.text()}`);
}

console.log(await response.json());
```

{% endtab %}

{% tab title="Python" %}

```python
import os
import requests

with open("photo.jpg", "rb") as image:
    response = requests.post(
        "https://api.topazlabs.com/image/v1/enhance-gen/async",
        headers={"X-API-Key": os.environ["TOPAZ_API_KEY"]},
        files={"image": image},
        data={
            "model": "Wonder 4",
            "output_width": "3840",
            "output_format": "png",
        },
    )

response.raise_for_status()
print(response.json())
```

{% endtab %}
{% endtabs %}

### Parameters

Request parameters (`image`, `source_id`, `source_url`, `model`, `output_format`, `webhook_url`, `output_width`, `output_height`, `crop_to_fill`) are the same for every generative upscaling model and are listed on the [Request Parameters](https://developer.topazlabs.com/getting-started/request-parameters.md) page. Model settings are listed on each model's page.

### Limitations

Wonder 4 and Redefine accept up to 256 MP input and output, with each output side up to 32,000 pixels. Recover 3 and Standard Max accept up to 24 MP input.

### Helpful Resources

<table data-view="cards"><thead><tr><th></th><th></th><th></th><th data-hidden data-card-target data-type="content-ref"></th></tr></thead><tbody><tr><td><i class="fa-play">:play:</i></td><td><h4>Image Quickstart</h4></td><td>Quickly get started with our Image API.</td><td><a href="https://developer.topazlabs.com/getting-started/image-quickstart.md">Image Quickstart</a></td></tr><tr><td><i class="fa-file-brackets-curly">:file-brackets-curly:</i></td><td><h4>API Reference</h4></td><td>View our API reference to view the entire schema.</td><td><a href="https://developer.topazlabs.com/reference/">https://developer.topazlabs.com/reference/</a></td></tr><tr><td><i class="fa-square-root-variable">:square-root-variable:</i></td><td><h4>Model Pricing</h4></td><td>Learn how we price our models.</td><td><a href="https://developer.topazlabs.com/getting-started/model-pricing.md">Model Pricing</a></td></tr></tbody></table>


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://developer.topazlabs.com/image-models/upscaling-and-enhancement/generative.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
