> 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-4.md).

# Wonder 4

Our most advanced all-purpose image model for automatic enhancement, restoring focus and faces, denoising, restoration, and upscaling at any resolution.

<table data-card-size="large" data-view="cards"><thead><tr><th align="center"></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 align="center">Click to view</td><td><a href="https://938351258-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fik4tc42rkpL9SRR51NLK%2Fuploads%2FrNI7hu6WeqBBcIiMrCGn%2FWonder4_ex1-texture_slider.jpg?alt=media&amp;token=dcbfd95f-bafb-4b98-a056-8302e13e69af">Wonder4_ex1-texture_slider.jpg</a></td><td><a href="https://compare.topazlabs.com/share/image?src1=https%3A%2F%2Fdownloads.topazlabs.com%2Fweb-assets%2Fmodel-examples%2Fwonder4_ex1-texture.avif&#x26;src1label=Before&#x26;src2=https%3A%2F%2Fdownloads.topazlabs.com%2Fweb-assets%2Fmodel-examples%2Fwonder4_ex1-output.png&#x26;src2label=After&#x26;zoom=1">https://compare.topazlabs.com/share/image?src1=https%3A%2F%2Fdownloads.topazlabs.com%2Fweb-assets%2Fmodel-examples%2Fwonder4_ex1-texture.avif&#x26;src1label=Before&#x26;src2=https%3A%2F%2Fdownloads.topazlabs.com%2Fweb-assets%2Fmodel-examples%2Fwonder4_ex1-output.png&#x26;src2label=After&#x26;zoom=1</a></td></tr><tr><td align="center">Click to view</td><td><a href="https://938351258-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fik4tc42rkpL9SRR51NLK%2Fuploads%2Fq1lkXp9yIktVwHlFXHxs%2FWonder4_ex2-animals_slider.jpg?alt=media&amp;token=092d112d-82e8-4bd2-be22-5bb3ffedfefb">Wonder4_ex2-animals_slider.jpg</a></td><td><a href="https://compare.topazlabs.com/share/image?src1=https%3A%2F%2Fdownloads.topazlabs.com%2Fweb-assets%2Fmodel-examples%2Fwonder4_ex2-animals.avif&#x26;src1label=Before&#x26;src2=https%3A%2F%2Fdownloads.topazlabs.com%2Fweb-assets%2Fmodel-examples%2Fwonder4_ex2-output.png&#x26;src2label=After&#x26;zoom=1">https://compare.topazlabs.com/share/image?src1=https%3A%2F%2Fdownloads.topazlabs.com%2Fweb-assets%2Fmodel-examples%2Fwonder4_ex2-animals.avif&#x26;src1label=Before&#x26;src2=https%3A%2F%2Fdownloads.topazlabs.com%2Fweb-assets%2Fmodel-examples%2Fwonder4_ex2-output.png&#x26;src2label=After&#x26;zoom=1</a></td></tr><tr><td align="center">Click to view</td><td><a href="https://938351258-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fik4tc42rkpL9SRR51NLK%2Fuploads%2F7vkUm52IkyNp9odXUYPh%2FWonder4_ex3-oldphoto_slider.jpg?alt=media&amp;token=8bc3b2d2-8e7f-48ba-8589-98a02f2f0ae8">Wonder4_ex3-oldphoto_slider.jpg</a></td><td><a href="https://compare.topazlabs.com/share/image?src1=https%3A%2F%2Fdownloads.topazlabs.com%2Fweb-assets%2Fmodel-examples%2Fwonder4_ex3-oldphoto.jpg&#x26;src1label=Before&#x26;src2=https%3A%2F%2Fdownloads.topazlabs.com%2Fweb-assets%2Fmodel-examples%2Fwonder4_ex3-output.png&#x26;src2label=After&#x26;zoom=1">https://compare.topazlabs.com/share/image?src1=https%3A%2F%2Fdownloads.topazlabs.com%2Fweb-assets%2Fmodel-examples%2Fwonder4_ex3-oldphoto.jpg&#x26;src1label=Before&#x26;src2=https%3A%2F%2Fdownloads.topazlabs.com%2Fweb-assets%2Fmodel-examples%2Fwonder4_ex3-output.png&#x26;src2label=After&#x26;zoom=1</a></td></tr><tr><td align="center">Click to view</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://compare.topazlabs.com/share/image?src1=https%3A%2F%2Fdownloads.topazlabs.com%2Fweb-assets%2Fmodel-examples%2Fwonder4_ex5-fur.avif&#x26;src1label=Before&#x26;src2=https%3A%2F%2Fdownloads.topazlabs.com%2Fweb-assets%2Fmodel-examples%2Fwonder4_ex5-output.png&#x26;src2label=After&#x26;zoom=1">https://compare.topazlabs.com/share/image?src1=https%3A%2F%2Fdownloads.topazlabs.com%2Fweb-assets%2Fmodel-examples%2Fwonder4_ex5-fur.avif&#x26;src1label=Before&#x26;src2=https%3A%2F%2Fdownloads.topazlabs.com%2Fweb-assets%2Fmodel-examples%2Fwonder4_ex5-output.png&#x26;src2label=After&#x26;zoom=1</a></td></tr></tbody></table>

### Model Overview

**Wonder 4** is our most advanced all-in-one model for enhancement and upscaling, designed to automatically improve image quality in one step without manual adjustments. From low-resolution photos to high-resolution images, Wonder 4 intelligently identifies and corrects noise, blur, compression artifacts, image damage, and facial details, while preserving natural textures.

Wonder 4 uses a new mixture-of-experts architecture trained to intelligently identify and correct multiple image problems at once. Unlike traditional models that apply the same corrections across an entire image, Wonder 4 analyzes each region independently and applies the enhancements it needs. This intelligent approach delivers superior results in a single pass, without chaining multiple models.

### Best Use Cases

* **All-in-one enhancement:** Automatically combines upscaling, denoising, deblurring, compression artifact removal, and face recovery in a single pass, with no parameters or manual adjustments.
* **Intelligent region-based processing:** Uses a mixture-of-experts architecture to identify and apply the appropriate corrections to different areas of an image.
* **Superior image quality:** Delivers higher-quality results than Wonder 3.5 and more cohesive enhancement than chaining multiple specialized models together, while preserving natural textures and detail.
* **Low- and high-resolution support:** Enhances a wide range of images, from low-quality photos and damaged scans to high-resolution sources.

### Endpoint

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

### Model Parameters

| Parameter | Type     | Required / Default | Accepted values | Description |
| --------- | -------- | ------------------ | --------------- | ----------- |
| `model`   | `string` | Required           | `"Wonder 4"`    | —           |

For request parameters shared by every image endpoint, see [Request Parameters](/getting-started/request-parameters/image.md). The full schema is also available in our [API Reference](https://app.gitbook.com/o/HctdcUHRfIWXBVA1egPp/s/dQjJSfrAUC693PLetlIA/) page.

### Model Pricing

**Wonder 4** costs 1 credit per every 8 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      | 2       |
| 4000×3000  | 12 MP phone          | 12.00     | 2       |
| 5472×3648  | 20 MP camera         | 19.96     | 3       |
| 6000×4000  | 24 MP camera         | 24.00     | 3       |
| 7680×4320  | 8K UHD               | 33.18     | 5       |
| 7952×5304  | 42 MP camera         | 42.18     | 6       |
| 8192×5464  | 45 MP camera         | 44.76     | 6       |
| 9504×6336  | 61 MP camera         | 60.22     | 8       |
| 11648×8736 | 100 MP medium format | 101.76    | 13      |

| Output MP | 1 | 4 | 8 | 16 | 24 | 32 | 40 |
| --------- | - | - | - | -- | -- | -- | -- |
| Credits   | 1 | 1 | 1 | 2  | 3  | 4  | 5  |

{% 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 4"
```

{% 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");

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"
        },
    )

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

{% endtab %}
{% endtabs %}

### 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-4.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.
