# AI Image Upscaler – Real-ESRGAN 2x/4x Photo Enhancer (`chesapeake/ai-image-upscaler`) Actor

Upscale images 2x, 3x or 4x with Real-ESRGAN. Sharpens blurry, low-res and JPEG-compressed photos, product shots and artwork in bulk. Keeps transparency. PNG, JPEG or WEBP output. Pay per image, no API key needed.

- **URL**: https://apify.com/chesapeake/ai-image-upscaler.md
- **Developed by:** [Chesapeake Commerce](https://apify.com/chesapeake) (community)
- **Categories:** AI, For creators
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

$20.00 / 1,000 image upscaleds

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.

Learn more: https://docs.apify.com/actors/running/actors-in-store.md#pay-per-event

## What's an Apify Actor?

An Actor is a serverless cloud program that runs on the Apify platform. It has two run modes.
In Batch mode, an Actor accepts a well-defined JSON input, performs an action which can take anything from a few seconds to a few hours,
and optionally produces a well-defined JSON output, datasets with results, or files in key-value store.
In Standby mode, an Actor provides a web server which can be used as a website, API, or an MCP server.

Apify vocabulary and the platform model are defined once, in the agent quickstart at https://apify.com/agents.md.

## How to integrate an Actor?

If asked about integration, you help developers integrate Actors into their projects.
You adapt to their stack and deliver integrations that are safe, well-documented, and production-ready.

Do not guess an integration path. Every one of them is in the agent quickstart at https://apify.com/agents.md: the Apify MCP server, Agent Skills with the Apify CLI, the JavaScript and Python clients, the REST API, and the account-free path for an agent with no human to sign in. It also carries the rule on stating cost before the first paid run.

For examples already wired to this Actor's own input schema, see the [API](#api) section below.

Each client library has reference documentation the quickstart does not restate: [JavaScript/TypeScript](https://docs.apify.com/api/client/js/docs.md) (`npm install apify-client`) and [Python](https://docs.apify.com/api/client/python/docs.md) (`pip install apify-client`).

# README

## AI Image Upscaler – Real-ESRGAN 2x/4x Photo Enhancer

Upscale photos, product images, artwork and old pictures **2x, 3x or 4x** with **Real-ESRGAN**, an open-source AI super-resolution model that restores detail instead of just blurring pixels. Paste image URLs, click Start, and download sharp, high-resolution PNG, JPEG or WebP files. You can process **bulk batches** through the API, with no subscription and **no third-party AI API fees**.

### Why use it

- **Real AI super-resolution.** It uses Real-ESRGAN (`realesr-general-x4v3`) and removes JPEG artifacts, noise and blur while it enlarges.
- **Two models.** *General* gives the sharpest results. *Denoise* is gentler and suits noisy phone photos and old scans.
- **2x, 3x or 4x** output, with transparency (PNG alpha) preserved.
- **Bulk and API-first.** Process hundreds of images per run and call it from Make, Zapier, n8n or your own code.
- **Private.** Images are processed on Apify's servers inside your run. Nothing is sent to an external AI service.
- **Fair pricing.** You pay per image, and large images are billed per started megapixel of **input**. Failed downloads are free.

### How to use it

1. Add image URLs under **Images**. You can also upload a text file of URLs. For local files, upload them to an Apify key-value store, Dropbox, Google Drive (public link) or S3.
2. Choose the **Scale** (4x by default), the **Model** and the **Output format**.
3. Click **Start**. Each result has an `outputUrl` that links to the upscaled file in your run's key-value store.

#### Input example

```json
{
  "images": [{ "url": "https://raw.githubusercontent.com/xinntao/Real-ESRGAN/master/inputs/wolf_gray.jpg" }],
  "scale": "4",
  "model": "general",
  "outputFormat": "png"
}
```

#### Output example

```json
{
  "url": "https://raw.githubusercontent.com/xinntao/Real-ESRGAN/master/inputs/wolf_gray.jpg",
  "status": "OK",
  "outputUrl": "https://api.apify.com/v2/key-value-stores/…/records/wolf_gray-1-x4.png",
  "scale": 4,
  "model": "general",
  "originalWidth": 236,
  "originalHeight": 236,
  "outputWidth": 944,
  "outputHeight": 944,
  "outputFormat": "png",
  "outputBytes": 1003760,
  "billedImages": 1,
  "processingSeconds": 1.4
}
```

`status` values: `OK`, `FAILED`, `HTTP_ERROR`, `SKIPPED_ROBOTS_TXT`. Only `OK` results are charged.

### Pricing (pay per event)

| Event | Price |
|---|---|
| Image upscaled (per started megapixel of input, i.e. up to 1024×1024 px) | **$0.02** |

Examples: a 512×512 thumbnail costs **$0.02** and comes back as 2048×2048 at 4x. A 1600×1200 photo (1.83 MP) counts as 2 units and costs **$0.04**. 1,000 product images under 1 MP cost **$20**. Inputs larger than **Max input megapixels** (2 MP by default) are first downscaled to that size, which keeps runs fast and cheap. Raise the limit for big originals.

### FAQ

**What's the maximum output size?** With the default 2 MP input limit at 4x, outputs reach about 32 MP (for example 6400×5000). You can raise the input limit to 8 MP.

**Does it work on faces and text?** It works well on general photos, products, landscapes and illustrations. It doesn't hallucinate new faces, so very low-res faces get sharper but aren't "reconstructed".

**Is 2x cheaper than 4x?** No. The price depends on input size, because the AI model runs at 4x and the result is then resized to your chosen scale for the best quality.

**Which formats are supported?** Input can be JPEG, PNG, WebP, BMP, TIFF or GIF (first frame). Output can be PNG, JPEG or WebP.

**Can I use the results commercially?** Real-ESRGAN is BSD-3 licensed, and you own your outputs. Make sure you have the rights to the input images.

# Actor input Schema

## `images` (type: `array`):

Public links to JPG, PNG, WEBP, GIF, BMP or TIFF images. To upscale your own files, upload them to an Apify key-value store, Google Drive (public link), Dropbox or S3 and paste the links. You can also upload a text/CSV file of URLs.

## `scale` (type: `string`):

Output size relative to the input. The price is the same for every factor.

## `model` (type: `string`):

Both models handle photos, product images, illustrations and screenshots.

## `outputFormat` (type: `string`):

Format of the upscaled files saved to the key-value store.

## `jpegQuality` (type: `integer`):

Only used for JPEG and WEBP output.

## `maxInputMegapixels` (type: `number`):

Bigger inputs are first shrunk to this size (flagged inputResized), which keeps outputs under ~32 MP at 4x and protects your budget. Inputs above 4 MP need 8 GB memory.

## `maxFileSizeMb` (type: `integer`):

Bigger downloads are skipped (not charged).

## `respectRobotsTxt` (type: `boolean`):

Skip image URLs whose site disallows automated access (not charged).

## Actor input object example

```json
{
  "images": [
    {
      "url": "https://raw.githubusercontent.com/xinntao/Real-ESRGAN/master/inputs/wolf_gray.jpg"
    }
  ],
  "scale": "4",
  "model": "general",
  "outputFormat": "png",
  "jpegQuality": 92,
  "maxInputMegapixels": 2,
  "maxFileSizeMb": 25,
  "respectRobotsTxt": true
}
```

# Actor output Schema

## `results` (type: `string`):

One item per image with the outputUrl of the upscaled file, original and output dimensions, and status.

## `files` (type: `string`):

Upscaled PNG/JPEG/WEBP files in the run's default key-value store (also contains the run INPUT record).

# API

You can run this Actor programmatically using our API. Below are code examples in JavaScript, Python, and CLI, as well as the OpenAPI specification and MCP server setup.

## JavaScript example

```javascript
import { ApifyClient } from 'apify-client';

// Initialize the ApifyClient with your Apify API token
// Replace the '<YOUR_API_TOKEN>' with your token
const client = new ApifyClient({
    token: '<YOUR_API_TOKEN>',
});

// Prepare Actor input
const input = {
    "images": [
        {
            "url": "https://raw.githubusercontent.com/xinntao/Real-ESRGAN/master/inputs/wolf_gray.jpg"
        }
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("chesapeake/ai-image-upscaler").call(input);

// Fetch and print Actor results from the run's dataset (if any)
console.log('Results from dataset');
console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
const { items } = await client.dataset(run.defaultDatasetId).listItems();
items.forEach((item) => {
    console.dir(item);
});

// 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/js/docs

```

## Python example

```python
from apify_client import ApifyClient

# Initialize the ApifyClient with your Apify API token
# Replace '<YOUR_API_TOKEN>' with your token.
client = ApifyClient("<YOUR_API_TOKEN>")

# Prepare the Actor input
run_input = { "images": [{ "url": "https://raw.githubusercontent.com/xinntao/Real-ESRGAN/master/inputs/wolf_gray.jpg" }] }

# Run the Actor and wait for it to finish
run = client.actor("chesapeake/ai-image-upscaler").call(run_input=run_input)

# Fetch and print Actor results from the run's dataset (if there are any)
print(f"💾 Check your data here: https://console.apify.com/storage/datasets/{run.default_dataset_id}")
for item in client.dataset(run.default_dataset_id).iterate_items():
    print(item)

# 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/python/docs/quick-start

```

## CLI example

```bash
echo '{
  "images": [
    {
      "url": "https://raw.githubusercontent.com/xinntao/Real-ESRGAN/master/inputs/wolf_gray.jpg"
    }
  ]
}' |
apify call chesapeake/ai-image-upscaler --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,chesapeake/ai-image-upscaler"
        }
    }
}
```

The hosted server signs you in with OAuth on first connect, so no API token belongs in this config. Clients without OAuth support can send an `Authorization: Bearer <APIFY_API_TOKEN>` header instead, using a token from API & Integrations in Apify Console (https://console.apify.com/settings/integrations).

## OpenAPI specification

Download the OpenAPI definition: https://api.apify.com/v2/actors/4Xxx6Mrg1XoK8oOPG/builds/O3q0vXU4FBK5GgnyO/openapi.json
