# AI Image Upscaler — Real-ESRGAN 2x, 3x, 4x (`nexgensignal/ai-image-upscaler`) Actor

Enlarge images 2×, 3× or 4× with open Real-ESRGAN AI models that add real detail: photos, product shots, old scans, anime and illustrations. JPEG, PNG, WebP in; PNG, JPEG or WebP out with transparency kept. Billed by image size. Part of NexGen Signal — data tools and official-source data products

- **URL**: https://apify.com/nexgensignal/ai-image-upscaler.md
- **Developed by:** [NexGen Signal](https://apify.com/nexgensignal) (community)
- **Categories:** AI, E-commerce, Automation
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $33.50 / 1,000 upscale units

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

## 🔍 AI Image Upscaler — Real-ESRGAN 2x, 3x, 4x

Give direct image links and get each image **enlarged 2×, 3× or 4× by an AI model that adds real detail**, instead of the blur you get from simply stretching pixels. Each row has the original and new sizes, the time it took and a download link to the upscaled file.

Three open Real-ESRGAN models run inside the actor: **general** (realesr-general-x4v3, fast, for photos and everyday images), **photo** (the original RealESRGAN_x4plus, the most detail, about 15 times slower) and **anime** (RealESRGAN_x4plus_anime_6B, for drawn art and illustrations). JPEG, PNG, WebP, GIF, BMP and TIFF go in; PNG, JPEG or WebP come out, with transparency kept in PNG and WebP, EXIF rotation applied, and the colour balance matched to the original so the model cannot tint it (`colorFix`, on by default).

Billing is by image size: one unit per started 250,000 pixels of the original (a 500 × 500 image is one unit), times 1 for the general model, 2 for anime and 4 for photo. Images that cannot be read, or are over your size limit, are not billed.

### Who buys this and for what job

- **E-commerce teams** enlarging small supplier product photos for listings.
- **Designers and marketers** upscaling images for print, banners and slides.
- **Archivists** sharpening small scans and old photos.
- **Developers and AI teams** adding an upscale step to an image pipeline without a GPU or an outside API.

Buyers usually search for this as **"AI image upscaler"**, **"upscale image 4x"** or **"Real-ESRGAN"**.

### 📊 Sample Output

![Table of upscaled images: model, scale, input size, output size, units billed and seconds.](https://api.apify.com/v2/key-value-stores/IXCaMKjxSmUTLHhmq/records/ai-image-upscaler.png)

| model | scale | input | output | units_billed | processing_seconds |
|---|---|---|---|---|---|
| general | 4× | 800×800 | 3200×3200 | 3 | 19.1 |
| general | 4× | 800×800 | 3200×3200 | 3 | 23.3 |
| general | 4× | 800×450 | 3200×1800 | 2 | 12.4 |
| general | 4× | 800×450 | 3200×1800 | 2 | 13.5 |
| general | 4× | 400×400 | 1600×1600 | 1 | 5.7 |
| photo | 2× | 400×400 | 800×800 | 4 | 62.4 |
| anime | 4× | 250×187 | 1000×748 | 2 | 4.9 |

Rows from live run `LlcXzl2AjWUktmyqb` on Apify (NASA video stills with the general model, one with the photo model at 2×, and a transparent PNG with the anime model). Notice the photo-model row: four times the units for the same 400 × 400 image, and about ten times the processing time.

### ✅ What you get

Every field of each record:

- `record_id`, `image_url` — id from the file, model, scale and format; the link you gave.
- `model`, `scale` — general, anime or photo; 2, 3 or 4.
- `input_width`, `input_height`, `output_width`, `output_height` — sizes before and after.
- `input_format`, `output_format`, `input_bytes`, `output_bytes`, `has_alpha` — formats, file sizes, and whether transparency was kept.
- `color_shift_fixed` — the largest colour shift corrected by colorFix (0 = none needed).
- `units_billed`, `processing_seconds` — units for this image and the time the model took.
- `sha256`, `file_key`, `file_url` — the upscaled file and its download link.
- `upscaled_at` — when it was upscaled (UTC).

### ⚙️ Sample inputs

**One image (the Store example)**

```json
{
  "imageUrls": ["https://images-assets.nasa.gov/video/KSC_69-71212-sRGB/KSC_69-71212-sRGB~small_2.jpg"],
  "maxImages": 10
}
```

200 × 200 to 800 × 800 with the general model: 1 unit.

**Most detail, 2×, as JPEG**

```json
{
  "imageUrls": ["https://images-assets.nasa.gov/video/KSC_69-71212-sRGB/KSC_69-71212-sRGB~medium_2.jpg"],
  "model": "photo",
  "scale": 2,
  "outputFormat": "jpg",
  "maxImages": 5
}
```

400 × 400 to 800 × 800: 4 units.

**Illustrations with transparency**

```json
{
  "imageUrls": ["https://upload.wikimedia.org/wikipedia/commons/thumb/4/47/PNG_transparency_demonstration_1.png/250px-PNG_transparency_demonstration_1.png"],
  "model": "anime",
  "outputFormat": "webp",
  "maxImages": 5
}
```

Transparency kept: 2 units.

Input fields:

| Field | Meaning |
|---|---|
| `imageUrls` | direct image links (up to 2,000). |
| `model` | general (default), anime or photo. |
| `scale` | 2, 3 or 4 (default 4). |
| `outputFormat`, `quality` | png (default), jpg or webp; quality 1–100 for JPEG and WebP. |
| `colorFix` | match the result's colours to the original (default on). |
| `maxInputMegapixels` | skip images bigger than this (default 4, about 2000 × 2000; up to 16). |
| `maxImageMb` | skip files bigger than this (default 30). |
| `maxImages` | stop after this many images (default 100). Billing is per unit as described above. |

### 🧾 JSON sample record

```json
{
  "record_id": "9136c311e14722902121b5dd",
  "image_url": "https://images-assets.nasa.gov/video/KSC_69-71212-sRGB/KSC_69-71212-sRGB~small_2.jpg",
  "model": "general",
  "scale": 4,
  "input_width": 200,
  "input_height": 200,
  "output_width": 800,
  "output_height": 800,
  "input_format": "jpeg",
  "output_format": "png",
  "input_bytes": 5797,
  "output_bytes": 549704,
  "has_alpha": false,
  "color_shift_fixed": 1.13,
  "units_billed": 1,
  "processing_seconds": 1.6,
  "sha256": "bc810e40807f911f7757587775e4507e7b7a48c9230b829c7b657cb507df1124",
  "file_key": "upscaled-7b3a4e7edc814400-general-x4.png",
  "file_url": "https://api.apify.com/v2/key-value-stores/l5cTCsOaQ73FIzm3r/records/upscaled-7b3a4e7edc814400-general-x4.png",
  "upscaled_at": "2026-10-18T00:05:53Z"
}
```

### 🔧 How it works

The models run on CPU inside the actor with PyTorch; the image is cut into overlapping tiles so memory stays small, and the tiles are joined without seams. The models work at 4×; for 2× and 3× the 4× result is resized down with Lanczos, which keeps the added detail. Transparency is enlarged separately and put back. The weights are the files published in the Real-ESRGAN project (BSD-3-Clause), checked against their SHA-256 when the actor is built.

Before an image is processed, its units are checked against your maximum charge: an image that would go over is skipped and smaller ones can still follow.

Every run reads each host's robots.txt first: a path it disallows is skipped, listed in the run receipt and never charged. Only public internet addresses are fetched (no private, loopback or cloud-metadata addresses, checked again on every redirect). No logins, no CAPTCHA solving, no proxies.

Saved files go to the run's own key-value store. If your Apify account keeps storages private, add your API token to the link (`?token=…`) or open the store from the run in Apify Console.

The units for each image are charged when its row is delivered. The run receipt (`RUN_RECEIPT`) lists every link with its outcome, units and time, and the units billed and charged.

### 💰 Pricing example

Per unit delivered, no start fee, no monthly charge:

| Apify plan | Price per unit |
|---|---|
| Free | $0.05 |
| Bronze | $0.045 |
| Silver | $0.04 |
| Gold, Platinum, Diamond | $0.0335 |

- The Store example, one 200 × 200 image: 1 unit = $0.05 on the Free plan, $0.0335 on Gold.
- 100 product photos of 800 × 800 with the general model (3 units each): $15.00 on Free, $10.05 on Gold.
- One 1000 × 1000 photo with the photo model (4 × 4 units): $0.80 on Free, $0.54 on Gold.

**Coverage and size.** Proof runs on 17 Oct 2026: 15 NASA video stills (800 × 800, 800 × 450 and 400 × 400) upscaled 4× with the general model in about 3.7 minutes, about 23 seconds for each 800 × 800 image; a 400 × 400 image with the photo model in about 62 seconds. Runs use 8 GB of memory (two CPU cores) by default; more memory gives more cores and faster runs. AI upscaling invents plausible detail: it is right for looks, not for reading text or facts that are not in the original.

### ⚖️ Legal & ToS

Images belong to their owners. You choose the links. Make sure you have the right to download and use the content you point it at; the actor fetches only what you give it (and, where you turn it on, what those pages link to).

Every run reads each host's robots.txt first: a path it disallows is skipped, listed in the run receipt and never charged. Only public internet addresses are fetched (no private, loopback or cloud-metadata addresses, checked again on every redirect). No logins, no CAPTCHA solving, no proxies.

### ❓ FAQ

**Is my image sent to another service?**
No. The models run inside the actor.

**Which model should I use?**
General for most photos and screenshots; photo when you want the most detail and can wait; anime for drawings, cartoons and illustrations.

**Can it upscale more than 4×?**
Not in one run. You can run the result through again.

### 🆘 Troubleshooting

- **not processed: image is over maxInputMegapixels** — Raise maxInputMegapixels (up to 16) or use a smaller copy.
- **not processed: your maximum charge does not cover its N unit(s)** — Raise your maximum charge, or use the general model.
- **SOURCE UNAVAILABLE** — None of your links could be reached after retries. Nothing was charged.

### 🔗 Related Actors

- [Brand Logo & Favicon Lookup](https://apify.com/nexgensignal/brand-logo-lookup-api) — a company's logo from its domain
- [Website Performance Audit](https://apify.com/nexgensignal/website-performance-audit-api) — Lighthouse scores and web vitals per page
- [Website Contact Scraper](https://apify.com/nexgensignal/bulk-website-contact-extractor) — contact details from website lists

🏢 **About NexGen Signal** — data tools and official-source data products. Browse the catalog: [apify.com/nexgensignal](https://apify.com/nexgensignal)

### ⭐ Found this useful?

If this actor saved you time, a rating on its Apify Store page helps other buyers find it.

Part of NexGen Signal — data tools and official-source data products.

# Actor input Schema

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

Direct links to image files. Up to 2,000 per run.

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

General suits most images. Photo is the original Real-ESRGAN x4plus model: more detail, about 15 times slower, billed ×4. Anime is tuned for drawn art, billed ×2.

## `scale` (type: `integer`):

The models work at 4×; 2× and 3× are resized down from the 4× result.

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

PNG and WebP keep transparency.

## `quality` (type: `integer`):

Ignored for PNG.

## `colorFix` (type: `boolean`):

Match the result's colour balance to the original, so the model cannot tint it. Off = the model's raw output.

## `maxInputMegapixels` (type: `integer`):

Skip images bigger than this (4 = about 2000×2000). The output is 16 times as many pixels at 4×.

## `maxImageMb` (type: `integer`):

Skip files bigger than this.

## `maxImages` (type: `integer`):

Stop after this many images are upscaled.

## Actor input object example

```json
{
  "imageUrls": [
    "https://images-assets.nasa.gov/video/KSC_69-71212-sRGB/KSC_69-71212-sRGB~small_2.jpg"
  ],
  "model": "general",
  "scale": 4,
  "outputFormat": "png",
  "quality": 92,
  "colorFix": true,
  "maxInputMegapixels": 4,
  "maxImageMb": 30,
  "maxImages": 10
}
```

# Actor output Schema

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

The delivered (and billed) records.

## `receipt` (type: `string`):

Per-link outcome, robots result, delivered and charged counts.

# 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://images-assets.nasa.gov/video/KSC_69-71212-sRGB/KSC_69-71212-sRGB~small_2.jpg"
    ],
    "maxImages": 10
};

// Run the Actor and wait for it to finish
const run = await client.actor("nexgensignal/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 = {
    "imageUrls": ["https://images-assets.nasa.gov/video/KSC_69-71212-sRGB/KSC_69-71212-sRGB~small_2.jpg"],
    "maxImages": 10,
}

# Run the Actor and wait for it to finish
run = client.actor("nexgensignal/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 '{
  "imageUrls": [
    "https://images-assets.nasa.gov/video/KSC_69-71212-sRGB/KSC_69-71212-sRGB~small_2.jpg"
  ],
  "maxImages": 10
}' |
apify call nexgensignal/ai-image-upscaler --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,nexgensignal/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/gcUiCtFwudDAPLxab/builds/AlIE1mljJqXOsLdRW/openapi.json
