# AI Image Upscaler — 2x/4x Real-ESRGAN, Photo & Anime (`actor-forge/image-upscaler`) Actor

Upscale images 2× or 4× with AI (Real-ESRGAN compact models): sharper detail, fewer JPEG artefacts. Photo and anime models, PNG/JPG/WebP output, bulk image URLs. Pay per image.

- **URL**: https://apify.com/actor-forge/image-upscaler.md
- **Developed by:** [ActorForge](https://apify.com/actor-forge) (community)
- **Categories:** AI, Developer tools, Automation
- **Features:** Limited permissions
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $6.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 — 2x/4x Real-ESRGAN, Photo & Anime

Upscale images 2× or 4× with AI (Real-ESRGAN compact models): sharper detail, fewer JPEG artefacts. Photo and anime models, PNG/JPG/WebP output, bulk image URLs. Pay per image.

**Upscale images 2× or 4× with AI and get sharper, cleaner results than a plain resize.** Paste image URLs and get each one back enlarged by **Real-ESRGAN**, the widely used open-source super-resolution network, with a **direct download link** and a row showing the **original and new dimensions** and processing time. Two compact models are built in: **Photo** (Real-ESRGAN general x4v3) for photos, product shots, scans and screenshots; it also cleans up JPEG artefacts and mild noise. **Anime** (Real-ESRGAN animevideo v3) for anime, cartoons, illustrations, logos and flat graphics. Output as **PNG** (lossless, keeps transparency), **JPG** or **WebP**. Transparent images keep their alpha channel. Use it to enlarge small product photos for e-commerce listings, restore old low-resolution pictures, upscale AI-generated or anime art, prepare images for print, or as an upscaling step for AI agents and automation pipelines. It runs on CPU with no GPU queue and no sign-up anywhere else, and needs no API key. **$0.006 per image up to 0.25 megapixels** (e.g. 500×500 → 2000×2000), plus $0.006 per further 0.25 MP of input, so a 1000×1000 photo costs $0.024. No face restoration or generative "hallucinated" detail: the networks sharpen what is there. Failed and oversized images are never charged.

### What data does it return?

Every run outputs clean, schema-validated rows like these:

| fileName | format | scale | model | originalWidth | originalHeight | width | height | eventsCharged | processingMs |
| --- | --- | --- | --- | --- | --- | --- | --- | --- | --- |
| 1-500px-The_Earth_seen_from_Apollo_17-2000x2000.jpg | jpg | 4 | photo | 500 | 500 | 2000 | 2000 | 1 | 5543 |
| 2-960px-The_Earth_seen_from_Apollo_17-3840x3844.jpg | jpg | 4 | photo | 960 | 961 | 3840 | 3844 | 4 | 16300 |

### How much does it cost?

Transparent pay-per-event pricing — you only pay for what you get, and the
actor **always respects your run budget**: set a maximum total charge and it
stops cleanly at the cap instead of overrunning.

| Event | Price | Charged | Worked example |
| --- | --- | --- | --- |
| `image-upscaled` | $0.006 | per image upscaled and delivered, covering an input of up to 0.25 megapixels (e.g. 500×500); 2× or 4×, any model and output format | 100 product photos of 400×400 = $0.60; 1,000 = $6 |
| `extra-input-block` | $0.006 | per additional started 0.25 megapixels of input image (AI upscaling time grows with the number of input pixels) | A 1000×1000 (1 MP) photo = $0.006 + 3 × $0.006 = $0.024; a 1920×1080 (2.07 MP) image = $0.054 |
| `apify-actor-start` | $0.00005 | per run per GB of memory (platform start fee) | One run at 2 GB = $0.0001 |

### Input options

| Field | Type | Required | Default | Description |
| --- | --- | --- | --- | --- |
| `imageUrls` | array | yes | — | Direct links to the images to upscale (JPEG, PNG, WebP, AVIF, GIF first frame, TIFF). Up to 20 MB per file. Inputs are limited by 'Max input size' below (1 megapixel by default, e.g. 1000×1000). |
| `scale` | string | no | `"2"` | 2× doubles width and height (4× the pixels); 4× quadruples them. Both run the same 4× AI model; 2× is then downsampled with Lanczos, so the price is the same. |
| `model` | string | no | `"photo"` | 'Photo' (Real-ESRGAN general x4v3) suits photos, product shots, scans and mixed content and removes JPEG artefacts and mild noise. 'Anime' (Real-ESRGAN animevideo v3) suits anime, cartoons, illustrations, logos and flat graphics, and is about twice as fast. |
| `format` | string | no | `"png"` | PNG is lossless (largest files, keeps transparency). JPG is smallest for photos (transparency becomes white). WebP is small and keeps transparency. |
| `quality` | integer | no | `92` | Compression quality for JPG and WebP output. Ignored for PNG. |
| `maxInputMegapixels` | number | no | `1` | Images larger than this are skipped (not charged) instead of upscaled. 1 MP ≈ 1000×1000. Hard limit 4 MP (2000×2000). Larger inputs cost more: see pricing. |
| `maxImages` | integer | no | `100` | Stop after this many images have been upscaled. |

### Limits & honest notes

- Input: direct image URLs (JPEG, PNG, WebP, AVIF, TIFF, the first frame of GIFs). Up to 20 MB per file. To grab every image on a web page first, use our Bulk Image Downloader.
- Input size is capped by 'Max input size' (1 MP by default, at most 4 MP, e.g. 2000×2000). Larger images are reported as errors and not charged; shrink them first with our Image Converter. The output is 2× or 4× the input, so a 4 MP input at 4× becomes a 64 MP (8000×8000) image.
- Speed: the AI runs on CPU. With the default 2 GB of memory, a 500×500 image takes about 5 seconds and a 1000×1000 image about a minute. With 8 GB, images are processed about 4× faster (1000×1000 in about 16 seconds). The price is the same at any memory size.
- 2× uses the same 4× network and then downsamples with Lanczos, exactly like the original Real-ESRGAN tools, so 2× and 4× cost the same.
- These are compact Real-ESRGAN networks, chosen for speed. They sharpen edges and remove compression artefacts but do not invent new detail the way diffusion upscalers do, and there is no face restoration. Very blurry or tiny faces stay soft.
- Transparency is upscaled with Lanczos (the AI enhances the colour channels). JPG output fills transparent areas with white.
- EXIF orientation is applied (photos come out upright); other metadata is not copied to the output. Colours are converted to sRGB.
- Download links work for the lifetime of the run's storage (Apify's data retention for your plan).
- Models: Real-ESRGAN general x4v3 and animevideo v3 by Xintao Wang et al., BSD-3-Clause licence, converted to ONNX.

### Related ActorForge actors

- [Image Converter & Compressor](https://apify.com/actor-forge/image-converter) — resize or convert the upscaled images
- [Bulk Image Downloader](https://apify.com/actor-forge/bulk-image-downloader) — collect image URLs from a page first

### Changelog

- **2026-11-12** — Initial release: 2×/4× AI upscaling with Real-ESRGAN compact photo and anime models on CPU, PNG/JPG/WebP output, transparency support, megapixel-based pricing.

***

*Built and maintained by **ActorForge**. Reliability first: every actor in the
portfolio is monitored by an automated nightly self-test, and breakages are
typically fixed the same day.*

# Actor input Schema

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

Direct links to the images to upscale (JPEG, PNG, WebP, AVIF, GIF first frame, TIFF). Up to 20 MB per file. Inputs are limited by 'Max input size' below (1 megapixel by default, e.g. 1000×1000).

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

2× doubles width and height (4× the pixels); 4× quadruples them. Both run the same 4× AI model; 2× is then downsampled with Lanczos, so the price is the same.

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

'Photo' (Real-ESRGAN general x4v3) suits photos, product shots, scans and mixed content and removes JPEG artefacts and mild noise. 'Anime' (Real-ESRGAN animevideo v3) suits anime, cartoons, illustrations, logos and flat graphics, and is about twice as fast.

## `format` (type: `string`):

PNG is lossless (largest files, keeps transparency). JPG is smallest for photos (transparency becomes white). WebP is small and keeps transparency.

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

Compression quality for JPG and WebP output. Ignored for PNG.

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

Images larger than this are skipped (not charged) instead of upscaled. 1 MP ≈ 1000×1000. Hard limit 4 MP (2000×2000). Larger inputs cost more: see pricing.

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

Stop after this many images have been upscaled.

## Actor input object example

```json
{
  "imageUrls": [
    "https://upload.wikimedia.org/wikipedia/commons/thumb/9/97/The_Earth_seen_from_Apollo_17.jpg/250px-The_Earth_seen_from_Apollo_17.jpg"
  ],
  "scale": "2",
  "model": "photo",
  "format": "png",
  "quality": 92,
  "maxInputMegapixels": 1,
  "maxImages": 100
}
```

# Actor output Schema

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

One row per upscaled image with a download link, original and new dimensions, size and processing time, plus a row for each URL that failed (not charged).

## `summary` (type: `string`):

Images upscaled, failed inputs, scale and model.

# 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/thumb/9/97/The_Earth_seen_from_Apollo_17.jpg/250px-The_Earth_seen_from_Apollo_17.jpg"
    ],
    "scale": "2"
};

// Run the Actor and wait for it to finish
const run = await client.actor("actor-forge/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://upload.wikimedia.org/wikipedia/commons/thumb/9/97/The_Earth_seen_from_Apollo_17.jpg/250px-The_Earth_seen_from_Apollo_17.jpg"],
    "scale": "2",
}

# Run the Actor and wait for it to finish
run = client.actor("actor-forge/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://upload.wikimedia.org/wikipedia/commons/thumb/9/97/The_Earth_seen_from_Apollo_17.jpg/250px-The_Earth_seen_from_Apollo_17.jpg"
  ],
  "scale": "2"
}' |
apify call actor-forge/image-upscaler --silent --output-dataset

```

## MCP server setup

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