# Image Upscaler - AI Upscale Images 2x/4x (Real-ESRGAN) (`admirala/ai-image-upscaler-realesrgan`) Actor

AI image upscaler: enlarge and sharpen JPG, PNG or WebP images 2x or 4x with Real-ESRGAN. Bulk image URLs in, PNG/JPG/WebP download links out. $0.0165 per image, failures free.

- **URL**: https://apify.com/admirala/ai-image-upscaler-realesrgan.md
- **Developed by:** [Ja doei](https://apify.com/admirala) (community)
- **Categories:** AI, Developer tools
- **Security:** Limited permissions
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $11.55 / 1,000 image upscaled (2x or 4x, real-esrgan)s

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.
Since this Actor supports Apify Store discounts, the price gets lower the higher subscription plan you have.

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

## Image Upscaler - AI Upscale Images 2x/4x (Real-ESRGAN)

> ✅ **Tested daily** with its default input (Apify's automated QA plus our own smoke test before every release).

**AI image upscaler**: make small or blurry images bigger and sharper. Give this Actor a list of direct image links and it returns each image enlarged **2x or 4x** by the **Real-ESRGAN** super-resolution model, saved as PNG, JPG or WebP with a download link. **$0.0165 per upscaled image**; failed or oversized images are free.

### What it does

- Downloads each image from the URL you provide (JPG, PNG, WebP; up to 25 MB).
- Runs the `realesr-general-x4v3` Real-ESRGAN model, which removes blur, noise and compression artifacts while enlarging.
- Stores the result in the run's key-value store and adds a row to the dataset with the output link, input/output size and processing time.
- Transparent PNGs keep their transparency.

### Input

| Field | Description |
|---|---|
| `imageUrls` | Direct links to JPG, PNG or WebP images you have the rights to, max 25 MB and 0.5 megapixels each (e.g. 800x600). Social media links are not supported. $0.0165 per upscaled image. Example: \["https://example.com/photo.jpg"]. |
| `scale` | Upscale factor: '2' or '4' (same price). 4x of a 700x700 image gives 2800x2800. |
| `outputFormat` | png = lossless, keeps transparency (largest files); jpg or webp = much smaller files. |
| `faceEnhance` | true = extra face restoration, only when a GPU worker is available; otherwise the image is upscaled normally and the row says so. No extra cost. |

**Input size:** up to **0.5 megapixels** per image (for example 800x600 or 700x700 px), which gives up to 2828x2828 px output at 4x. Larger images get a clear error message in the dataset and are **not charged**.

### Output (one row per image)

```json
{
  "url": "https://example.com/photo.jpg",
  "scale": 4,
  "input_width": 330,
  "input_height": 492,
  "output_url": "https://api.apify.com/v2/key-value-stores/.../records/upscaled-0000-bc74187d99.png",
  "output_width": 1320,
  "output_height": 1968,
  "output_bytes": 2950112,
  "format": "png",
  "model": "realesr-general-x4v3",
  "processing_s": 4.4
}
```

### Pricing (pay per event)

| Event | Price |
|---|---|
| Image upscaled (2x or 4x) | $0.0165 per image (lower on higher Apify plans) |

You pay only for images that were upscaled successfully. Failed downloads, non-image links and oversized images cost nothing.

### Use cases

- Enlarging product photos and thumbnails for web shops
- Restoring old or low-resolution photos and scans
- Preparing images for print or high-DPI screens
- Bulk processing of image libraries through the Apify API

### Notes

- Only direct image URLs are supported. Images from social media platforms (Instagram, Facebook, TikTok, X, Pinterest) are not downloaded, in line with those platforms' terms.
- Model: Real-ESRGAN by Xintao Wang et al. (github.com/xinntao/Real-ESRGAN, BSD-3-Clause), weights `realesr-general-x4v3` from the official v0.2.5.0 release.

### Use with AI agents (MCP)

This Actor can be used as a tool by AI agents (Claude, Cursor, VS Code, other MCP clients) through the official [Apify MCP server](https://docs.apify.com/platform/integrations/mcp):

- Add only this Actor as a tool: `https://mcp.apify.com?tools=admirala/ai-image-upscaler-realesrgan` (sign in with OAuth or an Apify API token).
- Or connect `https://mcp.apify.com` and let the agent find it with `search-actors` (e.g. "image upscaler"), read the input schema with `fetch-actor-details` and run it with `call-actor`.

Example input an agent can pass:

```json
{
  "imageUrls": [
    "https://upload.wikimedia.org/wikipedia/commons/4/47/PNG_transparency_demonstration_1.png"
  ],
  "scale": "4",
  "outputFormat": "png"
}
```

Cost per call: $0.0165 per successfully upscaled image (2x or 4x, same price). Failed downloads and oversized inputs are free. Results come back as dataset items (`get-dataset-items`).

### FAQ

**How do I upscale an image with AI?**
Put direct image URLs in `imageUrls`, choose `scale` 2 or 4 and an `outputFormat`. Each result row has an `output_url` to download the enlarged image.

**What is the maximum input size?**
Up to 0.5 megapixels per image (e.g. 800x600 px), giving up to about 2828x2828 px at 4x. Larger images get an error row and are not charged.

**Is this a free alternative to Topaz or waifu2x?**
It is pay per image ($0.0165), no subscription or GPU needed. It uses the open Real-ESRGAN model (realesr-general-x4v3).

**Can I upscale images from Instagram or other social media?**
No, only direct image URLs you have the rights to.

### Related actors

- [Website to Markdown for LLM & RAG - Clean Page Text](https://apify.com/admirala/webpage-to-markdown-llm)

### More examples

Ready-to-run Python, curl and MCP examples with real sample output: https://github.com/AdmiraalA/apify-scrapers-examples

# Actor input Schema

## `imageUrls` (type: `array`):

Direct links to JPG, PNG or WebP images you have the rights to, max 25 MB and 0.5 megapixels each (e.g. 800x600). Social media links are not supported. $0.0165 per upscaled image. Example: \["https://example.com/photo.jpg"].

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

Upscale factor: '2' or '4' (same price). 4x of a 700x700 image gives 2800x2800.

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

png = lossless, keeps transparency (largest files); jpg or webp = much smaller files.

## `faceEnhance` (type: `boolean`):

true = extra face restoration, only when a GPU worker is available; otherwise the image is upscaled normally and the row says so. No extra cost.

## Actor input object example

```json
{
  "imageUrls": [
    "https://upload.wikimedia.org/wikipedia/commons/4/47/PNG_transparency_demonstration_1.png"
  ],
  "scale": "4",
  "outputFormat": "png",
  "faceEnhance": false
}
```

# Actor output Schema

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

No description

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

No description

# 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 = {
    "imageUrls": [
        "https://upload.wikimedia.org/wikipedia/commons/4/47/PNG_transparency_demonstration_1.png"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("admirala/ai-image-upscaler-realesrgan").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 = { "imageUrls": ["https://upload.wikimedia.org/wikipedia/commons/4/47/PNG_transparency_demonstration_1.png"] }

# Run the Actor and wait for it to finish
run = client.actor("admirala/ai-image-upscaler-realesrgan").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 '{
  "imageUrls": [
    "https://upload.wikimedia.org/wikipedia/commons/4/47/PNG_transparency_demonstration_1.png"
  ]
}' |
apify call admirala/ai-image-upscaler-realesrgan --silent --output-dataset

```

## MCP server setup

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

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/zpZ8cqDBjFJ1ab6bg/builds/mcc67CAzijbqodhM1/openapi.json
