> 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/wonder-2.md).

# Wonder 2

Advanced generative realism model for challenging images

{% hint style="warning" %}
**Wonder 2 is deprecated** and will be retired no sooner than January 1, 2027. Use Wonder 3.5 instead. See Model Deprecations for migration steps.
{% endhint %}

<table data-card-size="large" data-view="cards"><thead><tr><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>Click to view</td><td><a href="https://4007072434-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FJkSwaYgAsTQke14gpXAF%2Fuploads%2Fhg9Y5vOlg3Y3mXgOWp7U%2FWonder_2_Compare_slider.jpg?alt=media&#x26;token=65b5ddf6-539b-4813-9c23-9ef76bccea00">https://4007072434-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FJkSwaYgAsTQke14gpXAF%2Fuploads%2Fhg9Y5vOlg3Y3mXgOWp7U%2FWonder_2_Compare_slider.jpg?alt=media&#x26;token=65b5ddf6-539b-4813-9c23-9ef76bccea00</a></td><td><a href="https://compare.topazlabs.com/share/image?src1=https://downloads.topazlabs.com/web-assets/api-docs-media/pexels-lance-reis-255748881-before.webp&#x26;src1label=Original&#x26;src2=https://downloads.topazlabs.com/web-assets/api-docs-media/pexels-lance-reis-255748881-after.webp&#x26;src2label=Wonder+2&#x26;zoom=1.5">https://compare.topazlabs.com/share/image?src1=https://downloads.topazlabs.com/web-assets/api-docs-media/pexels-lance-reis-255748881-before.webp&#x26;src1label=Original&#x26;src2=https://downloads.topazlabs.com/web-assets/api-docs-media/pexels-lance-reis-255748881-after.webp&#x26;src2label=Wonder+2&#x26;zoom=1.5</a></td></tr></tbody></table>

### Model Overview

Wonder 2 is the second-generation Wonder model and the most advanced realism-focused image enhancement model in the family. It is designed to handle extremely challenging, low-resolution images and produce outputs that look clean, natural, and professional.

Wonder 2 restores sharper, more natural detail across the image, resolving plasticky or airbrushed artifacts to produce clean, realistic results. It recovers skin texture, facial features, hair, fabric, and environmental detail while minimizing artifacts and avoiding unnecessary changes to the source during upscaling.

### Best Use Cases

* **Difficult, low-quality images.** Generative recovery for challenging sources.
* **Faces and skin.** Recover natural facial detail.
* **Artifact control.** Sharper detail without plastic looks.
* **Text and logos.** Preserve fine detail where possible.
* **Environmental detail.** Recover fabric, foliage, and backgrounds.

### Endpoint

`https://api.topazlabs.com/image/v1/enhance-gen/async`

### Model Parameters

| Parameter                 | Type      | Required / Default                             | Accepted values | Description                                                                   |
| ------------------------- | --------- | ---------------------------------------------- | --------------- | ----------------------------------------------------------------------------- |
| `model`                   | `string`  | Required                                       | `"Wonder 2"`    | —                                                                             |
| `colorCorrection`         | `boolean` | <p>Optional<br>Default: <code>true</code></p>  | —               | Applies color correction after processing.                                    |
| `faceEnhancement`         | `boolean` | <p>Optional<br>Default: <code>false</code></p> | —               | Enhances faces in the image.                                                  |
| `faceEnhancementStrength` | `decimal` | <p>Optional<br>Default: <code>0.8</code></p>   | `0.0` to `1.0`  | How strongly faces are enhanced.                                              |
| `preDownscale`            | `integer` | <p>Optional<br>Default: <code>1</code></p>     | `1` to `4`      | Downscales the input before processing. Helps on very low-resolution sources. |

For request parameters shared by every image endpoint, see Request Parameters. The full schema is also available in our API Reference page.

### Model Pricing

**Wonder 2** costs 1 credit per every 4 MP of generated output. The below table includes a list of common output resolutions with associated credit costs.

| Resolution | Typical Source       | Output MP | Credits |
| ---------- | -------------------- | --------- | ------- |
| 640×480    | VGA                  | 0.31      | 1       |
| 1280×720   | 720p                 | 0.92      | 1       |
| 1920×1080  | 1080p                | 2.07      | 1       |
| 2560×1440  | 1440p                | 3.69      | 1       |
| 3840×2160  | 4K UHD               | 8.29      | 3       |
| 4000×3000  | 12 MP phone          | 12.00     | 3       |
| 5472×3648  | 20 MP camera         | 19.96     | 5       |
| 6000×4000  | 24 MP camera         | 24.00     | 6       |
| 7680×4320  | 8K UHD               | 33.18     | 9       |
| 7952×5304  | 42 MP camera         | 42.18     | 11      |
| 8192×5464  | 45 MP camera         | 44.76     | 12      |
| 9504×6336  | 61 MP camera         | 60.22     | 16      |
| 11648×8736 | 100 MP medium format | 101.76    | 26      |

| Output MP | 1 | 4 | 8 | 16 | 24 | 32 | 40 |
| --------- | - | - | - | -- | -- | -- | -- |
| Credits   | 1 | 1 | 2 | 4  | 6  | 8  | 10 |

{% hint style="info" %}
For more accurate credit cost estimates, we recommend using our [Credit Calculator](https://developer.topazlabs.com/credit-calculator).
{% endhint %}

### Example Request

{% 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 2" \
  -F "faceEnhancement=true"
```

{% 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 2");
form.append("faceEnhancement", "true");

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 2",
            "faceEnhancement": "true"
        },
    )

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

{% endtab %}
{% endtabs %}

### Migrating to Wonder 3.5

1. Keep the `/image/v1/enhance-gen/async` endpoint and set `model` to `Wonder 3.5`.
2. Remove Wonder 2 settings and use `enhancementStrength` (`low`, `medium`, or `high`) instead.
3. Wonder 3.5 is priced at 8 MP per credit instead of 4, so the same output costs about half as much.

### Limitations

This model accepts up to 256 MP input and output.

### 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></td></tr><tr><td><i class="fa-codepen">:codepen:</i></td><td><h4>Model Playground</h4></td><td>Test and create with our models.</td><td><a href="https://playground.topazlabs.com/">https://playground.topazlabs.com/</a></td></tr><tr><td><i class="fa-square-root-variable">:square-root-variable:</i></td><td><h4>Credit Calculator</h4></td><td>Pricing for specific outputs, batches, and more.</td><td></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/wonder-2.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.
